Facebook Twitter Instagram
    TecAdmin
    • Home
    • Ubuntu 20.04
      • Upgrade Ubuntu
      • Install Java
      • Install Node.js
      • Install Docker
      • Install LAMP Stack
    • Tutorials
      • AWS
      • Shell Scripting
      • Docker
      • Git
      • MongoDB
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    Home»Databases»PostgreSQL»How To Install phpPgAdmin on Ubuntu 16.04 and 14.04 LTS

    How To Install phpPgAdmin on Ubuntu 16.04 and 14.04 LTS

    RahulBy RahulOctober 5, 20143 Mins ReadUpdated:July 24, 2017

    phpPgAdmin is an web interface for accessing and managing PostgreSQL databases in a very easy way. We can easily create new databases, tables in the database, users, stored procedures etc. Also, we can execute PL/pgSQL and other stored procedures. It also provides an option for database backup and restores from the web interface.

    This article will help you to install phpPgAdmin web interface to manage PostgreSQL server on Ubuntu Systems. We are assuming that you already have installed PostgreSQL in your Ubuntu system, If not first install it using another article Install PostgreSQL on Ubuntu first.

    Step 1 – Install Prerequisites

    PhpPgAdmin required PHP and Apache2 must be installed on your system. Also, you will need php-pgsql libraries installed on the system. If you don’t have PHP installed, Use tutorial Install PHP7 or Install PHP5 on system. After installing PHP and Apache install the PHP module for postgresql.

    $ sudo apt-get update
    $ sudo apt-get install php-pgsql   # Use package name as per php verison 
    

    Step 2 – Install phpPgAdmin

    We are assuming here that you already have PostgreSQL server running on your Ubuntu system. If not install it first. Now phpPgAdmin packages are also available under default Ubuntu repositories. Use the following command to install phpPgAdmin.

    $ sudo apt-get install phppgadmin
    

    Step 3 – Configure PostgreSQL

    Now, you may need to make some changes in your PostgreSQL server to access via phpPgAdmin. First this to access PostgreSQL on all interfaces, update the following settings under postgresql.conf file.

    $ sud vi /var/lib/pgsql/data/postgresql.conf
    
    listen_addresses = '*' 
    

    After this enable PostgreSQL auth from remote hosts edit pg_hba.conf configuration file and add the last line showing below.

    $ sudo vi /var/lib/pgsql/data/pg_hba.conf
    
    #### Default settings  
    local   all         postgres                          ident
    local   all         all                               ident
    host    all         all         127.0.0.1/32          ident
    host    all         all         ::1/128               ident
    #### Add extra configuration   
    host    all         all         192.168.1.0/24          md5 
    

    Step 4 – Configure phpPgAdmin

    Now, your PostgreSQL server is ready for accessing with phpPgAdmin. You may face some issue with the login on phpPgAdmin. To fix this disable the extra login security of phpPgAdmin.

    $ sudo vi /var/www/html/phpPgAdmin/conf/config.inc.php
    

    Set extra_login_security value to false.

    $conf['extra_login_security'] = false;
    

    Step 5 – Access phpPgAdmin

    Now phpPgAdmin is available to access from localhost only. To access from local system just type below url in your favorite browser.

    http://localhost/phppgadmin
    

    phpPgAdmin Login Screen

    Step 6 – Secure phpPgAdmin

    Now if you want to access phpPgAdmin web interface from the remote system like your local LAN or remote public network server. We need to make little changes in PostgreSQL Apache configuration file. To do it edit file

    $ sudo nano /etc/apache2/conf-enabled/phppgadmin.conf
    

    Now comment the Require local line and add other lines in configuration file to allow specific ip ranges.

    #Require local
    order deny,allow
    deny from all
    allow from 127.0.0.0/255.0.0.0 ::1/128
    allow from 192.168.1.0/24
    

    Save you file and restart Apache service using the following command.

    $ sudo service apache2 reload
    
    database phpPgAdmin PostgreSQL
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp
    Previous ArticleHow to Exit Vim Text Editor
    Next Article How to Extract tar.gz File in Linux

    Related Posts

    How To Install MySQL Server on Ubuntu 22.04

    Updated:April 6, 20224 Mins Read

    How To Install MariaDB on Debian 11

    4 Mins Read

    How To Configure PostgreSQL to Allow Remote Connections

    3 Mins Read

    How to Install Redis on Debian 11 Linux

    Updated:September 16, 20213 Mins Read

    How to Check the PostgreSQL Version

    Updated:August 6, 20212 Mins Read

    How to Rename MySQL Database

    Updated:July 26, 20213 Mins Read

    5 Comments

    1. Nial on May 17, 2017 2:12 pm

      what is username and password for phppgadmin?

      Reply
      • Rahul K. on July 24, 2017 4:19 am

        Use PostgreSQL username and password for the login.

        Reply
    2. Sidhi on January 11, 2017 4:41 pm

      When I try to : sudo nano /etc/apache2/conf.d/phppgadmin
      got this error message :
      [ Error writing /etc/apache2/conf.d/phppgadmin: No such file or directory ]
      What should I do ?

      Reply
    3. kkkk on September 17, 2016 11:16 am

      good but how to login now?

      Reply
    4. DevCH on May 20, 2016 4:03 pm

      y con que login entro?

      Reply

    Leave A Reply Cancel Reply

    Recent Posts
    • How to Install JAVA on Ubuntu 22.04
    • Switching Display Manager in Ubuntu – GDM, LightDM & SDDM
    • Changing the Login Screen Background in Ubuntu 22.04 & 20.04
    • How To Install PHP (8.1, 7.4 or 5.6) on Ubuntu 22.04
    • (Resolved) Please install all available updates for your release before upgrading
    Facebook Twitter Instagram Pinterest
    © 2022 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.