How To Install phpPgAdmin 5.6 on CentOS 7 / RHEL 7


phpPgAdmin is a web-based administration tool for managing PostgreSQL database, and it’s look and feel is very similar to that of phpMyAdmin. If you have work experience on phpMyAdmin, you won’t take much time finding the way to work with phpPgAdmin.

This guide will help you to setup phpPgAdmin 5.6 on CentOS 7 / RHEL 7.


Assuming that you already have installed PostgreSQL on your system. If not, take a look at how to install PostgreSQL 11 / 10 on CentOS 7 / RHEL 7.

Install the dependent packages for phpPgAdmin.

yum install -y  php php-cli php-common php-pdo php-pgsql httpd apr apr-util httpd-tools libzip mailcap

Install phpPgAdmin

The phpPgAdmin available in EPEL repository doesn’t support PostgreSQL 10 and above.


Version of PostgreSQL not supported. Please upgrade to version or later.

So, we will set up phpPgAdmin using the package download from official website.

Download the latest version of phpPgAdmin. Downloading the tarred file would be preferred.


Extract the downloaded archive using tar command.

tar -zxvf REL_5-6-0.tar.gz

Move the extracted files to /usr/share/phppgadmin directory.

mv phppgadmin-REL_5-6-0/ /usr/share/phppgadmin

Configure phpPgAdmin

Copy the configuration file to begin the phpPgAdmin configuration.

mv /usr/share/phppgadmin/conf/ /usr/share/phppgadmin/conf/

Edit /etc/phpPgAdmin/ file.

vi /usr/share/phppgadmin/conf/

Set the name for your PostgreSQL instance. This setting will list your instance name in the phpPgAdmin web interface.

$conf['servers'][0]['desc'] = 'PostgreSQL 11';

Add localhost or IP Address of your PostgreSQL instance in the following server parameter.

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

If extra login security is true, then logins via phpPgAdmin with no password or certain usernames (pgsql, postgres, root, administrator) will be denied. To enable the postgres login, change it to false.

$conf['extra_login_security'] = false;

To simply hide other’s databases (owned by others) in the list, make the following condition to true.

$conf['owned_only'] = true;

Configure PostgreSQL

We will need to enable MD5 authentication on PostgreSQL so that we would be able to manage PostgreSQL instances from phpPgAdmin as well as make connections from external machines.

Enabling MD5 authentication increases the security and allows only encrypted password login. Modify the configuration file to accept the MD5 authentication.

### PostgreSQL 11 ###
vi /var/lib/pgsql/11/data/pg_hba.conf
### PostgreSQL 10 ###
vi /var/lib/pgsql/10/data/pg_hba.conf

Please enter the value as per your requirements in IPv4 connections. Make sure it accepts MD5 passwords.

# TYPE  DATABASE        USER            ADDRESS                 METHOD
# IPv4 local connections:
host     all             all             all                     md5
Use instead of all in ADDRESS to enable MD5 authentication for the specific subnet of IP addresses.

Restart the PostgreSQL service.

### PostgreSQL 11 ### 
systemctl restart postgresql-11 
### PostgreSQL 10 ### 
systemctl restart postgresql-10

Configure Apache

Creata a configuration file under /etc/httpd/conf.d directory so that Apache can serve phpPgAdmin interface.

vi /etc/httpd/conf.d/phppgadmin.conf

Copy and paste the below content to the above file.

Alias /phppgadmin /usr/share/phppgadmin
<Location /phppgadmin>
     <IfModule mod_authz_core.c>
         # Apache 2.4
         Require all granted
         #Require host
     <IfModule !mod_authz_core.c>
         # Apache 2.2
         Order deny,allow
         Deny from all
         Allow from
         Allow from ::1
        # Allow from

Restart and enable the HTTPD service.

systemctl restart httpd
systemctl enable httpd


If you have SELinux enabled on your system, then you will need to run the below commands; otherwise you will not be able to login to phpPgAdmin.

yum install -y policycoreutils
setsebool -P httpd_can_network_connect_db 1


Allow HTTP service in the firewall so that we can access the phpPgAdmin using a browser from external machines.

firewall-cmd --permanent --add-service=http
firewall-cmd --reload

Access phpPgAdmin

Now access the phpPgAdmin from the browser, URL will be:


You will get the below page.

Install phpPgAdmin 5.6 on CentOS 7 - phpPgAdmin Home Page
Install phpPgAdmin 5.6 on CentOS 7 – phpPgAdmin Home Page

Click on your PostgreSQL instance listed in the left pane (below servers). Login to your PostgreSQL instance with your username and password.

Install phpPgAdmin 5.6 on CentOS 7 - phpPgAdmin Login Page
Install phpPgAdmin 5.6 on CentOS 7 – phpPgAdmin Login Page

You should now get the database page.

Install phpPgAdmin 5.6 on CentOS 7 - List of Databases in phpPgAdmin
Install phpPgAdmin 5.6 on CentOS 7 – List of Databases in phpPgAdmin


You have successfully installed phpPgAdmin on CentOS 7 / RHEL 7. Visit the phpPgAdmin’s FAQ page to learn more about phpPgAdmin and Help page if you need support.

You might also like