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.
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
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.
Your laptop may ask you for your system password, which is normal, so enter your password and proceed.
This will launch the Setup Wizard.
Step 3. Setup Wizard
The Setup Wizard will provide you with options to configure the PostgreSQL installation.
Click on Next > To select the Installation Directory.
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.
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.
Click on Next > and set the Password for the PostgreSQL server.
Click on Next > and choose the Port to run the PostgreSQL service. You can keep the default value for this one.
In the next step > Select the Locale (go with the default value), and then you will see all the Pre Installation summary.
Click on Next > and the installation will start.
Now just wait for a couple of seconds and the installation will be complete.
Step 4. Launch pgAdmin
Now launch pgAdmin and explore PostgreSQL.
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,