Programming3 min read

How to Install PostgreSQL on Mac? Step by Step Guide

Abhishek Ahlawat

By Abhishek Ahlawat โ€” Recently

Founder of StudyTonight and a MERN fullstack developer. Writes about JavaScript, web development, Linux, and tech.

#postgresql#installation-guide#howto#database

Summarize this article using AI

PostgreSQL is one of the most popular databases after MySQL, Oracle, MongoDB, etc. popular databases. Developers around the world are using PostgreSQL along with NodeJS/ExpressJS and other backend programming languages to code robust, fast, scalable, and modern backend applications.

If you are a developer, and you have to use PostgreSQL in your application, then the first step would be to install PostgreSQL on your laptop or computer to start using it while development. In this article, we will see how you can install PostgreSQL on your Macbook.

install postgresql on mac

In this guide, we will use the PostgreSQL installer to install the software on the Mac. You can download the installer file from the following link: https://www.enterprisedb.com/downloads/postgres-postgresql-downloads

Install PostgreSQL Database

Let's install the PostgreSQL database along with its command line, desktop software, etc. on Mac.

Step 1. Download the PostgreSQL DMG file

First and foremost, download the .dmg file to install the PostgreSQL suite locally.

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

download postgresql installer

Pick the version you want to install and download it. You can also download this from the PostgreSQL website.

Step 2. Start Installation

Click on the DMG file to start the installation.

install postgresql - 1

Your laptop may ask you for your system password, which is normal, so enter your password and proceed.

install postgresql - 2

This will launch the Setup Wizard.

Step 3. Setup Wizard

The Setup Wizard will provide you with options to configure the PostgreSQL installation.

install postgresql - 3

Click on Next > To select the Installation Directory.

install postgresql - 4

Click on Next > and Select the components. By default, all 4 components will be selected, namely, PostgreSQL Server, pgAdmin, Stack Builder, and Command Line Tools.

install postgresql - 5

You can uncheck the Stack Builder if you want because you would not require this tool unless you want to install other technologies and tools to work with PostgreSQL and you want to use Stack Builder for it.

Click on Next > and choose the Data Directory, where the data files will be kept.

install postgresql - 6

Click on Next > and set the Password for the PostgreSQL server.

install postgresql - 7

Click on Next > and choose the Port to run the PostgreSQL service. You can keep the default value for this one.

install postgresql - 7

In the next step > Select the Locale (go with the default value), and then you will see all the Pre Installation summary.

install postgresql - 8

Click on Next > and the installation will start.

install postgresql - 9

Now just wait for a couple of seconds and the installation will be complete.

install postgresql - 10

Step 4. Launch pgAdmin

Now launch pgAdmin and explore PostgreSQL.

launch pgAdmin

Conclusion

Now that PostgreSQL is installed, you can start coding your backend services using PostgreSQL, by setting up a connection with the database and using it in your application.

All the best,

Spotted something outdated or wrong?

Liked this? See more StudyTonight posts in Google results.

Add StudyTonight as a preferred source
Next questLIVE OPSStep 2 / 3

Practice real incidents in the browser

System Design Ops โ€” put out fires, ship fixes, and stack XP. Reading done. Time to play.

Play System Design
  • +XP

    Every sim

  • Incidents

    Live ops

  • Ranks

    Climb up

Read next