Install pgAdmin 4 on Ubuntu 22.04 Jammy Jellyfish

In this tutorial, I will guide you through the steps to install pgAdmin 4 on both Ubuntu 22.04 Desktop and Ubuntu 22.04 Server so that you can manage your PostgreSQL databases using web-based graphical user interface.


pgAdmin 4 is the most popular and feature rich Open Source administration and development platform for PostgreSQL. It is built using Python and Javascript/jQuery and offers two types of installation, one is Desktop Deployment and another is Server Deployment.

  1. Server Deployment: In this method of installation, the pgAdmin is installed as a web application with the help of a web server on a command line server, so that single or multiple users can access it simultaneously using a web browser. Of course, credentials are required for security.
  2. Desktop Deployment: This type of installation is like any other software installed locally on the computer. This means you don’t require any browser to connect and access PostgreSQL but are limited to only one user who is currently logged on to the operating system. Also, for this, the user needs to have an OS that has a GUI running. You can choose this option if you are installing pgAdmin 4 on your desktop.


As usual, we need to update the system first

sudo apt update; sudo apt dist-upgrade

Now, install curl if it is not installed yet

sudo apt install curl

Add pgAdmin 4 Public GPG Key

Ubuntu 22.04 system needs to ensure the packages we will receive to install the pgAdmin 4 are from the source as issued by the developer without any alteration. Therefore, for that, we have to add the GPG key on it used to sign the packages of this tool by the pgAdmin 4 developers.

curl -fsSL | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/pgadmin.gpg

Add pgAdmin 4 repository

sudo sh -c 'echo "deb$(lsb_release -cs) pgadmin4 main" > /etc/apt/sources.list.d/pgadmin4.list'

Now, update the system again

sudo apt update; sudo apt dist-upgrade

Install pgAdmin 4 Web (for Server)

As we have discussed at the pgAdmin 4 Introduction section of this tutorial, pgAdmin can be deployed as a web application, hence, here we will show you how to install it.

sudo apt install pgadmin4-web

Now, configure the pgAdmin user account for security purposes so that any random user won’t be able to access the pgAdmin’s web interface to manage the databases. Here is the command to create a username and password for the pgAdmin user account.

sudo /usr/pgadmin4/bin/

Enter the email address that you want to use as a Username and password for the account. Once done, the setup will ask you to restart the Apache web server. Press Y and hit the Enter key to restart it.

Now, you can open your browser to access the web interface of the newly installed pgAdmin 4 by inputing http://your-server-ip-address/pgadmin4 in URL box of the browser.

Here is my demonstration video.

In order to connect to your databases, you must ensure:

  1. Your PostgreSQL server is up and running. If you don’t have a PostgreSQL server for connection testing, you could read my post on How to install PostgreSQL servers on Ubuntu 22.04 and follow my instructions to create one.
  2. You have access rights to the databases.
  3. Your PostgreSQL server must be configured to allow remote access.

Install pgAdmin 4 Desktop

Those who want to have the pgadmin4 Desktop app on Ubuntu Linux can use this command to install pgAdmin 4 Desktop version

sudo apt install pgadmin4-desktop

To start your newly installed pgAdmin 4 Desktop, just open your application launcher and key in pgadmin to search for it the click on the found pgAdmin 4 icon.

For the first time, pgAdmin 4 will ask you for setting your master password for security reason.

Leave a Reply