【2025 Latest Guide】How to Install PostgreSQL on Mac【Beginner-Friendly Guide】

,
【2025 Latest Guide】How to Install PostgreSQL on Mac【Beginner-Friendly Guide】
1

What is PostgreSQL?

PostgreSQL is an open-source relational database management system (RDBMS) known for its reliability and scalability, which has made it a favorite among engineers worldwide. It features:

  • Advanced query processing and ACID compliance
  • Support for modern data types like JSON and GIS
  • Commercial-grade performance and scalability for free

It’s widely used for web applications, business systems, and data analysis!

2

How to Install PostgreSQL on Mac【Homebrew Method】

🔧 Preparation: Install Homebrew

If you haven’t installed Homebrew yet, paste the following command in your terminal:

Terminal /bin/bash -c “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)”

💡 Tip

Our guide on installing Git on Mac also covers this Homebrew installation method. If you’re planning to use Git, check it out as well!

3

🛠 “brew command not found”? Fix it with PATH settings!

If you encounter an error that the brew command is not available before installing PostgreSQL, Homebrew might not be properly added to your PATH.

You can fix this with the following steps 👇

✅ Step 1: Add Homebrew to PATH

If you’re using zsh (the default shell in macOS), run these commands in your terminal:

Terminal echo ‘eval “$(/opt/homebrew/bin/brew shellenv)”‘ >> ~/.zprofile eval “$(/opt/homebrew/bin/brew shellenv)”

This will:

  1. Make Homebrew available in future terminal sessions (persistent)
  2. Make it immediately available in your current session

💡 Reference

Our guide on fixing the “claude command not found” issue also covers similar PATH settings. If you’re experiencing command not found errors, check out this article too!

✅ Step 2: Verify Installation

Check if Homebrew is available with this command:

Terminal brew –version

If you see a version number like Homebrew 4.x.x, you’re good to go!

4

① Install PostgreSQL

Install PostgreSQL with this command:

Terminal brew install postgresql

② Start the Server

Start the PostgreSQL server with this command:

Terminal brew services start postgresql

③ Verify Installation

Check if PostgreSQL is running by executing:

Terminal psql postgres

If successful, the PostgreSQL console will open. You can exit with \q.

5

🌟 Comfortable Database Management with GUI Tools

While “psql” is usable, GUI tools are more convenient for beginners.

🖥️ pgAdmin

The official GUI tool with rich features that also supports remote management.
Download: https://www.pgadmin.org/download/

🧊 Postico (Mac Only)

Lightweight with an intuitive UI. Perfect for local development.
Download: https://eggerapps.at/postico/

6

💡 Common Errors and Solutions

❌ psql: command not found

→ Add the following to your .zshrc or .zprofile and reload:

Terminal export PATH=”/opt/homebrew/opt/postgresql/bin:$PATH” source ~/.zprofile

❌ Cannot connect (FATAL error)

→ The PostgreSQL server might not be running:

Terminal brew services start postgresql

✨ Personal Take: PostgreSQL is Worth the Investment!

Compared to MySQL or SQLite, PostgreSQL has a bit of a “professional” feel. However, once you learn it properly, it becomes a reliable foundation for services of any scale.

Setting up a local environment lets you practice everything from SQL queries to testing connections with web frameworks like Rails or Django!

8

🚀 Summary: PostgreSQL is Easy to Use on Mac!

Installing PostgreSQL with Homebrew and GUI tools can be done by anyone in just 10 minutes. Use this guide to start your local database development journey!

🔗 References

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *