Back to articles list Articles Cookbook
Updated: 16th Nov 2018 4 minutes read

How to Install PostgreSQL on Windows 10 in 5 Minutes

It may look like a complicated task to install PostgreSQL, Oracle, or SQL Server or any other database software, but it really isn’t! These days, most relational database management systems come with installation wizards that make the process much simpler. In this article, we’ll look at how to install PostgreSQL and test that the installation is working.

Install PostgreSQL: Steps Involved

To install PostgreSQL, we’ll complete the following tasks:

  1. Downloading the PostgreSQL package.
  2. Installing and configuring PostgreSQL.
  3. Starting the postgres server application.
  4. Verifying that PostgreSQL is working.

This database is available on Linux (or Unix), Windows, and macOS platforms. I’ll show you how to install PostgreSQl on Windows 10.

1. Downloading the PostgreSQL Package

To install PostgreSQL on your computer, you can download it from the official site or by using the download link for Windows. Once you’re on the right page, click the “Download the installer” link.

Image

That’ll take you to the following page:

Image

Here, you’ll need to select the postgres version to download and your operating system. In this article, we’ll work with PostgreSQL version 10 (which, as of now, is the latest available) and a 64-bit Windows 10 operating system.

Click the download button to continue. Once it finishes, you’ll be directed to the following page:

Image

Click the installer that pops up in the bottom-left of your browser (you’ll see it there if you’re using Chrome—if not, double-click the installer from your Downloads folder).

2. Installing and Configuring PostgreSQL

To show you how to install PostgreSQL on Windows 10, I’ll have to explain the configuration process involved in the installation. It’s a configuration of some important parameters like the port number, your postgres admin password, and more. Don’t worry if you don’t know what any of these things mean! The installation is straightforward.

To start, click Next in the following window.

Image

Choose the directory where you want to install PostgreSQL. It’s recommended that you leave the default as it is. When you’re done, click Next.

Image

The next page shows the components that are going to be installed. Leave these options checked as they are, and click Next again.

Image

Leave the data directory as the default, and click Next.

Image

To install PostgreSQL, you need to choose a password for postgres superuser (administrator) permissions. This password will be used when you connect as the user “postgres” from the SQL client in the verification section at the end of this guide. Click Next when you’re done.

Image

Then, you’ll need to choose the port number that the postgres server will listen to for requests. The default is 5432, but the installation wizard may suggest another if 5432 is already in use. Click Next to continue.

Image

Now, you should see a summary of all parameters you set in the previous steps. Click Next again to move on.

Image

On the following page, simply click Install.

Image

You should see a progress bar like the one below as you install PostgreSQL.

Image

When the installation is complete, you should see the following window:

Image

Stack Builder is optional. Click Finish, and you’re done!

3. Starting PostgreSQL as a Server

After you install PostgreSQL, the software will automatically start. And whenever you restart your computer, postgres will start as well.

However, at any time, you can choose to stop or start the postgresql server yourself. There are a few ways to stop postgresql; the simplest is through Task Manager.

Image

If you navigate to the Services tab, you’ll see the following. On my notebook, I have two postgresql versions installed (10 and 9.6). One is running and one is stopped.

Image

Here, you can start or stop postgres at any time by right-clicking it and selecting the desired action.

Image

4. Verifying Your PostgreSQL Installation

Whenever you install software, it’s always a good idea to verify that the installation was in fact successful. One way to verify the postgresql installation is by connecting to postgresql from any SQL client. When you install PostgreSQL, it comes with the official pgAdmin client as part of the default installation.

Start the pgAdmin application. Then, click File and select Add Server.

Image

In the window that appears, you’ll see a list of properties you can specify. The password is the same one you chose during your postgres installation.

Image

If the connection is successful, you should see something like the following, with PostgreSQL actively listening to the port it is connected to.

Image

Now That You Know How to Install PostgreSQL on Windows 10...

Congratulations! You already know how to install PostgreSQL on Windows 10 and verify that it’s working properly. Now, you can begin creating your own databases and running SQL queries in pgAdmin. Have fun!