Skip to content

How to install SQLite3 in CentOS 7?

Updated 1 min read

Updated: 28 September 2026 · Applies to: Ubuntu 24.04, Debian 12, AlmaLinux 9 and Rocky Linux 9

CentOS 7 is end of life. SQLite is a small SQL database stored in a single file, with no server process. PHP, Python and many other languages include SQLite support. On Ubuntu 24.04, Debian 12, AlmaLinux 9 and Rocky Linux 9 install the command-line shell:

dnf install sqlite       # AlmaLinux / Rocky 9 (SQLite 3.34)
apt install sqlite3      # Ubuntu 24.04 (3.45) / Debian 12

Use it

sqlite3 shop.db
CREATE TABLE products (id INTEGER PRIMARY KEY, name TEXT, price REAL);
INSERT INTO products (name, price) VALUES ('VPS', 9.99);
SELECT * FROM products;
.tables          -- list tables
.schema          -- show table definitions
.mode box        -- nicer output
.quit

Backup

sqlite3 shop.db ".backup 'shop-backup.db'"     # safe even while the database is in use
sqlite3 shop.db .dump > shop.sql                  # as SQL text

When to use SQLite

  • Good for small websites, tools, tests and applications with one writer at a time.
  • For many simultaneous writers (busy shops, forums), use MariaDB or PostgreSQL.

Note: The web server needs write permission on the database file and its folder, because SQLite creates temporary files next to it. Keep the file outside the public web folder.

Related services

KVM VPS hosting

NVMe SSD and full root access, with Free Basic Managed Support.

Unmanaged dedicated servers

full root access and free IPMI KVM, with Free Basic Managed Support.

Linux server management

hardening, patching, monitoring and automation for Ubuntu, Debian, RHEL and AlmaLinux.

Was this answer helpful?

Still stuck? Open a ticket