Install latest PostgreSQL on cPanel

Posted By: Tony Baird

Last Updated: Saturday April 19, 2008

As some people may know there is a handy script within cPanel’s scripts folder which can install PostgreSQL, however it does not install the latest versions. It instead installs the vendor versions which on CentOS would be coming from yum. So this means for someone running CentOS4 they’ll get about 7.3 and for someone running CentOS5 they’ll get 8.1. Both of which aren’t the newest version 8.3.1.

So here’s how you can get the latest versions installed with very little work.

1. Login as root and make a directory for the postgres rpm files you’re going to download. 2. Go to the mirror page at http://wwwmaster.postgresql.org/download/mirrors-ftp and find an acceptable mirror for you. Once you’ve got a mirror navigate to your OS and distribution.  If you’re running CentOS then RHEL is acceptable for your binary files. 3.  Now all you need to do is download the following files

Of course adding on the version number and anything else that may be included.  So in our case for CentOS 5 we downloaded the following files

http://ftp8.us.postgresql.org/postgresql/binary/v8.3.1/linux/rpms/redhat/rhel-5-i386/postgresql-contrib-8.3.1-1PGDG.rhel5.i686.rpm http://ftp8.us.postgresql.org/postgresql/binary/v8.3.1/linux/rpms/redhat/rhel-5-i386/postgresql-libs-8.3.1-1PGDG.rhel5.i686.rpm http://ftp8.us.postgresql.org/postgresql/binary/v8.3.1/linux/rpms/redhat/rhel-5-i386/postgresql-devel-8.3.1-1PGDG.rhel5.i686.rpm http://ftp8.us.postgresql.org/postgresql/binary/v8.3.1/linux/rpms/redhat/rhel-5-i386/postgresql-plpython-8.3.1-1PGDG.rhel5.i686.rpm http://ftp8.us.postgresql.org/postgresql/binary/v8.3.1/linux/rpms/redhat/rhel-5-i386/postgresql-plperl-8.3.1-1PGDG.rhel5.i686.rpm http://ftp8.us.postgresql.org/postgresql/binary/v8.3.1/linux/rpms/redhat/rhel-5-i386/postgresql-8.3.1-1PGDG.rhel5.i686.rpm http://ftp8.us.postgresql.org/postgresql/binary/v8.3.1/linux/rpms/redhat/rhel-5-i386/postgresql-docs-8.3.1-1PGDG.rhel5.i686.rpm http://ftp8.us.postgresql.org/postgresql/binary/v8.3.1/linux/rpms/redhat/rhel-5-i386/postgresql-server-8.3.1-1PGDG.rhel5.i686.rpm

You may not need all of these but I rather just get all of them instead of a few and need the others later.  Finally since all the files are you in the same directory all you need to run is:

rpm -ihv postgr*

You now have successfully installed PostgreSQL.  Now you just need to login to WHM run the “Postgres Config”  options of install config then setting a password and finally restart PostgreSQL from within WHM.  You should now be running the latest version!

Hopefully cPanel considers maintaining PostgreSQL like they do MySQL in the future but until then this should be helpful for the few who are wishing to run the latest PostgreSQL on cPanel.

Ready to get started? Build your site from
$2.24/mo
GET STARTED NOW