AlmaLinuxLinuxTutorials

How To Install pgAdmin 4 on AlmaLinux 8

Install pgAdmin 4 on AlmaLinux 8

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.

Prerequisites

  • 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).
  • A non-root sudo user or 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. To update your system packages, execute the following commands in your terminal:

sudo dnf update
sudo dnf install epel-release
sudo yum-config-manager --disable pgdg-common

This command fetches the latest package information from the repositories and updates any outdated packages on your system.

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:

sudo /usr/pgadmin4/bin/setup-web.sh

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: http://your-server-ip-address/pgadmin4/ or http://localhost/pgadmin4/

Install pgAdmin 4 on AlmaLinux 8

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.

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!

r00t

r00t is an experienced Linux enthusiast and technical writer with a passion for open-source software. With years of hands-on experience in various Linux distributions, r00t has developed a deep understanding of the Linux ecosystem and its powerful tools. He holds certifications in SCE and has contributed to several open-source projects. r00t is dedicated to sharing her knowledge and expertise through well-researched and informative articles, helping others navigate the world of Linux with confidence.
Back to top button