Download phpPgAdmin

Extract files

Extract the compressed file to the folder you want to serve phpPgAdmin (example: /var/www/yoursite/phppgadmin)

Install PostgreSQL module for PHP

1

sudo apt-get install php5-pgsql

Create PostgreSQL superuser to use in phpPgAdmin

Choose a username for your superuser. Here I used (adminusername) and you can replace it for another username you prefer.

1

2

sudo su-postgres

createuser--superuser--pwprompt adminusername

Enter the password for superuser.

Configure phpPgAdmin

Open the file phppgadmin/conf/config.inc.php (example: /var/www/yoursite/phppgadmin/conf/config.inc.php)

If Postgres and phpPgAdmin is installed in the same server, change the line:

1

$conf['servers'][0]['host']='localhost';

Search the file for extra_login_security. If extra_login_security = true, login attempts on phpPgAdmin with no password or certain usernames (pgsql, postgres, root, administrator) will be denied (you will get the “Login disallowed for security reasons.” error). So, set extra_login_security to false if it is your case.

1

$conf['extra_login_security']=false;

Nginx virtual host

If your site is already served with Nginx, just access http://yoursite.com/phppgadmin

But If you want to access phpPgAdmin from another URL like a subdomain for example, a Nginx virtual host file for phpPgAdmin is needed.