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 Piyush Gupta
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.
- Download PostCompass for your system from the download page and open it.
- In the setup, choose Install PostgreSQL, or later go to Databases and click New local database.
- Pick a version (PostgreSQL 14 to 18), a port and a password, then click Install.
- 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.
postgresql://postgres:YOUR_PASSWORD@127.0.0.1:5432/postgresOption 2: Your system's package manager
Package managers install PostgreSQL as a system service. They usually need admin rights.
brew install postgresql@18
brew services start postgresql@18sudo apt update
sudo apt install postgresql
sudo systemctl start postgresqlsudo dnf install postgresql-server
sudo postgresql-setup --initdb
sudo systemctl start postgresqlNote: 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.