# How to install SQLite on macOS

> Learn how to install and use SQLite on macOS, where it comes preinstalled, by running the sqlite3 command and connecting to a database file with TablePlus.

Author: Flavio Copes | Published: 2019-12-28 | Canonical: https://flaviocopes.com/sqlite-how-to-install/

> I'm a Mac user and I do not own a Windows computer, so I can't write the instructions for Windows. Google "how to install sqlite on windows" for specific instructions. Same goes for Linux.

On macOS, you don't need to do anything to install sqlite. It's preinstalled in all modern versions of macOS.

All you need to do is to open a terminal and run the

```bash
sqlite3
```

command.

![Terminal window showing SQLite 3.24.0 command line interface with version info and sqlite prompt](https://flaviocopes.com/images/sqlite-how-to-install/Screen_Shot_2019-12-16_at_21.07.21.png)

Press ctrl-C 2 times to exit the SQLite executable.

This is pretty cool!

> My macOS with Mojave comes with SQLite 3.24, and the latest version (at the time of writing) is SQLite 3.30. You can upgrade SQLite using Homebrew, but for the sake of simplicity, I'm not going to cover this.

A great software we can use to interact with a SQLite database is TablePlus. It comes with a free trial that's perfect for our usage, because it's not time-based but rather it limits the amount of concurrent connections you can make to the database.

Download it from <https://tableplus.com>. I know there are macOS, Windows and Linux versions.

![TablePlus welcome screen showing the app logo and Create a new connection button](https://flaviocopes.com/images/sqlite-how-to-install/Screen_Shot_2019-12-16_at_21.12.18.png)

You create a new connection, choosing SQLite:

![TablePlus database selection dialog showing various database icons including SQLite highlighted in purple](https://flaviocopes.com/images/sqlite-how-to-install/Screen_Shot_2019-12-16_at_21.12.30.png)

You select a name, and type a database path. I choose `test.db`, in the `/Users/flaviocopes/` folder:

![TablePlus SQLite connection form with test name and database path set to test.db](https://flaviocopes.com/images/sqlite-how-to-install/Screen_Shot_2019-12-16_at_21.19.25.png)

SQLite is pretty cool because the database is contained in a file, which you can put pretty much everywhere you want. This is radically different from PostgreSQL, and MySQL and other big DBMS.

If you're wondering how SQLite compares to those bigger databases, I built a free [Postgres vs SQLite vs MySQL comparison tool](https://flaviocopes.com/tools/postgres-sqlite-mysql/) that lays out the differences.

Pressing `Connect`, the connection was successfully created:

![TablePlus interface showing successful connection to test.db with empty database and pirate mascot illustration](https://flaviocopes.com/images/sqlite-how-to-install/Screen_Shot_2019-12-16_at_21.19.14.png)

and I can see the file created in that folder, with zero KB of size:

![macOS Finder showing test.db file properties with zero bytes size and SQLite file type information](https://flaviocopes.com/images/sqlite-how-to-install/Screen_Shot_2019-12-16_at_21.25.20.png)

That's it.

I'm going to make more tutorials on how to use this SQLite database, soon.
