Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save menjaraz/cf67bfedd9edadff1fe40252671a0b5b to your computer and use it in GitHub Desktop.
Save menjaraz/cf67bfedd9edadff1fe40252671a0b5b to your computer and use it in GitHub Desktop.

Install PostgreSQL on Windows by scoop

Follow the below steps to install the latest version of PostgreSQL on Windows by scoop package manager.

Install PostgreSQL

scoop install postgresql -g

Configure PostgreSQL as a Windows Service

cd C:\ProgramData\scoop\apps\postgresql\current\bin
pg_ctl.exe register -N PostgreSQL -D "C:\ProgramData\scoop\apps\postgresql\current\data" -S auto

Start or Stop PostgreSQL Service

You can use command line to start/stop PostgreSQL service or alternatively use the Services menu in the Task Manager.

sc start PostgreSQL
sc stop PostgreSQL

Note: tested with PostgreSQL v15.4 on Windows 10.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment