It looks like you're new here. If you want to get involved, click one of these buttons!
Sign In RegisterIt looks like you're new here. If you want to get involved, click one of these buttons!
pgAdmin 4 is a web-based management tool for PostgreSQL. This guide explains how to install and configure pgAdmin 4 on AlmaLinux 9 and Rocky Linux 9.
Apache: Make sure the Apache web server is installed enabled. You can follow our guide to install it.
Before installing pgAdmin 4, install yum-utils:
dnf install yum-utils -y
Download and install the official pgAdmin 4 repository:
rpm -i https://ftp.postgresql.org/pub/pgadmin/pgadmin4/yum/pgadmin4-redhat-repo-2-1.noarch.rpm
Run an update to refresh the package list:
dnf update -y
Now install pgAdmin 4:
dnf install pgadmin4 -y
Run the pgAdmin 4 web setup script:
/usr/pgadmin4/bin/setup-web.sh
During this step, you will be prompted to:
IPtables:
Allow HTTP (port 80) and HTTPS (port 443) traffic if they are not open yet:
iptables -I INPUT -p tcp --dport 80 -j ACCEPT
iptables -I INPUT -p tcp --dport 443 -j ACCEPT
Save changes:
iptables-save | sudo tee /etc/sysconfig/iptables
Restart iptables:
systemctl restart iptables
Firewalld:
If you are using firewalld, run these commands to allow HTTP and HTTPS:
firewall-cmd --permanent --add-service=http
firewall-cmd --permanent --add-service=https
firewall-cmd --reload
If SELinux is in enforcing mode, you will not be able to access pgAdmin after installation.
You can check SELinux status by running this command:
getenforce
If it returns Disabled, then SELinux is turned off, and you can install pgAdmin.
If the status is Enforcing, it means SELinux is enabled and actively enforcing its policies.
Permissive – SELinux is enabled but only logs violations instead of enforcing them. You can keep it as permissive and install pgAdmin.
So if the status "Enforcing" you need to change to permissive:
nano /etc/selinux/config
Find the line:
SELINUX=enforcing
Change "enforcing" to "permissive".
Save file and exit.
Next, reboot:
reboot
Now you can access pgAdmin 4 in a web browser using your server's IP address:
http://server-ip/pgadmin4
Replace server-ip with your actual server's IP address.
You will see the "login" page. Enter the email address and password that you specified during the installation process.
Next, you will the pgAdmin dashboard:
PgAdmin 4 has been successfully installed and configured on your RHEL-based system. You can now access the web interface to efficiently manage your PostgreSQL databases.