Ubuntu 24.04
Sponsored Link

PostgreSQL 16 : Install phpPgAdmin2024/05/30


Install phpPgAdmin to operate PostgreSQL on web browser from Client computers.


Install Apache2, refer to here.


Install PHP, refer to here.

[3] Install phpPgAdmin.
apt -y install phppgadmin php-pgsql
vi /etc/phppgadmin/config.inc.php
# line 114 : change to [false] if you allow to login with privileged user like postgres, root

$conf['extra_login_security'] = true;
# line 120 : change to [true] if you set config that database owners can look only their own databases

$conf['owned_only'] = false;
vi /usr/share/phppgadmin/classes/database/Connection.php
        # line 78 : add PostgreSQL 16
        switch (substr($version,0,2)) {
            case '16': return 'Postgres';break;
            case '14': return 'Postgres';break;
            case '13': return 'Postgres13';break;
            case '12': return 'Postgres12';break;
            case '11': return 'Postgres11';break;
            case '10': return 'Postgres10';break;

vi /etc/apache2/conf-enabled/phppgadmin.conf
# line 12 : set access permission for phpPgAdmin

Require local
Require ip
systemctl reload apache2

[4] Access to [http://(server's hostname or IP address)/phppgadmin/] with web browser from any Clients which are in the Network you set to allow. Then phpPgAdmin site is shown, Click [PostgreSQL] link on the left pane.
[5] Authenticate as a user and password which is in PostgreSQL.
[6] After successing authentication, phpPgAdmin admin site is shown. It's possible to operate PostgreSQL databases on here.
Matched Content