Install PgAdmin4 on Rocky Linux 9 [Step-by-Step]

Written by - Omer Cakmak
Reviewed by - Deepak Prasad

In this tutorial we will go through the different possible methods to install pgadmin4 in Rocky Linux 9. But before that let's get some overview about pgadmin4


What is PgAdmin4?

PgAdmin is a free and open source graphical user interface (GUI) management tool for PostgreSQL database supported by many operating systems. PgAdmin4 is a complete rewrite of pgAdmin, built using Python and Javascript/jQuery.

PgAdmin4 is released for free under the PostgreSQL license. PgAdmin4 is installed and be used on Linux, Unix, macOS and Windows operating systems to manage PostgreSQL. In this article, we will explain how to install Rocky Linux 9, which is a Redhat based distribution.


Steps to Install PgAdmin4

Step-1: Setup Repository

You can install and use PgAdmin4 both as a web browser and as a desktop application. Run the following command in terminal to add the PgAdmin4 repository to the server:

[root@rocky9 foc]# rpm -i


Step-2: Install pgadmin4 package

You can install pgadmin4 with 3 different options:

// Install for both desktop and web modes.
dnf -y install pgadmin4

// Install for desktop mode only.
dnf -y install pgadmin4-desktop

// Install for web mode only.
dnf -y install pgadmin4-web

Let's install it for both desktop and web modes:

[root@rocky9 foc]# dnf -y install pgadmin4


Step-3: Set master password

After this command, if you are using the operating system with a graphical interface (Gnome, KDE etc), you can access PgAdmin4 from the menu. Set a master password at the first login.

Install PgAdmin4 on Rocky Linux 9 [Step-by-Step]


Then you can use PgAdmin4 Desktop.

Install PgAdmin4 on Rocky Linux 9 [Step-by-Step]


Step-4: Configure pgadmin4 web mode

Let's continue with the installation for PgAdmin4 web mode.  Let's run the script in the terminal. Enter Email address and Password:

[root@rocky9 foc]# /usr/pgadmin4/bin/
Setting up pgAdmin 4 in web mode on a Redhat based platform...
Creating configuration database...
NOTE: Configuring authentication for SERVER mode.

Enter the email address and password to use for the initial pgAdmin user account:

Email address:
Retype password:
pgAdmin 4 - Application Initialisation

Creating storage and log directories...
Configuring SELinux...
/usr/pgadmin4/bin/ line 98: semanage: command not found
/usr/pgadmin4/bin/ line 100: semanage: command not found
The Apache web server is not running. We can enable and start the web server for you to finish pgAdmin 4 installation. Continue (y/n)? y
Created symlink /etc/systemd/system/ → /usr/lib/systemd/system/httpd.service.
Apache successfully enabled.
Apache successfully started.
You can now start using pgAdmin 4 in web mode at


Step-5: Configure Firewall

Installation is complete. Set the firewall accesses for access from port 80:

[root@rocky9 foc]# firewall-cmd --add-service=http --permanent

[root@rocky9 foc]# firewall-cmd --reload

Let's disable selinux:

[root@rocky9 foc]# setenforce 0

Let's open the config file with a text editor(nano, vim etc):

[root@rocky9 foc]# nano /etc/selinux/config

Let's switch from enforcing mode to disabled mode:


Let's reboot the server for the selinux changes to take effect:

[root@rocky9 foc]# reboot


Step-6: Access pgadmin4 GUI

You can access PgAdmin4 by typing http://server_ip_address/pgadmin4 in a web browser.  For our example:

  • Enter the email address you entered during setup.
  • Enter the password you entered during setup.
  • Press Login button

Install PgAdmin4 on Rocky Linux 9 [Step-by-Step]


Now the PgAdmin4 web mode is ready to use.

Install PgAdmin4 on Rocky Linux 9 [Step-by-Step]



We have shared the PgAdmin4 installation steps for both web and desktop mode. Web mode allows access to PgAdmin4 only via browser, without the need for additional setup on the server. However, you may encounter problems with the browser itself.

In desktop mode, you cannot access it from anywhere other than the server it is installed on, an extra GUI interface is needed on the server, but it provides a more stable use compared to web mode.

As with any opensource application, you have the freedom to choose the mod you want for installation and use.


References -  pgAdmin 4 (RPM)


Views: 56

Omer Cakmak

He is highly skilled at managing Debian, Ubuntu, CentOS, Oracle Linux, and Red Hat servers. Proficient in bash scripting, Ansible, and AWX central server management, he handles server operations on OpenStack, KVM, Proxmox, and VMware. You can connect with him on LinkedIn or check his projects on GitHub page.

Can't find what you're searching for? Let us assist you.

Enter your query below, and we'll provide instant results tailored to your needs.

If my articles on GoLinuxCloud has helped you, kindly consider buying me a coffee as a token of appreciation.

Buy GoLinuxCloud a Coffee

For any other feedbacks or questions you can send mail to

Thank You for your support!!

Leave a Comment