Windows Server requirements for PostgreSQL
| Component | Minimum | Recommended |
|---|---|---|
| OS | Windows Server 2016 | Windows Server 2022 |
| RAM | 2 GB | 8 GB or more |
| Disk | 1 GB (binaries) + data | SSD, separate volume for data |
| Architecture | x64 only | x64 |
| Net Framework | 4.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)
# 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
PS> New-NetFirewallRule -DisplayName "PostgreSQL" -Direction Inbound -Protocol TCP -LocalPort 5432 -Action AllowThen update
pg_hba.confandpostgresql.confto 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:
Windows Server questions
Should I install PostgreSQL on Windows Server or use Linux?
Does PostgreSQL work on Windows Server Core?
How do I enable PostgreSQL to survive server reboots?
sc query postgresql-x64-18. If needed, set it explicitly: sc config postgresql-x64-18 start= auto.