In this tutorial, we will show you how to install pgAdmin on Ubuntu 22.04 LTS. For those of you who didn’t know, pgAdmin is a most popular and feature-rich, and open-source PostgreSQL administration and development platform that runs on Linux, Unix, macOS, and Windows.
This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘
sudo‘ to the commands to get root privileges. I will show you the step-by-step installation of the pgAdmin4 on Ubuntu 22.04 (Jammy Jellyfish). You can follow the same instructions for Ubuntu 22.04 and any other Debian-based distribution like Linux Mint, Elementary OS, Pop!_OS, and more as well.
- A server running one of the following operating systems: Ubuntu 22.04, 20.04, and any other Debian-based distribution like Linux Mint.
- It’s recommended that you use a fresh OS install to prevent any potential issues.
- SSH access to the server (or just open Terminal if you’re on a desktop).
non-root sudo useror access to the
root user. We recommend acting as a
non-root sudo user, however, as you can harm your system if you’re not careful when acting as the root.
Install pgAdmin on Ubuntu 22.04 LTS Jammy Jellyfish
Step 1. First, make sure that all your system packages are up-to-date by running the following
apt commands in the terminal.
sudo apt update sudo apt upgrade sudo apt install software-properties-common apt-transport-https wget ca-certificates libpq5 gnupg2
Step 2. Installing pgAdmin on Ubuntu 22.04.
By default, the pgAdmin is not available on Ubuntu 22.04 base repository. Now run the following command below to add the pgAdmin repository to your Ubuntu system:
sudo sh -c 'echo "deb https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/$(lsb_release -cs) pgadmin4 main" > /etc/apt/sources.list.d/pgadmin4.list'
Next, import the GPG key using the following command below:
curl -fsSL https://www.pgadmin.org/static/packages_pgadmin_org.pub | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/pgadmin.gpg
After the repository is enabled, now install the latest version of pgAdmin using the below command:
sudo apt update sudo apt install pgadmin4
For additional resources on installing PostgreSQL, read the post below:
Step 3. Configure Apache Web Server for pgAdmin.
Now we initiate Apache web server configuration using the following command below:
Setting up pgAdmin 4 in web mode on a Debian 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: firstname.lastname@example.org Password: Retype password: pgAdmin 4 - Application Initialisation ====================================== Creating storage and log directories... We can now configure the Apache Web server for you. This involves enabling the wsgi module and configuring the pgAdmin 4 application to mount at /pgadmin4. Do you wish to continue (y/n)? y The Apache web server is running and must be restarted for the pgAdmin 4 installation to complete. Continue (y/n)? y Apache successfully restarted. You can now start using pgAdmin 4 in web mode at http://127.0.0.1/pgadmin4
When the above script runs, enter email and password that you will use to log in into your dashboard.
Step 4. Configure Firewall.
Now we set up an Uncomplicated Firewall (UFW) with Apache to allow public access on default web ports for HTTP and HTTPS:
sudo ufw allow OpenSSH sudo ufw allow 'Apache Full' sudo ufw enable
Step 5. Accessing pgAdmin Web Interface.
Once successfully installed, open your web browser and access the pgAdmin Web UI using the URL
http://your-IP-addresss/pgadmin4. You will be redirected to the following page:
Congratulations! You have successfully installed pgAdmin. Thanks for using this tutorial for installing the pgAdmin4 on Ubuntu 22.04 LTS Jammy Jellyfish system. For additional help or useful information, we recommend you check the official pgAdmin website.