How to Install pgAdmin on CentOS 7

Install pgAdmin on CentOS 7

In this article, we will have explained the necessary steps to install and configure pgAdmin on CentOS 7. Before continuing with this tutorial, make sure you are logged in as a user with sudo privileges. All the commands in this tutorial should be run as a non-root user.

pgAdmin is the leading open source feature rich PostgreSQL administration and development platform that runs on Linux, Unix, MacOS and Windows. pgAdmin can be used to manage PostgreSQL 9.2 and above.

Install pgAdmin on CentOS

Step 1. The first command will update the package lists to ensure you get the latest version and dependencies.

Step 2. Install PostgreSQL.

Go to the PostgreSQL repository download page, and add the PostgreSQL 9.4 repository:

Now, Install postgresql with the following command:

Initialize postgresql database using following command:

To start PostgreSQL service, run:

Step 3. Install pgAdmin 4 on CentOS 7.

Once you have PostgreSQL installed on your system, run the following command to install pgAdmin 4:

Now, Install phpPgAdmin, enter the following command:

Step 4. Configure pgAdmin.

There are few minor configuration changes that need to be done to have pgAdmin4 running. First we will rename the sample conf file from pgadmin4.conf.sample to pgadmin4.conf:

Next, create a pgAdmin log and data directories:

Create/Edit config_local.py file:

Add the following settings:

Change permissions of directories so that Apache:

Run the following command to create a user account for the pgAdmin 4 web interface.

Finally steps, Restart the Apache web service:

Step 5. Configure Firewall.

If the Firewall is enabled, execute the following command to enable http service:

Step 6. Access pgAdmin 4.

Open a web browser and go to the following URL to access the pgAdmin 4 interface:

Congratulation, you have learned how to install and configure pgAdmin 4 on CentOS 7. If you have any question, please leave a comment below.