How to run PostgreSQL locally without Docker

Three ways to get a local PostgreSQL server on Windows, macOS or Linux without Docker: a one-click app, your system's package manager, or the official installer.

Updated · 5 min read · By

Why skip Docker for local PostgreSQL?

Docker is a great way to run PostgreSQL, but for day-to-day development it adds a background engine, volume mounts and port mappings to think about. On Windows and macOS it also runs inside a virtual machine. If you just want a database on localhost for an app you're building, running PostgreSQL directly is simpler and starts faster.

Option 1: One click with PostCompass (Windows, macOS, Linux)

PostCompass is a free, open-source PostgreSQL GUI that can also install and run PostgreSQL for you. It downloads the official PostgreSQL binaries for your system, verifies their SHA-256 checksum and runs the server as your user, so no admin rights are needed.

  1. Download PostCompass for your system from the download page and open it.
  2. In the setup, choose Install PostgreSQL, or later go to Databases and click New local database.
  3. Pick a version (PostgreSQL 14 to 18), a port and a password, then click Install.
  4. When it finishes, click Open to browse tables and run SQL, or copy the connection string for your app.

The server listens only on 127.0.0.1, uses scram-sha-256 authentication, and the password is stored in your operating system's keychain. You can start, stop, back up and remove the server from the Databases page.

Connection string for your app
postgresql://postgres:YOUR_PASSWORD@127.0.0.1:5432/postgres

Option 2: Your system's package manager

Package managers install PostgreSQL as a system service. They usually need admin rights.

macOS (Homebrew)
brew install postgresql@18
brew services start postgresql@18
Ubuntu / Debian
sudo apt update
sudo apt install postgresql
sudo systemctl start postgresql
Fedora
sudo dnf install postgresql-server
sudo postgresql-setup --initdb
sudo systemctl start postgresql

Note: Distribution packages often ship an older PostgreSQL major version. For a specific version, use the PostgreSQL project's own apt or yum repository.

Option 3: The official installer (Windows and macOS)

postgresql.org links to graphical installers for Windows and macOS. They install PostgreSQL as a system service that starts with your computer, and need admin rights to install.

Which should you choose?

  • Want a database for development, no admin rights, several versions side by side and a GUI included: PostCompass.
  • Want PostgreSQL managed like other system software, or are on a server: your package manager.
  • Want a traditional installer with a system service: the official installer.

More guides