- 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