Signup/Sign In

How to Install PostgreSQL on Mac? Step by Step Guide

Posted in Programming   LAST UPDATED: APRIL 8, 2024

    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,

    About the author:
    I like writing content about C/C++, DBMS, Java, Docker, general How-tos, Linux, PHP, Java, Go lang, Cloud, and Web development. I have 10 years of diverse experience in software development. Founder @ Studytonight
    Tags:postgresqlinstallation-guidehowto
    IF YOU LIKE IT, THEN SHARE IT
     

    RELATED POSTS