Tuesday, June 24, 2025

PostgreSQL (postgre) Setup on macOS 12 (MacBook Pro 2016) Without Homebrew setup process



✅ Step-by-Step: Install PostgreSQL via EDB Installer (No Brew)

🔗 1. Download the Installer

Go to the official PostgreSQL download page:

https://www.enterprisedb.com/downloads/postgres-postgresql-downloads

Choose:

  • Version: PostgreSQL 17.5 (or your target version)

  • OS: macOS

  • Click Download under “Interactive Installer by EDB”

This downloads a .dmg installer package.


đŸ’ģ 2. Install PostgreSQL

  1. Open the downloaded .dmg file

  2. Run the installer

  3. Follow the prompts:

    • Choose install location

    • Set a password for the postgres user (IMPORTANT — remember it)

    • It will also install:

      • pgAdmin (optional)

      • Command line tools

This will install PostgreSQL to:

/Library/PostgreSQL/17/

đŸ”Ē 3. Verify Installation

Open Terminal, then run:

/Library/PostgreSQL/17/bin/psql --version

Expected output:

psql (PostgreSQL) 17.5

🛠️ 4. Add to PATH (Optional but Recommended)

echo 'export PATH="/Library/PostgreSQL/17/bin:$PATH"' >> ~/.zprofile
source ~/.zprofile

Now you can run:

psql -U postgres

Enter the password you set during installation.


📃 5. Create a New Database

createdb -U postgres my_database

Or connect to the default DB:

psql -U postgres -d postgres

📅 6. Import a SQL Dump File

If your client gave you a .sql file:

psql -U postgres -d my_database -f /path/to/file.sql

🧑‍đŸ’ģ 7. Use TablePlus to View Data

Use the following settings to connect:

Field Value
Host 127.0.0.1
Port 5432
User postgres
Password (your password)
Database my_database

Now you're ready to work with PostgreSQL on your MacBook Pro without using Homebrew!

Let me know if you need help with Laravel connection setup or importing data.