Menu
Try in Playground

Install SQLite: Setup on Windows, macOS, and Linux

How to install SQLite on Windows, macOS, and Linux — getting the command-line tool, putting it on your PATH, and verifying everything works.

This page includes runnable editors — edit, run, and see output instantly.

SQLite Is Already on Your Computer (Probably)

Before you install anything, check what you already have. SQLite ships with macOS, with most Linux distributions, and inside countless apps you already use. Open a terminal and run:

sqlite3 --version

If you see something like 3.43.2 2023-10-10 ..., you're done — skip to the verification section at the bottom of this page. If you get command not found or a version older than 3.35, read on. We'll cover Windows, macOS, and Linux in turn.

The thing you're installing is the sqlite3 command-line tool. The library that programs link against is a separate package, but most installers bundle them together.

Windows: Download and Add to PATH

Windows doesn't ship with SQLite, and there's no traditional installer — SQLite is distributed as a small zip of executables you place wherever you want.

  1. Go to sqlite.org/download.html.
  2. Under Precompiled Binaries for Windows, download the file named sqlite-tools-win-x64-*.zip.
  3. Extract it to a folder. C:\sqlite is a common choice.
  4. Add that folder to your PATH so you can run sqlite3 from any directory.

To add it to PATH: open the Start menu, search for "environment variables", click Edit the system environment variables, then Environment Variables..., find Path under user variables, click Edit, and add C:\sqlite as a new entry.

Open a new terminal window (PATH changes don't apply to terminals already open) and verify:

sqlite3 --version

You should see the version string. If you get 'sqlite3' is not recognized, the folder isn't on your PATH or the new terminal didn't pick up the change yet.

macOS: Use Homebrew for the Latest Version

macOS includes sqlite3 out of the box, but the system version lags behind upstream by a year or two. For tutorials and casual use that's fine. If you want recent features (STRICT tables, JSON improvements, better window functions), install a current version with Homebrew:

brew install sqlite

Homebrew installs SQLite into its own prefix and deliberately doesn't override the system copy. To use the Homebrew version by default, prepend it to your PATH. Add this to your ~/.zshrc:

export PATH="/opt/homebrew/opt/sqlite/bin:$PATH"

(Use /usr/local/opt/sqlite/bin instead on Intel Macs.) Reload your shell with source ~/.zshrc and check:

sqlite3 --version

If the version still looks old, the system sqlite3 is winning the PATH race — double-check the export line came before any other PATH modifications.

Linux: Use Your Package Manager

Almost every Linux distribution has SQLite in its default repositories. The command varies by distro:

# Debian, Ubuntu, Mint
sudo apt update
sudo apt install sqlite3

# Fedora, RHEL, CentOS Stream
sudo dnf install sqlite

# Arch, Manjaro
sudo pacman -S sqlite

# Alpine
sudo apk add sqlite

The package name is sqlite3 on Debian-family systems and just sqlite on most others. All of them install the sqlite3 command-line tool plus the shared library that other programs use to embed SQLite.

If you need the very latest version and your distro is behind, you can build from source — download the amalgamation tarball from sqlite.org and run ./configure && make && sudo make install. For 99% of users, the package manager version is fine.

Verify the Installation

Whichever path you took, the same two-step check tells you everything works. First, the version:

sqlite3 --version

You should see a version number, a date, and a build hash. Then open the SQLite shell with no arguments — that gives you an in-memory database to play with:

sqlite3

You'll land at a prompt that looks like sqlite>. Type a tiny query to make sure the engine actually runs:

You should get back the version string and the greeting. To leave the shell, type .quit and press Enter. The leading dot is important — that's how SQLite distinguishes shell commands (.quit, .help, .tables) from SQL statements.

Common Snags

A few things trip people up on the first install:

  • sqlite3: command not found after install. The binary is somewhere, but not on your PATH. On Windows, re-check the environment variable. On macOS with Homebrew, confirm the export PATH=... line is in your shell config and that you opened a fresh terminal.
  • Wrong version showing up on macOS. The system sqlite3 lives at /usr/bin/sqlite3 and almost always wins by default. Run which sqlite3 to see which one your shell picks. The Homebrew copy needs to come earlier on PATH.
  • .quit doesn't work. You probably typed quit without the leading dot, which SQLite tries to parse as SQL. Always start shell commands with ..
  • No write permission errors when creating a database file. SQLite needs write access to the directory you run it in. Either cd somewhere writable first, or pass an explicit path: sqlite3 ~/mydb.db.

If sqlite3 --version works and you can run a SELECT, you're set. Everything else in this curriculum builds on the CLI you just installed.

Next: The SQLite CLI

Now that sqlite3 is on your PATH, the next step is learning to drive it. The shell has a small set of dot-commands (.tables, .schema, .mode, .import) that turn it into a surprisingly capable database client — that's what the next page covers.

Frequently Asked Questions

How do I install SQLite on Windows?

Download the sqlite-tools zip from sqlite.org, extract it to a folder like C:\sqlite, and add that folder to your PATH. Then open a fresh terminal and run sqlite3 --version to confirm. There's no installer — SQLite is just a single executable.

How do I install SQLite on macOS?

macOS already ships with sqlite3, so you can usually just run it. To get the latest version, install via Homebrew: brew install sqlite. Homebrew keeps it up to date but doesn't replace the system copy — you may need to adjust your PATH if you want the new one to win.

How do I install SQLite on Ubuntu or other Linux?

On Debian and Ubuntu, run sudo apt install sqlite3. On Fedora, sudo dnf install sqlite. On Arch, sudo pacman -S sqlite. The package manager pulls in the sqlite3 command-line tool and the shared library.

How do I check if SQLite is installed?

Open a terminal and run sqlite3 --version. If SQLite is installed and on your PATH, you'll see a version number and build date. If you get 'command not found', either it isn't installed or the install location isn't on your PATH.

Coddy programming languages illustration

Learn to code with Coddy

GET STARTED