I’ve installed SQLite3 on dozens of Linux systems, and Fedora and CentOS make it straightforward. Let me walk you through the entire process, from understanding what you’re getting to handling common issues.
SQLite installation tutorials
- Multi-Platform SQLite Installation Guide
- Install SQLite3 on Debian Using APT
- Install SQLite3 on Ubuntu Using APT
- Install SQLite3 on macOS (Built-in Installation Guide)
- Install SQLite3 on Fedora/CentOS
- Install SQLite3 on Android (using Termux)
- Install SQLite3 in iOS Apps (Objective C and Swift)
- Install SQLite3 in a Python Virtual Environment
What SQLite3 Actually Gives You
SQLite3 is a serverless database engine that lives directly inside your application. Unlike PostgreSQL or MySQL, there’s no separate server process to manage. The entire database sits in a single file on your disk. When you install SQLite3 on your system, you get both the command-line tool and the development libraries that let other programs use it.
The Installation Command
Open your terminal and run:
sudo dnf install sqlite
If you’re on an older CentOS system (before CentOS 8), use:
sudo yum install sqlite
The package manager will show you what it plans to install and ask for confirmation. Type y
and press Enter.
Getting the Development Libraries
Here’s something I learned the hard way: if you plan to write programs that use SQLite3, or if you need to compile software that depends on it, you need the development package too:
sudo dnf install sqlite-devel
The main sqlite
package gives you the command-line tool. The sqlite-devel
package provides header files and libraries that developers need. I’ve seen plenty of compile errors from people who skipped this step.
Verifying Your Installation
After installation completes, check which version you got:
sqlite3 --version
You should see output like 3.34.1
or whatever version is current in your distribution’s repositories. Fedora typically ships newer versions than CentOS because it updates more frequently.
Your First SQLite3 Session
Launch the SQLite3 shell:
sqlite3
You’ll see a prompt that looks like sqlite>
. Try creating a quick test database:
CREATE TABLE test (id INTEGER PRIMARY KEY, name TEXT);
INSERT INTO test VALUES (1, 'working');
SELECT * FROM test;
Exit the shell with .quit
or press Ctrl+D
.
Working With Database Files
When you want to work with a specific database file:
sqlite3 mydatabase.db
If the file doesn’t exist, SQLite3 creates it. If it does exist, SQLite3 opens it. The database file can live anywhere you have write permissions.
Common Installation Issues
Problem: DNF or YUM can’t find the package.
Solution: Your system repositories might need updating. Run sudo dnf update
or sudo yum update
first. On CentOS, you might need to enable EPEL (Extra Packages for Enterprise Linux):
sudo yum install epel-release
sudo yum update
Problem: Permission denied errors when trying to create databases.
Solution: SQLite3 needs write access to the directory where you’re creating the database file. Create databases in your home directory or a location where your user has permissions.
Problem: Compile errors mentioning sqlite3.h not found.
Solution: Install the sqlite-devel
package. Compilers need those header files.
Checking Available Packages
Want to see what SQLite-related packages are available?
dnf search sqlite
or
yum search sqlite
You’ll see packages like sqlite-tcl
(Tcl bindings), sqlite-doc
(documentation), and various language-specific bindings.
Performance Considerations
SQLite3 works great for applications with moderate write loads and any read load. I’ve used it successfully for:
- Local development databases
- Application configuration storage
- Log aggregation on single servers
- Small to medium web applications
Where it struggles: high-concurrency write scenarios. Multiple processes can read simultaneously, but writes lock the entire database file. For heavy concurrent writes, you’ll want PostgreSQL or MySQL instead.
The Development Workflow
When building applications, I keep a development database separate from production data. Create a test database:
sqlite3 dev_test.db
Load your schema, add test data, experiment. The beauty of SQLite3 is you can delete the entire file and start fresh in seconds. No complicated server resets needed.
Integration With Other Tools
Many programming languages have built-in SQLite3 support. Python includes sqlite3 in its standard library. PHP has PDO SQLite drivers. Ruby has the sqlite3 gem. Once you’ve installed the system package, these language bindings typically work without additional setup.
Backup Strategy
Backing up SQLite3 databases is simple because each database is a single file. Just copy the file:
cp mydatabase.db mydatabase_backup.db
For live databases where writes might be happening, use the SQLite3 backup command:
sqlite3 mydatabase.db ".backup backup.db"
When to Choose SQLite3
SQLite3 makes sense when:
- You need embedded database functionality
- Your application runs on a single server
- You want zero configuration overhead
- You’re prototyping or building MVPs
- You need reliable local data storage
Skip it when:
- You need high-concurrency writes
- You’re running distributed systems
- You need complex user permission systems
- You require database-level replication
The installation takes about 30 seconds. The learning curve is gentle. You get a production-ready database engine without managing servers, users, or complex configurations. That’s the value proposition that has made SQLite3 the most deployed database engine in the world.