- Install PostgreSQL 17
brew install postgresql@17 - Start it now and on every login
brew services start postgresql@17 - Put psql on your PATH
echo 'export PATH="/opt/homebrew/opt/postgresql@17/bin:$PATH"' >> ~/.zshrc source ~/.zshrc
Check it worked
- Connect to it
psql postgres -c "SELECT version();"
Undo it
- Stop and uninstall
brew services stop postgresql@17 && brew uninstall postgresql@17
- Install PostgreSQLNeeds sudo
sudo apt install -y postgresql - Start it now and on every bootNeeds sudo
sudo systemctl enable --now postgresql
Check it worked
- Connect to it
sudo -u postgres psql -c "SELECT version();"
Undo it
- Uninstall PostgreSQLNeeds sudo
sudo apt remove -y postgresql
- Install PostgreSQL 17
winget install PostgreSQL.PostgreSQL.17The installer asks you to set a password for the postgres user. Keep it somewhere safe.
- Put psql on your PATH
[Environment]::SetEnvironmentVariable("Path", [Environment]::GetEnvironmentVariable("Path", "User") + ";C:\Program Files\PostgreSQL\17\bin", "User")Close and reopen PowerShell afterwards.
Check it worked
- Connect to it
psql -U postgres -c "SELECT version();"
Undo it
- Uninstall PostgreSQL
winget uninstall PostgreSQL.PostgreSQL.17