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

  1. Go to the PostgreSQL Official Website:
    https://www.postgresql.org/download/
  2. Click on Windows icon in select OS section.
  3. Click on "Download the installer" link on "Windows installers" page.
  4. Download the latest version 18.4 for Windows x86-64.

Step 2: Install PostgreSQL

  1. Double-click the downloaded file:
    postgresql-18.4-1-windows-x64.exe
  2. Click "Yes" if you get a security prompt.
  3. On the PostgreSQL Setup Wizard, click "Next" to begin setup.
  4. Choose Installation Directory (default is fine for most users) and click "Next":
    C:\Program Files\PostgreSQL\18
  5. Select the below components and click "Next":
    • PostgreSQL Server
    • pgAdmin 4 (GUI tool)
    • Command Line Tools
    • Stack Builder (for extensions)
  6. Select Data Directory to store data and click "Next":
    C:\Program Files\PostgreSQL\18\data
  7. Set a password for the database superuser postgres by entering it in "Password" and "Retype password", then click "Next".
  8. Configure Port – Keep the default port:
    5432
    Then click "Next".

    (You can keep it unless something else is using it.)
  9. Leave the default locale unless you have specific requirements and click "Next".
  10. Click "Next" → "Next" to begin installation.
  11. Once installation is complete, click "Finish".

Step 3: Launch pgAdmin

  1. Open pgAdmin 4 from Start Menu. Double-click on "Servers" in "Object Explorer".
  2. Enter your postgres user password set during installation and click "OK".
  3. Expand:
    Servers → PostgreSQL 18 → Databases
  4. You should see your database "postgres".
  5. Click on "postgres" Database and go to:
    Tools → Query Tool
  6. Run the test command:
    SELECT version();
  7. You should see your PostgreSQL version.

Step 4: Launch SQL Shell (psql)

  1. Press Enter for the below prompts:
    Server [localhost]:
    Database [postgres]:
    Port [5432]:
    Username [postgres]:
        
  2. Enter postgres superuser password for the below prompt and press Enter:
    Password for user postgres:
  3. Run the test command:
    SELECT version();
  4. You should see your PostgreSQL version.

Step 5: Add PostgreSQL to PATH

  1. Press Win + R, type the below command and press Enter:
    sysdm.cpl
  2. Go to the Advanced tab.
  3. Click Environment Variables.
  4. Under System variables, select Path and click "Edit".
  5. Click "New" and paste the below path:
    C:\Program Files\PostgreSQL\18\bin
    (Adjust if your installation path is different.)
  6. Click OK → OK → OK.

Step 6: Verify Installation

  1. Open Command Prompt.
  2. Run the below commands:
    psql --version
    psql -U postgres
        
  3. Enter your password.
  4. If you see:
    postgres=#
    PostgreSQL is working correctly!
  5. Run the test command:
    SELECT version();
  6. You should see your PostgreSQL version.

Comments

Popular posts from this blog

How to Install Geany 2.1 on Windows 10/11 (2026) | Step-by-Step Guide

How to Install Anaconda v2025.12-2 on Windows 10/11 (2026) | Step-by-Step Guide

How to Install Miniconda on Windows 10/11 (2026) | Step-by-Step Guide