How To Install pgAdmin4 on CentOS 8

Install pgAdmin4 on CentOS 8

In this tutorial we will show you how to install pgAdmin4 on CentOS 8. For those of you who didn’t know, pgAdmin is one of the most popular tools for managing PostgreSQL database. It was a feature-rich PostgreSQL administration tool. A complete rewrite from the previous pgAdmin version, built with Python and JavaScript. The pgAdmin4 designed for multiple PostgreSQL versions supports for PostgreSQL 9.2 and above. Multiplatform that can run on Linux, Mac, and Windows.

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo’ to the commands to get root privileges. I will show you through the step by step installation pgAdmin4 on a CentOS 8 server.

Install pgAdmin4 on CentOS 8

Step 1. First, let’s start by ensuring your system is up-to-date.

Step 2. Installing the EPEL and PostgreSQL repository for CentOS 8.

Run the following command to install it:

Then, you must disable the default PostgreSQL repository provides by the CentOS AppStream because of the pgAdmin4 only available on the official PostgreSQL repository:

Step 3. Installing pgAdmin4 no CentOS 8.

Install the pgAdmin4 package for CentOS 8 using the following command:

After that, go to the ‘/etc/httpd/conf.d’ directory and copy the sample configuration ‘pgadmin4.conf.sample’ to ‘pgadmin4.conf’:

Next, start and enable the httpd service, then check the httpd service:

Step 4. Configure pgAdmin4.

Now we create the data directory and log directory for storing pgAdmin files:

Dont forget, change the ownership of both pgAdmin4 data and log directories to the user ‘apache’:

Next, edit the pgAdmin configuration ‘/usr/lib/python3.6/site-packages/pgadmin4-web/’ using nano editor:

Next, create the user for the pgAdmin4 using the following command:

Dont forget, Change the ownership of both pgAdmin4 data and log directories to the user ‘apache’.

If you have firewalld configured, allow http traffic by running the following command:

Step 5. Accessing pgAdmin4.

open your web browser and go to the following address: http://your-server_ip/pgadmin4/ or http://localhost/pgadmin4/

Install pgAdmin4 on CentOS 8

Congratulations! You have successfully installed pgAdmin4. Thanks for using this tutorial for installing pgAdmin4 on your CentOS 8 system. For additional help or useful information, we recommend you to check the official pgAdmin4 website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal!