< BackUpdated: April 23, 2023

How to Install PostgreSQL on Windows

Installing PostgreSQL on Windows for the first time can be a little intimidating and you might be left wondering if you even did it right. Follow this guide and rest assured you will have a properly installed PostgreSQL database on Windows.

How to Install PostgreSQL on Windows

Step 1 - Download PostgreSQL

Head on over to EntrepriseDB.com and download the latest version of Postgres for your version of windows.

Step 2 - Install PostgreSQL

Now that Postgres is downloaded, run the file to start the installation process.

Allow changes

Just like any other executable file you download, you will be asked if you want to "allow this app to make changes to your pc".

Click Yes.

PostgreSQL setup

Nothing to see here, just click Next.

Choose Installation Directory

Choose where you want to install PostgreSQL.

click Next.

Select Components to Install

Select what components to install (If you're not sure, it's fine to install everything).

Click Next.

Choose a Data Directory

Choose where to store your database.

Set a Password for the Default User

PostgreSQL comes with a default user and database called postgres. Set the password for that user here.

Note: You can change this password later through the psql shell using the SQL language.

Select a Port

Choose the port that your projects will connect to the PostgreSQL server on. This can be almost any port you'd like but you will see most people using the default 5432.

Select a locale

You will probably want to set this to the language you speak in your home country.

Pre Install Summary

Before clicking Next, just make sure all the settings are how you want them.

Install PostgreSQL

Click Next to start installing. This will take a few minutes while the PostgreSQL server and tools are installed and the PostgreSQL server is started.

Complete the PostgreSQL Setup

When the installation finishes, if you had chosen to install the stack builder component earlier in this tutorial you will be shown the following screen. Most developers new to PostgreSQL won't need the tools that come with stack builder until they get more comfortable with it. Uncheck the box and click Finish.

Conclusion

That's it! That is all there is to installing a real working PostgreSQL database server on your windows machine. You are now ready to connect to it and store your projects data! Don't know where to start next? Check out our basic windows setup tutorial for PostgreSQL to get you going.