- Login to your Ubuntu server with root user with your favorite SSH client
- Let’s first update the operating system with all the latest packages with the command
sudo apt-get update
- Let’s install postgresql with the command and wait for the installation process to be done.
apt-get -y install postgresql postgresql-contrib
- You are done with installing the Postgresql.
- Restart the service with the command
service postgresql restart