Updated: 28 September 2026 · Applies to: Ubuntu 24.04 / Debian 12 (pgAdmin 4 v9)
Ubuntu 18.04 is end of life, and pgAdmin no longer needs to be installed with pip. pgAdmin 4 (version 9.x) has its own repository for Ubuntu 24.04, Debian 12 and AlmaLinux 9 / Rocky Linux 9. In server mode it runs as a web application under Apache.
Add the pgAdmin repository
curl -fsS https://www.pgadmin.org/static/packages_pgadmin_org.pub | gpg --dearmor -o /usr/share/keyrings/packages-pgadmin-org.gpg echo "deb [signed-by=/usr/share/keyrings/packages-pgadmin-org.gpg] https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/$(lsb_release -cs) pgadmin4 main" > /etc/apt/sources.list.d/pgadmin4.list apt update
On AlmaLinux/Rocky: dnf install https://ftp.postgresql.org/pub/pgadmin/pgadmin4/yum/pgadmin4-redhat-repo-2-1.noarch.rpm, then use dnf in the steps below.
Install the web version
apt install pgadmin4-web /usr/pgadmin4/bin/setup-web.sh
The setup script asks for an email address and password for the first pgAdmin user, and configures Apache. Open http://SERVER-IP/pgadmin4 and log in.
Secure it
- Serve it over HTTPS only (add a certificate for the Apache site with Certbot).
- Allow access only from your IP, or use an SSH tunnel, since pgAdmin gives full access to your databases.
Connect a server
In pgAdmin choose Add New Server, enter a name, then on Connection the host (127.0.0.1 for the same server), port 5432, user and password.