How to Install SQLite on Ubuntu and Debian with APT (Tested)

On Ubuntu and Debian, the sqlite3 command is a separate package that a fresh install may not include, and then typing sqlite3 gives command not found. A single apt command fixes that. In this article I’ll walk you through installing it, plus the developer files and a GUI if you need them.

TLDR

  • Install the shell with sudo apt update and then sudo apt install sqlite3.
  • Check it with sqlite3 --version. Ubuntu 24.04 installs 3.45.1, and Debian 13 installs 3.46.1.
  • For compiling programs against SQLite, add sudo apt install libsqlite3-dev.
  • For a GUI, sudo apt install sqlitebrowser installs DB Browser for SQLite.
  • The same commands work on Debian and Ubuntu.

What are you installing?

The sqlite3 package is the command-line shell, where you type SQL and see results. It depends on libsqlite3-0, the SQLite library that programs such as Python link to. libsqlite3-dev adds the C header and link files for building software. All three come from the main Ubuntu and Debian archives (Ubuntu sqlite3 package, Debian sqlite3 package).

Prerequisites

RequirementDetail
SystemUbuntu or Debian. Tested on Ubuntu 24.04.5 LTS and Debian 13 (trixie)
AccessA user with sudo. The tests ran as root in containers, so the outputs show no sudo
NetworkNeeded for apt to download packages

How to install SQLite on Ubuntu

To show you each step, I ran them in fresh Ubuntu 24.04 and Debian 13 containers. Neither had sqlite3 to begin with:

# sqlite3 --version
bash: line 1: sqlite3: command not found

Step 1: Update the package lists

sudo apt update
# apt update 2>/dev/null | tail -n 1
3 packages can be upgraded. Run 'apt list --upgradable' to see them.

Step 2: Check which version you’ll get

apt-cache policy shows the candidate version before you install anything:

# apt-cache policy sqlite3 | head -n 3
sqlite3:
  Installed: (none)
  Candidate: 3.45.1-1ubuntu2.8

Step 3: Install sqlite3

sudo apt install sqlite3

APT installs the shell along with the library and readline, which gives the shell command history:

# apt install -y sqlite3 2>/dev/null | grep -E '^Setting up|newly installed|Installing: '
0 upgraded, 4 newly installed, 0 to remove and 3 not upgraded.
Setting up libsqlite3-0:arm64 (3.45.1-1ubuntu2.8) ...
Setting up readline-common (8.2-4build1) ...
Setting up libreadline8t64:arm64 (8.2-4build1) ...
Setting up sqlite3 (3.45.1-1ubuntu2.8) ...

How to install SQLite on Debian

The commands are the same on Debian. Debian 13 ships a newer SQLite than Ubuntu 24.04:

# apt-cache policy sqlite3 | head -n 3
sqlite3:
  Installed: (none)
  Candidate: 3.46.1-7+deb13u2
# apt install -y sqlite3 2>/dev/null | grep -E '^Setting up|newly installed|Installing: '
  Upgrading: 0, Installing: 3, Removing: 0, Not Upgrading: 0
Setting up readline-common (8.2-6) ...
Setting up libreadline8t64:arm64 (8.2-6) ...
Setting up sqlite3 (3.46.1-7+deb13u2) ...

Check that it works

Print the version and the path:

# sqlite3 --version | cut -d' ' -f1-2
3.45.1 2024-01-30
# command -v sqlite3
/usr/bin/sqlite3

Then create a database with two rows and read them back:

# sqlite3 testdb.db "CREATE TABLE posts (id INTEGER PRIMARY KEY, title TEXT NOT NULL); INSERT INTO posts (title) VALUES ('Hello'), ('Second post');"
# sqlite3 -header -column testdb.db "SELECT * FROM posts;"
id  title
--  -----------
1   Hello
2   Second post

Install the development files

Programs you compile against SQLite need its header, sqlite3.h. The libsqlite3-dev package provides it:

# apt install -y libsqlite3-dev 2>/dev/null | grep -E '^Setting up libsqlite3-dev'
Setting up libsqlite3-dev:arm64 (3.45.1-1ubuntu2.8) ...
# ls /usr/include/sqlite3.h
/usr/include/sqlite3.h

You don’t need it for the sqlite3 shell, or for Python’s built-in sqlite3 module.

Install a SQLite GUI on Ubuntu

DB Browser for SQLite is in the Ubuntu and Debian archives as sqlitebrowser. SQLiteStudio isn’t packaged there:

# apt-cache policy sqlitebrowser | head -n 3; apt-cache show sqlitestudio 2>&1 | head -n 1
sqlitebrowser:
  Installed: (none)
  Candidate: 3.12.2-3build2
E: No packages found

Install it with sudo apt install sqlitebrowser (not executed here, because the test containers have no display), then start it with sqlitebrowser.

Troubleshooting

  • sqlite3: command not found: the shell isn’t installed, even if the library is. Run sudo apt install sqlite3.
  • E: Unable to locate package sqlite3: the package lists are empty or stale. Run sudo apt update first.
  • You need a newer SQLite than your release ships: the archive version is fixed for each release. Use a newer Ubuntu or Debian release, or build from the source on sqlite.org.

Upgrading or uninstalling

sudo apt upgrade picks up security updates for SQLite along with everything else. To remove the shell, run sudo apt remove sqlite3. It removes only the sqlite3 package, and the library stays installed:

# apt remove -y sqlite3 2>/dev/null | grep -E '^Removing'
Removing sqlite3 (3.45.1-1ubuntu2.8) ...
# command -v sqlite3 || echo 'sqlite3 removed'
sqlite3 removed

Conclusion

On Ubuntu and Debian, sudo apt install sqlite3 is the whole install. Add libsqlite3-dev when you compile against SQLite, and sqlitebrowser when you want a GUI.

Further reading

Tested with SQLite 3.45.1 on Ubuntu 24.04.5 LTS and 3.46.1 on Debian 13, in ubuntu:24.04 and debian:13 containers (arm64), 7 October 2026.