Skip to content

Instantly share code, notes, and snippets.

@josfam
Last active December 22, 2025 14:09
Show Gist options
  • Select an option

  • Save josfam/390b95d68e15b9425c750a3897ce9f93 to your computer and use it in GitHub Desktop.

Select an option

Save josfam/390b95d68e15b9425c750a3897ce9f93 to your computer and use it in GitHub Desktop.
How to install postgresql on linux (Ubuntu example)

How to install postgresql on on Ubuntu (and other Debian-based distros).

  • update the package list
sudo apt update
  • Install development libraries
sudo apt install -y libpq-dev python3-dev
  • Install PostgreSQL
sudo apt install -y postgresql postgresql-contrib
  • Start and enable the postgresql service (so it starts on boot)
sudo systemctl start postgresql
sudo systemctl enable postgresql
  • Verify that the postgresql service is running
sudo systemctl status postgresql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment