Development

install-postgreql-on-windows

Captain Salem 3 min read

PostgreSQL, also known as Postgres, is a free and open-source relational database management system emphasizing extensibility and SQL compliance.

It supports a large part of the SQL standard and offers many modern features:

  • complex queries
  • foreign keys
  • triggers
  • updatable views
  • transactional integrity
  • multiversion concurrency control

Before you can use PostgreSQL database engine, you need to install it. Depending on your operating system and the distribution you are using PostgreSQL may be already installed. However, for windows users, you will need to install it manually.

Although the installation of PostgreSQL is quite easy, if configured incorrectly, it can cause major problems. In this tutorial, we are going to cover how to install, configure and secure PostgreSQL database.

    1. Next, launch the installer to start the installation process.
    2. Choose the Installation directory - Ensure you have read/write permissions to the target directory
    3. In the next step, select the component you wish to install. WE recommend to unselect “pgAdmin 4” and “Stack Builder” - As we will install these tools later.
      1. In the next step, select the data directory - Accept the default and proceed.
    4. Now, we need to setup the password for the database superuser postgres. Do not skip the section to secure your database.
      1. Choose the port which the server should listen on. Choose a port that is not being used by a different process.
      2. Proceed accepting the defaults and finish the installation process.
image-20220624084937797
image-20220624084937797
image-20220624084912236
image-20220624084912236
image-20220624084526401
image-20220624084526401

Navigate to the official PostgreSQL page and download the installer provided by EDB. https://www.enterprisedb.com/downloads/postgres-postgresql-downloads

image-20220624084002958
image-20220624084002958

We recommend you download the stable version of PostgreSQL. Version 14.4 as of publishing.

Installing pgAdmin 4

PgAdmin is a free, open-source PostgreSQL database administration GUI for Microsoft Windows, Mac OS X, and Linux systems. It offers database server information retrieval, development, testing, and ongoing maintenance. This guide will help you install pgAdmin on Windows. It is assumed that you have already installed PostgreSQL on your computer.

Visit the pgAdmin download page to obtain the most recent version.

image-20220624085050985
image-20220624085050985

Save the installer to your computer and launch it. You’ll be greeted with the following screen; click “Next” to continue.

image-20220624085305845
image-20220624085305845

Read the license agreement and check the box below it to accept the terms. Click “Next” to continue.

Next, select the installation location. Leave it as default or select a custom location you have Read/Write permissions

Next, follow the installer prompts and finish the installation. You may require to restart the computer before you can use pgAdmin

Using pgAdmin

Before continuing, ensure that you PostgreSQL server is running an listening on the specified port in previous section.

Launch pgAdmin and you’ll be directed to the browser window and prompt you to provide the password to secure the pgAdmin interface.

image-20220624085439092
image-20220624085439092

Next, on the top-Left side. Select servers and click on PostgreSQL. This will prompt you to provide the password for the postgres user. Enter the password we set during the PostgreSQL installation.

image-20220624085511066
image-20220624085511066

Once connected to the PostgreSQL server, you will get to the dashboard with all the databases that the postgres user has access to.

Congratulations, you have successfully installed PostgreSQL server and the access it via pgAdmin4

image-20220624085535599
image-20220624085535599

Next steps

If you wish to learn more about PostgreSQL or SQL in general, search SQL on the website and explore more.

Share
Comments
More from Cloudenv

Cloudenv

Developer Tips, Tricks and Tutorials.

Great! You’ve successfully signed up.

Welcome back! You've successfully signed in.

You've successfully subscribed to Cloudenv.

Success! Check your email for magic link to sign-in.

Success! Your billing info has been updated.

Your billing was not updated.