PostgreSQL

PostgreSQL installation

Install PostgreSQL on Windows using the official PostgreSQL installer.

Before you begin: Use a Windows account with permission to install applications. Keep the database password safe; PostgreSQL will ask for it when you connect as the postgres user.

1. Download PostgreSQL

Open the official PostgreSQL download page: postgresql.org/download. Select Windows, then choose Download the installer.

PostgreSQL download page
Open the official PostgreSQL download page.

2. Choose the Windows installer

Select the Windows operating system and download the installer provided by EDB.

Windows option on the PostgreSQL download page
Select Windows.
Download the PostgreSQL Windows installer
Choose Download the installer.
PostgreSQL installer download in progress
Wait for the installer download to finish.

3. Start the installation

Open the downloaded installer to begin the PostgreSQL setup wizard.

PostgreSQL installer launch screen
Open the downloaded installer.
PostgreSQL installation welcome screen
Continue through the installation welcome screen.

4. Select the components

Select the components you need. The standard setup includes the PostgreSQL server, pgAdmin 4, Stack Builder, and command-line tools. Continue with the default selections unless your project requires a different setup.

PostgreSQL component selection screen
Select the PostgreSQL components to install.
PostgreSQL component selection confirmation
Review the selected components.

5. Set the database password

Create a strong password for the PostgreSQL superuser. You will use this password when connecting with the default postgres user.

PostgreSQL password setup screen
Set a password for the PostgreSQL server.
PostgreSQL password confirmation screen
Confirm the password.

6. Finish the setup

Review the remaining installation settings, accept the default port unless another service already uses it, and start the installation.

PostgreSQL installation settings screen
Review the additional setup settings.
PostgreSQL ready to install screen
Confirm that the installer is ready.
PostgreSQL installation progress screen
Wait while PostgreSQL is installed.
PostgreSQL installation completed screen
PostgreSQL installation completed successfully.

7. After installation

You can now open pgAdmin 4 or use psql to connect to the local server. Stack Builder is optional and can be used later to add drivers, extensions, and other PostgreSQL tools.

PostgreSQL Stack Builder screen
Stack Builder can install optional PostgreSQL tools.
Quick check: Open pgAdmin 4 and connect to the local server with the postgres username and the password you created during setup.

Further Reading

Continue learning with these related tutorials:

Continue learning