Server guide

Install PostgreSQL on Windows Server — 2019 & 2022 production guide

Install PostgreSQL on Windows Server 2016, 2019 and 2022. Covers RDP install, separate data volume, dedicated service account, Windows Firewall and silent install on Server Core.

The PostgreSQL EDB installer works on Windows Server 2016, 2019 and 2022. The installation steps are identical to Windows 10/11 with a few additional considerations for server environments.

Windows Server requirements for PostgreSQL

ComponentMinimumRecommended
OSWindows Server 2016Windows Server 2022
RAM2 GB8 GB or more
Disk1 GB (binaries) + dataSSD, separate volume for data
Architecturex64 onlyx64
Net Framework4.6+Latest

Install PostgreSQL on Windows Server

  • 1

    Download the installer

    Get the EDB installer from postgresql.org/download/windows on a machine with internet access. Transfer to the server via RDP file copy, network share, or USB.

  • 2

    Run as Administrator via RDP

    Connect via Remote Desktop. Right-click the installer → Run as administrator. If UAC is disabled on the server, you may need to explicitly right-click and choose Run as administrator to get elevated privileges.

  • 3

    Place data on a separate volume

    On production servers, store PostgreSQL data on a separate disk or volume from the OS. During setup, change the data directory to your data volume (e.g. D:\PostgreSQL8\data). This improves performance and simplifies backup.

  • 4

    Create a dedicated service account (optional but recommended)

    PowerShell — Administrator
    # Create a local service account:
    PS> New-LocalUser -Name "pgservice" -NoPassword -Description "PostgreSQL service account"
    # Grant Log on as a service right (via secpol.msc or Group Policy)
    # Then set the service to use this account:
    PS> sc.exe config postgresql-x64-18 obj= ".\pgservice" password= ""
  • 5

    Open Windows Firewall for remote connections

    PowerShell — Administrator
    PS> New-NetFirewallRule -DisplayName "PostgreSQL" -Direction Inbound -Protocol TCP -LocalPort 5432 -Action Allow

    Then update pg_hba.conf and postgresql.conf to allow remote connections. See Remote connections guide.

Install on Windows Server Core (no GUI)

On Windows Server Core without a GUI, run the installer silently from the command line:

cmd.exe — Administrator
C:\> postgresql-18.3-3-windows-x64.exe --mode unattended --superpassword "YourSecurePass" --serverport 5432
# Installer runs silently, logs to %TEMP%\postgresql_installer.log
# Verify after completion:
C:\> sc query postgresql-x64-18
STATE : 4 RUNNING

Windows Server questions

Should I install PostgreSQL on Windows Server or use Linux?
Both work well. PostgreSQL on Windows Server is production-ready and fully supported by EDB. Linux (especially RHEL/Ubuntu) has a larger community of PostgreSQL operators and some performance advantages due to better OS-level memory management. For a Windows-centric environment or team, Windows Server is a perfectly valid choice.
Does PostgreSQL work on Windows Server Core?
Yes. Use the silent/unattended installer as shown above. pgAdmin will not be available on Server Core (no browser), but you can manage the server remotely via pgAdmin from another machine or via psql from the command line.
How do I enable PostgreSQL to survive server reboots?
The EDB installer sets the service startup type to Automatic by default. Verify with sc query postgresql-x64-18. If needed, set it explicitly: sc config postgresql-x64-18 start= auto.

Need remote access from other machines?

Configure firewall and pg_hba.conf for network connections.

Remote connections