How to Install PostgreSQL v18.4 on Windows 11 (2026) | Step-by-Step Guide
Below is a Step-by-Step Guide to Install PostgreSQL v18.4 on Windows 11:
Step 1: Download PostgreSQL
-
Go to the PostgreSQL Official Website:
https://www.postgresql.org/download/ - Click on Windows icon in select OS section.
- Click on "Download the installer" link on "Windows installers" page.
- Download the latest version 18.4 for Windows x86-64.
Step 2: Install PostgreSQL
-
Double-click the downloaded file:
postgresql-18.4-1-windows-x64.exe - Click "Yes" if you get a security prompt.
- On the PostgreSQL Setup Wizard, click "Next" to begin setup.
-
Choose Installation Directory (default is fine for most users) and click
"Next":
C:\Program Files\PostgreSQL\18 -
Select the below components and click "Next":
- PostgreSQL Server
- pgAdmin 4 (GUI tool)
- Command Line Tools
- Stack Builder (for extensions)
-
Select Data Directory to store data and click "Next":
C:\Program Files\PostgreSQL\18\data - Set a password for the database superuser postgres by entering it in "Password" and "Retype password", then click "Next".
-
Configure Port – Keep the default port:
5432
Then click "Next".
(You can keep it unless something else is using it.) - Leave the default locale unless you have specific requirements and click "Next".
- Click "Next" → "Next" to begin installation.
- Once installation is complete, click "Finish".
Step 3: Launch pgAdmin
- Open pgAdmin 4 from Start Menu. Double-click on "Servers" in "Object Explorer".
- Enter your postgres user password set during installation and click "OK".
-
Expand:
Servers → PostgreSQL 18 → Databases - You should see your database "postgres".
-
Click on "postgres" Database and go to:
Tools → Query Tool -
Run the test command:
SELECT version();
- You should see your PostgreSQL version.
Step 4: Launch SQL Shell (psql)
-
Press Enter for the below prompts:
Server [localhost]: Database [postgres]: Port [5432]: Username [postgres]: -
Enter postgres superuser password for the below prompt and press Enter:
Password for user postgres:
-
Run the test command:
SELECT version();
- You should see your PostgreSQL version.
Step 5: Add PostgreSQL to PATH
-
Press Win + R, type the below command and press Enter:
sysdm.cpl
- Go to the Advanced tab.
- Click Environment Variables.
- Under System variables, select Path and click "Edit".
-
Click "New" and paste the below path:
C:\Program Files\PostgreSQL\18\bin
(Adjust if your installation path is different.) - Click OK → OK → OK.
Step 6: Verify Installation
- Open Command Prompt.
-
Run the below commands:
psql --version psql -U postgres - Enter your password.
-
If you see:
postgres=#
PostgreSQL is working correctly! -
Run the test command:
SELECT version();
- You should see your PostgreSQL version.



















Comments
Post a Comment