In this tutorial, we will show you how to install pgAdmin 4 on AlmaLinux 8. For those of you who didn’t know, pgAdmin is the leading open-source feature-rich PostgreSQL administration and development platform that runs on Linux, Unix, Mac OS X, and Windows. It provides all the features you need to manage your PostgreSQL databases from a web UI. PgAdmin 4 replaces PgAdmin III which was developed in the C++ language and supports PostgreSQL 9.2 and later releases. If you are not a fan of managing databases on the PostgreSQL shell, then PgAdmin4 is the go-to management tool.
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 the step-by-step installation of the pgAdmin 4 open source administration and development platform for PostgreSQL on AlmaLinux 8. You can follow the same instructions for Rocky Linux.
- A server running one of the following operating systems: AlmaLinux 8.
- It’s recommended that you use a fresh OS install to prevent any potential issues.
- SSH access to the server (or just open Terminal if you’re on a desktop).
non-root sudo useror access to the
root user. We recommend acting as a
non-root sudo user, however, as you can harm your system if you’re not careful when acting as the root.
Install pgAdmin 4 on AlmaLinux 8
Step 1. First, let’s start by ensuring your system is up-to-date.
sudo dnf update sudo dnf install epel-release sudo yum-config-manager --disable pgdg-common
Step 2. Installing pgAdmin 4 on AlmaLinux 8.
Now we add the PgAdmin 4 repository to your system:
sudo rpm -i https://ftp.postgresql.org/pub/pgadmin/pgadmin4/yum/pgadmin4-redhat-repo-2-1.noarch.rpm
After the repository is added, run the following command to install it:
sudo dnf update sudo dnf install pgadmin4
Since PgAdmin 4 is powered by a web server and is accessed from the front-end, i.e web browser, we need to ensure that the Apache webserver is up and running. So, start the webserver and enable it on boot time:
sudo systemctl start httpd sudo systemctl enable --now httpd
Step 3. Configure PgAdmin 4.
The pgAdmin software comes with a well-written configuration script to configure the pgAdmin web service. Execute it to create an admin user, configure SELinux policies, and Apache webserver to deploy pgAdmin web service:
Step 4. Configure Firewall.
If you have an active firewall service, allow HTTP port:
sudo firewall-cmd --permanent --add-service=http sudo firewall-cmd --reload
Step 5. Accessing pgAdmin 4 Web Interface.
Once successfully installed, open your web browser and go to the following address:
Congratulations! You have successfully installed pgAdmin. Thanks for using this tutorial for installing the pgAdmin 4 on your AlmaLinux 8 system. For additional help or useful information, we recommend you check the official pgAdmin website.