pgAdmin 4 is the most popular open-source administration and development tool for PostgreSQL. It provides a web-based interface for managing databases, writing queries, monitoring server activity, and managing schemas. This guide installs pgAdmin 4 in web mode on Ubuntu 26.04 LTS.
Tested and valid on:
- Ubuntu 26.04 LTS
Prerequisites
- Ubuntu 26.04 LTS with PostgreSQL 17 installed
- A web server (Apache or Nginx) optional — pgAdmin has a built-in WSGI server
- A user with sudo privileges
Step 1 – Add the pgAdmin Repository
curl -fsS https://www.pgadmin.org/static/packages_pgadmin_org.pub | sudo gpg --dearmor -o /usr/share/keyrings/packages-pgadmin-org.gpg
sudo sh -c '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'
sudo apt update
Step 2 – Install pgAdmin 4 (Web Mode)
sudo apt install pgadmin4-web -y
Step 3 – Configure pgAdmin
Run the setup script to create an admin user and configure the web server:
sudo /usr/pgadmin4/bin/setup-web.sh
Enter an email address and password for the pgAdmin login.
Step 4 – Open Port 80 (if using Apache)
sudo ufw allow 'Apache Full'
Step 5 – Access pgAdmin
Open http://your_server_ip/pgadmin4 in a browser and log in with the credentials you set.
Step 6 – Add Your PostgreSQL Server
In pgAdmin: Object → Register → Server. Set:
- Name: Local PostgreSQL
- Host: 127.0.0.1
- Port: 5432
- Username: postgres
- Password: (your postgres password)
Step 7 – Secure with SSL
Add an SSL certificate using Certbot so pgAdmin is served over HTTPS:
sudo certbot --apache -d pgadmin.example.com
Conclusion
pgAdmin 4 is now installed and accessible on Ubuntu 26.04 LTS. Use it to manage PostgreSQL databases visually, write and run SQL, inspect query execution plans, and monitor server statistics.