Install PostgreSQL in a Windows Environment

Have a Database Problem? Speak with an Expert for Free
Get Started >>

Introduction

If you’re planning to run PostgreSQL in a Windows environment, it’s important to know how to install this database management system correctly. Fortunately, the installation process is quite simple. In this article, we’ll provide step-by-step instructions explaining how to install PostgreSQL in Windows.

Prerequisite

If you’re planning to follow along with the instructions in this tutorial, there’s only one key prerequisite that needs to be in place: You’ll need to have internet access so that you can download the necessary files for the installation.

Download PostgreSQL for Windows

In this section, we’ll show you how to download the application needed to install PostgreSQL on a Windows system.

First, go to the PostgreSQL download page where you can download the application using this link: EnterpriseDB. The page should look something like this:

Then, select the version that’s compatible with your system. In this case, we will be selecting PostgreSQL Version 12.2 for Windows system 64bit.

At this point, all you need to do is wait for the download to finish.

Installing PostgreSQL

Now that we’ve downloaded the required file, we can proceed with the installation. We’ll perform the following steps:

  • First, locate the application that you just downloaded and double-click it.

  • Then, click on the Next button to proceed.

  • The application will prompt you for an installation directory. You can change it to fit your own requirements, but in this tutorial, we’ll be using the default installation directory by clicking the Next button.

  • The application will ask to install the following components: a. PostgreSQL Server – This is an integral part of the installation. b. pgAdmin 4 – This will install a GUI to help us interact with the PostgreSQL server. c. Stack Builder – This installs additional tools for the PostgreSQL server. d. Command Line Tools – This installs a set of command line tools that will enable us to interact with the server via the terminal or command line. This component is also required if you’re installing pgAdmin 4 or the PostgreSQL Database server.

alt text

Notice that we unchecked the Stack Builder from the list of components that we wish to install. We don’t need these additional tools for the purposes of this tutorial, but you can install them if you feel they’re necessary.

  • We can then click the Next button to proceed with the installation.

  • Once again, the application will ask us for the installation directory for our data.

You can provide a different installation directory if needed. For this example, we’ll be using the default directory as seen in the image above.

  • Again, we click the Next button to proceed.

  • You’ll be prompted to create a password. Be sure to provide a meaningful password that is secure yet easy to remember.

  • Then, click Next to move forward with the installation.

  • You can change the port number where the PostgreSQL server will be listening for client connections if you like. In this case, we’re going to use the default port value ‘5432’. Then, click Next to proceed.

  • Select the Default locale and then click the Next button.

– The application will show the Pre Installation Summary which allows you to review the actions you’ve taken so far. Click the Next button to keep going.

  • At this point, you’ll probably need to wait for the installation to finish.

  • Finally, click the Finish button to complete the installation.

To verify that your installation was successful, open the SQL shell by pressing the Windows icon and type the word SQL shell.

  • You can just press Enter to accept the default values for the Server, Database, Port, and Username.

  • After that, provide the password that you just set during the installation process.

  • Use the SELECT version(); command to check the PostgreSQL version installed on your system.

We can see that we have PostgreSQL version 12.2 installed.

Conclusion

When you’re installing PostgreSQL, it’s important to proceed carefully with the process to avoid any setup or configuration errors. In this article, we walked you through the process of installing PostgreSQL in a Windows environment. With our step-by-step instructions, you’ll be prepared to install PostgreSQL on Windows and start using the database right away.

Pilot the ObjectRocket Platform Free!

Try Fully-Managed CockroachDB, Elasticsearch, MongoDB, PostgreSQL (Beta) or Redis.

Get Started

Keep in the know!

Subscribe to our emails and we’ll let you know what’s going on at ObjectRocket. We hate spam and make it easy to unsubscribe.