sudo apt-get -y installer postgresql
# updates the mirrors
sudo apt update
# installs postgresql and some additional utilities and functionalities
sudo apt install postgresql postgresql-contrib
# starts installed postgresql service
sudo systemctl start postgresql.service
# installation creates default user postgres with below you can connect with postgres user
sudo -i -u postgres
# type psql to access postgresql prompt
psql
# postgresql installation completed
Tayco