Install SQLite on Linux
Linux gives you two common routes: install via your distro packages (quickest) or build from source (most control).
This page focuses on the source path; package-manager commands are covered in detail in Install SQLite with Package Manager.
Core Concepts
Linux Setup Paths
flowchart LR
A[Need sqlite3 on Linux] --> B{Preferred approach}
B -->|Fastest| C[Install from distro repo]
B -->|Custom/latest control| D[Build from source]
C --> E[Verify version]
D --> E
Source Build Prerequisites
| Requirement | Why you need it |
|---|---|
C compiler (gcc or clang) | Compiles SQLite source |
make | Runs build steps |
Shell tools (tar, wget/curl) | Download and unpack source archive |
- Build From Source
- Verify
# Download source archive from sqlite.org (replace with current release URL).
SRC_URL="https://www.sqlite.org/2026/sqlite-autoconf-3490100.tar.gz"
wget "$SRC_URL"
# Extract and enter source directory.
tar -xzf sqlite-autoconf-3490100.tar.gz
cd sqlite-autoconf-3490100
# Configure, compile, and install.
./configure
make
sudo make install
| Expected output |
|---|
Build logs from configure/make; install step finishes without errors. |
# Check command resolution and version after installation.
which sqlite3
sqlite3 --version
| Expected output |
|---|
A binary path (for example /usr/local/bin/sqlite3) and a version string. |
Code Examples
# Sanity test: execute one query in an in-memory database.
sqlite3 ":memory:" "SELECT 'Linux ready' AS status;"
| status |
|---|
| Linux ready |
SQLite-Specific Nuances
SQLite Nuance
Building from source can give you a newer CLI than your distro package, but maintenance becomes your responsibility.
For many learners, distro packages are the most practical default.
Common Pitfalls / Best Practices
Pitfall
Installing from source and then forgetting that an older distro sqlite3 still appears first in PATH.
Always verify with which sqlite3.
Best Practice
If your goal is learning SQL (not build engineering), prefer package-manager installation first.
Quick Challenge
After installing SQLite, run:
which sqlite3sqlite3 ":memory:" "SELECT 1 AS ok;"
View Solution
You should see a valid binary path and query output:
| ok |
|---|
| 1 |