Install PostgreSQL on Windows
Last Updated :
09 Aug, 2024
Improve
Installing PostgreSQL on your Windows 10 machine is straightforward with the PostgreSQL installer. In this article, we’ll walk you through installing PostgreSQL version 11.3, ensuring a smooth setup process.
Steps to Install PostgreSQL on Windows
There are three crucial steps for the installation of PostgreSQL as follows:
- Download PostgreSQL installer for Windows
- Install PostgreSQL
- Verify the installation
Step 1: Downloading PostgreSQL Installer for Windows
You can download the latest stable PostgreSQL Installer specific to your Windows by clicking here.
Step 2: Installing the PostgreSQL installer
After downloading the installer double click on it and follow the below steps:
- Click the Next button.
- Choose the installation folder, where you want PostgreSQL to be installed, and click on Next.
- Select the components as per your requirement to install and click the Next button.
- Select the database directory where you want to store the data and click on Next.
- Set the password for the database superuser (Postgres).
- Set the port for PostgreSQL. Make sure that no other applications are using this port. If unsure leave it to its default (5432) and click on Next.
- Choose the default locale used by the database and click the Next button.
- Click the Next button to start the installation.
- Wait for the installation to complete, it might take a few minutes.
- Click the Finish button to complete the PostgreSQL installation.
Step 3: Verifying the Installation of PostgreSQL
There are couple of ways to verify the installation of PostgreSQL like connecting to the database server using some client applications like pgAdmin or psql.
The quickest way though is to use the psql shell. For that follow the below steps:
- Access psql Shell:
- Search for “psql” in the Windows search bar and open it.
- Enter server details (localhost), database (default “postgres”), port (default 5432), username (postgres), and the password you set during installation.
- Check Installation:
- In the psql shell, enter ‘SELECT version();’ to confirm PostgreSQL is installed correctly. You should see version information displayed.
Tips:
- Ensure firewall settings allow PostgreSQL connections.
- Explore pgAdmin or other client tools for database management.