Skip to main content

How to Install PostgreSQL Server on Ubuntu 24.04 (Noble)

hahnavi hahnavi

Below are the steps to install PostgreSQL from the PGDG repository.

Install the PGDG helper

This installs the apt.postgresql.org.sh script.

sudo apt install -y postgresql-common

Add the PostgreSQL Apt repository

This script adds the PGDG repo and its signing key for the current Ubuntu release.

sudo /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh

Install PostgreSQL

This pulls the server packages from the PGDG repo.

sudo apt -y install postgresql

Sanity check

Check that the service is running and the local connection works.

systemctl status postgresql
sudo -u postgres psql

Use \q to exit psql.

Share

comments powered by Disqus