In this tutorial, we will go over the steps on how to install PostgreSQL on a cPanel/WHM server. cPanel/WHM is a popular control panel widely used these days and it has the capability of serving different database servers.
The database servers are also used to manage databases easily with help of GUI (i.e. PHPmyadmin), PostgreSQL is a kind of database server with a different set of features. Okay, time to start the installation. Here we go !
Please note, as good practice, you should take a backup of all the databases before doing this.
First and foremost, log into the cPanel server via root SSH.
1) You need to run the Cpanel script located at /usr/local/cpanel/scripts/installpostgres to install/upgrade PostgreSQL
Just run /usr/local/cpanel/scripts/installpostgres as root on a terminal.
2) Once you are done with CLI, go to WHM >> Home >> SQL Services >> Configure PostgreSQL
3) Click on “Install Config”
Then you will get a ‘confirm” message. Do click on it. You are done!
4) To make current users add to PostgreSQL, do click on “create.”
5) Input the necessary passwords. Make sure it is strong!
6) Finally, use the command line to import your database.
psql database name < BackupDump.sql
Congratulations! You have successfully setup PostgreSQL on your cPanel/WHM server.