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:
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:
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/config_distro.py’ 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:
open your web browser and go to the following address: http://your-server_ip/pgadmin4/ or http://localhost/pgadmin4/
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.