π Installing PostgreSQL on macOS
PostgreSQL is a powerful open-source relational database used in many production systems. It works well with frameworks like Django, FastAPI, Node.js, and Spring Boot.
π» Install PostgreSQL Using Postgres.app
π¦ Step 1: Install Postgres.app
π Download
Go to: https://postgresapp.com/
Go to Downloads
Click the Download button from Latest Release
Download the latest version
π₯ Install
Open the downloaded
.dmgfileDrag Postgres.app into the Applications folder
Open Postgres.app
Click Initialize
βοΈ Step 2: Configure Installation
Open Terminal
Paste the below code and click ENTER
sudo mkdir -p /etc/paths.d &&
echo /Applications/Postgres.app/Contents/Versions/latest/bin | sudo tee /etc/paths.d/postgresappπ§° Step 3: Install pgAdmin
π Download
Select Version
Now Download from the Files Section
π If you have a newer Mac (Apple Silicon)
MacBook M1 / M2 / M3 / M4
β Download:
pgadminX-X.XX-arm64.dmg
π If you have an older Intel Mac
Intel i5 / i7 / i9
β Download:
pgadminX-X.XX-x64.dmg
π₯ Install
Download
.dmgDrag pgAdmin 4 to Applications
Open pgAdmin
π Step 4: Connect pgAdmin to Postgres
π§© First-Time Setup
pgAdmin will ask for a master password β set anything (this is for pgAdmin security)
β‘ Useful PostgreSQL Commands
Command | Description |
|---|---|
| Connect to database |
| List databases |
| Connect to database |
| List tables |
| Quit psql |