Step‑by‑Step: Install PostgreSQL 12 and pgAdmin4 on RHEL 8
This guide walks you through installing PostgreSQL 12 and the web‑based pgAdmin4 management tool on RHEL 8, covering module selection, database initialization, service configuration, and Apache‑based server‑mode setup with necessary SELinux and firewall adjustments.
PgAdmin4 is an open‑source, web‑based management tool for PostgreSQL, built with Python Flask and a modern HTML5/CSS3/Bootstrap front‑end. It rewrites the original C++ PgAdmin 3 and offers features such as a polished UI, responsive layout, real‑time SQL editor with syntax highlighting, powerful dialogs, helpful tips, and more.
PgAdmin4 Features
Elegant web UI with icons and panels
Responsive layout with dashboard for real‑time monitoring
SQL query tool/editor with syntax highlighting
Robust management dialogs and common task utilities
Helpful tips for getting started
Additional features
In this article you will learn how to install PostgreSQL and pgAdmin4 on RHEL 8 using the WSGI module in server mode, with Apache as the backend web server.
Installing PostgreSQL on RHEL 8
First, list the available PostgreSQL modules: # dnf module list postgresql Enable the desired module (PostgreSQL 12) and install the server package:
# dnf module enable postgresql:12 # dnf install postgresql-serverInitialize the database cluster: # postgresql-setup --initdb Start and enable the PostgreSQL service:
# systemctl start postgresql
# systemctl enable postgresqlVerify that the service is running:
# systemctl status postgresqlInstalling pgAdmin4 on RHEL 8
Add the external pgAdmin repository:
# rpm -i https://ftp.postgresql.org/pub/pgadmin/pgadmin4/yum/pgadmin4-redhat-repo-1-1.noarch.rpmInstall pgAdmin4 in server mode: # dnf install pgadmin4-web Install the SELinux utilities required for the setup: # sudo dnf install policycoreutils-python-utils Run the pgAdmin4 setup script, which creates the pgadmin user, directories, configures SELinux, and starts Apache: # /usr/pgadmin4/bin/setup-web.sh Open firewall port 80 for web traffic and reload the firewall:
# firewall-cmd --add-port=80/tcp --permanent
# firewall-cmd --reloadAllow Apache to make network connections via SELinux: # setsebool -P httpd_can_network_connect 1 Access pgAdmin4 by opening a browser and navigating to the displayed URL (e.g., http://server-ip/pgadmin4) and log in with the email and password you set during the setup script.
After logging in, you will be taken to the pgAdmin4 dashboard where you can create and manage PostgreSQL databases and monitor performance using the provided tools.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
MaGe Linux Operations
Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
