Skip to main content

How to Install PostgreSQL on Windows and Mac OS X

In this tutorial, you will learn how to install PostgreSQL on two different operating systems - Windows and Mac.
Updated Apr 22, 2025  · 6 min read

PostgreSQL is an open-source and light-weighted relational database management system (RDBMS). It is widely popular among developers and has been well-accepted by the industry. This tutorial is going to show you how you can install a specific version of PostgreSQL on either Windows or Mac.

How to Install PostgreSQL on Windows

PostgreSQL provides a nice graphical installer to install it. It is probably the easiest way to install PostgreSQL. For installing PostgreSQL on Windows, first head over to https://www.enterprisedb.com/downloads/postgres-postgresql-downloads and you should be provided with a table containing different distributions of PostgreSQL for different platforms -

Different distributions of PostgreSQL.

Different distributions of PostgreSQL. Image by Author.

PostgreSQL does not ask for any fancy requirements, and it runs mostly on a variety of commodity computers. So, system requirements' problem should not be there.

If you are using a computer with an older processor, you will need to install an older version of PostgreSQL since the newer versions are not supported in 32-bit computers.

Navigate to the location where the graphical installer got downloaded and double-click on it. It may vary from user to user depending on their administration schemes. You may have to run the installer as an administrator. Assuming you are already an administrator, double-clicking on the installer file will prompt you with a dialog box. The dialog box simply asks for your permission to install PostgreSQL on your computer. Click on Yes.

You will then get something like this -

Click on Next. You will be prompted to specify the path of the destination folder in which you want to install PostgreSQL.

Specify the path and click on Next.

You will next see a dialog box asking you to select the components you want to install. Select the one you want then click Next.

You will next see a dialog box asking you to specify the data directory of PostgreSQL. It is recommended to leave it as it appears -

You will now be asked to enter a password to protect your PostgreSQL database system. It is highly advised that you provide one -

PostgreSQL's services run on port number 5432. But PostgreSQL also lets you specify that after you enter and confirm your password -

It is recommended that you keep 5432 as it is.

You will then be asked to provide the Locale of the database. It is better to leave it to the Default one as shown the following figure and click on Next-

PostgreSQL is now finally ready to get installed on your Windows computer. And you are left with just one click (on Next)-

Your PostgreSQL installation should now have started. It won't take much time. Towards the very end of the installation process, you will be prompted to check/uncheck to launch StackBuilder. You can uncheck that and click on Finish.

Testing your PostgreSQL Installation on Windows

After you are done installing PostgreSQL, you can verify if the installation was correct or not. For this, simply press the Windows button from your keyboard and type psql. Select the option that says SQL Shell (psql). The SQL Shell of PostgreSQL looks just like the command-prompt -

Hit Enter four times in case you followed all the default settings while installing PostgreSQL. Otherwise, you will have to specify all the values as needed by psql manually. Finally, give the password you provided during the installation and hit Enter. If you get the postgres=# prompt, then your installation was all correct.

You will now see how to install the same version of PostgreSQL on a Mac computer.

Testing your PostgreSQL Installation on Windows

After you are done installing PostgreSQL, you can verify if the installation was correct or not. For this, simply press the Windows button from your keyboard and type psql. Select the option that says SQL Shell (psql). The SQL Shell of PostgreSQL looks just like the command-prompt -

SQL Shell (psql)

Hit Enter four times in case you followed all the default settings while installing PostgreSQL. Otherwise, you will have to specify all the values as needed by psql manually. Finally, give the password you provided during the installation and hit Enter. If you get the postgres=# prompt, then your installation was all correct.

SQL Shell (psql) 2

You will now see how to install the same version of PostgreSQL on a Mac computer.

How to Install PostgreSQL on Mac OS X

To install PostgreSQL on a Mac computer, head over to https://www.enterprisedb.com/downloads/postgres-postgresql-downloads and click on one of the versions, such as PostgreSQL version 17.4 -

installing PostgreSQL on Mac

Download history for installing PostgreSQL on Mac

Download beginning for PostgreSQL on Mac

Now, navigate to the location where the installer got downloaded. Double-click on the installer file. 

PostgreSQL installer file

Double-click on this file. You may be asked to either Cancel or Open further. In order to continue the installation, click on Open.

You will then be prompted to enter your password for your Mac OS X.

PostgreSQL wants to make changes

After entering your password, click on OK. You will then see something like this -

PostgreSQL Setup Wizard popup window

Simply, click on Next.

Now, everything is exactly the same with the Windows' installation steps. Once you are done installing PostgreSQL, you can test if it was correct.

Testing your PostgreSQL Installation on Mac OS X

To test the installation, simply click on Launchpad and type psql. You should get the following if you do so -

Launchpad search psql

Click on it and then you will get a prompt like this -

psql window - Mac OS X

You will be asked to enter the details, and the values may vary from user to user. If you followed the default installation without changing any of the values during the installation, just hit Enter four times and enter the password you provided during the installation.

If you get the psql prompt, i.e. postgres=# then your installation is correct.

Taking it Further

You now know how you can install PostgreSQL on your computer. If you are looking to hone your SQL skills using PostgreSQL here are some of the resources that might help you:

Topics

Related courses

Course

Joining Data in SQL

4 hr
220.8K
Level up your SQL knowledge and learn to join tables together, apply relational set theory, and work with subqueries.
See DetailsRight Arrow
Start Course
See MoreRight Arrow
Related

blog

How to Install Python on macOS and Windows

Learn how to install Python on your personal machine with this step-by-step tutorial. Whether you’re a Windows or macOS user, discover various methods for getting started with Python on your machine.
Richie Cotton's photo

Richie Cotton

14 min

blog

SQL Server, PostgreSQL, MySQL: What's the Difference?

In this tutorial, you'll learn some of the basic differences between SQL dialects and where you should begin.
Mona Khalil's photo

Mona Khalil

5 min

Tutorial

How to Install SQL Server

In this tutorial, you will learn how to install SQL Server on a Windows operating system with a brief introduction to SQL in general.
Aditya Sharma's photo

Aditya Sharma

10 min

Tutorial

How to Use Homebrew to Install PostgreSQL on Mac

Learn how to set up PostgreSQL on macOS using Homebrew, a convenient package manager. Follow step-by-step instructions to install, configure, and start PostgreSQL services.
Oluseye Jeremiah's photo

Oluseye Jeremiah

7 min

Tutorial

Beginner's Guide to PostgreSQL

In this tutorial, you will learn how to write simple SQL queries in PostgreSQL.
Sayak Paul's photo

Sayak Paul

13 min

Tutorial

Managing Databases in PostgreSQL

In this tutorial, you will learn how to create, drop and select a database in SQL.
Sayak Paul's photo

Sayak Paul

4 min

See MoreSee More