Install PostgreSQL 18 on macOS
Compare Homebrew, Postgres.app, and the graphical installer, then verify the local server
The PostgreSQL macOS download page lists three common paths: the EDB graphical installer, Postgres.app, and Homebrew. Do not run several installations on port 5432 accidentally; choose one and record its data directory.
Homebrew
brew update
brew install postgresql@18
brew services start postgresql@18
"$(brew --prefix postgresql@18)/bin/psql" --versionHomebrew may not place a versioned client in the default PATH. For a persistent shell setup, follow the path printed by brew info postgresql@18 instead of copying a Cellar path that can change on upgrade.
Verify the connection:
"$(brew --prefix postgresql@18)/bin/psql" -X -d postgres \
-c "select version(), current_setting('data_directory');"Use -U and -d when your local role or database differs.
Postgres.app or graphical installer
- Postgres.app fits local developers who want menu-bar start/stop with little system configuration.
- The EDB installer includes the server, pgAdmin, and StackBuilder for a guided graphical setup.
After installation, do not rely on an icon alone. Run this through the bundled psql:
SELECT version(), current_database(), current_user;Apple Silicon and Intel
Confirm that the package or Homebrew prefix matches arm64/amd64. Do not copy a data directory across architectures; prefer logical backup or a tested upgrade path.
Diagnose multiple versions
which -a psql
psql --version
lsof -nP -iTCP:5432 -sTCP:LISTENA client/server version difference does not automatically require reinstalling. Confirm the actual target first; a client no older than the server is generally the safer choice.
Last updated on