I had a similar problem and couldn't find any solution for the desktop version, in particular, for Ubuntu 22.04 (jammy). However, this should also work for the pgadmin4-web:

sudo curl https://www.pgadmin.org/static/packages_pgadmin_org.pub | sudo apt-key add
sudo sh -c 'echo "deb https://ftp.postgresql.org/pub/pgadmin/pgadmin4/snapshots/2022-05-05/apt/jammy pgadmin4 main" > /etc/apt/sources.list.d/pgadmin4.list && apt update'
sudo apt install pgadmin4-web

(Don't forget to run sudo /usr/pgadmin4/bin/setup-web.sh after that)

For the desktop version just install pgadmin4-desktop instead of pgadmin4-web:

sudo apt install pgadmin4-desktop

Also, please note that this is a temporary solution (May 2022), until the devs release the final pgadmin4 version for jammy. Once it's out, you would just need to update the repository.

Hope this helps.

Answer from akaine on Stack Overflow
๐ŸŒ
pgAdmin
pgadmin.org โ€บ download โ€บ pgadmin-4-apt
Download
DEBs for various Debian and Ubuntu versions are available from the pgAdmin APT repository. The following platforms are supported: IMPORTANT NOTE: Packages for distributions that are no longer supported will be archived to https://pgadmin-archive.postgresql.org/, from where they can be manually downloaded. The archive site cannot be used as a repository! To use this repository, run the following commands: # # Setup the repository # # Install the public key for the repository (if not done previously): curl -fsS https://www.pgadmin.org/static/packages_pgadmin_org.pub | sudo gpg --dearmor -o /etc/
๐ŸŒ
Snapcraft
snapcraft.io โ€บ install โ€บ pgadmin4 โ€บ ubuntu
Install pgadmin4 on Ubuntu using the Snap Store | Snapcraft
May 11, 2026 - Get the latest version of pgadmin4 for on Ubuntu - Management tool for the PostgreSQL database
Top answer
1 of 6
7

I had a similar problem and couldn't find any solution for the desktop version, in particular, for Ubuntu 22.04 (jammy). However, this should also work for the pgadmin4-web:

sudo curl https://www.pgadmin.org/static/packages_pgadmin_org.pub | sudo apt-key add
sudo sh -c 'echo "deb https://ftp.postgresql.org/pub/pgadmin/pgadmin4/snapshots/2022-05-05/apt/jammy pgadmin4 main" > /etc/apt/sources.list.d/pgadmin4.list && apt update'
sudo apt install pgadmin4-web

(Don't forget to run sudo /usr/pgadmin4/bin/setup-web.sh after that)

For the desktop version just install pgadmin4-desktop instead of pgadmin4-web:

sudo apt install pgadmin4-desktop

Also, please note that this is a temporary solution (May 2022), until the devs release the final pgadmin4 version for jammy. Once it's out, you would just need to update the repository.

Hope this helps.

2 of 6
4

I managed to install pgadmin4 from APT on Ubuntu 22.04, but even after that I was facing some issues while starting pgadmin4.

So I found out that there's a python package for pgadmin4 which exists. It will install the web version of the pgadmin4 and it works without any issue.

Follow the below steps to install or you can check this link.

$ sudo mkdir /var/lib/pgadmin
$ sudo mkdir /var/log/pgadmin
$ sudo chown $USER /var/lib/pgadmin
$ sudo chown $USER /var/log/pgadmin

# Create virtual environment
$ python3 -m venv pgadmin4
$ source pgadmin4/bin/activate

# Install pgadmin4
(pgadmin4) $ pip install pgadmin4

# Start pgadmin4
(pgadmin4) $ pgadmin4

For the first time after running pgadmin4, you'll be asked to set the email and password.

Top answer
1 of 4
163

For pgAdmin 4 v4.21 on Ubuntu, according to the download page:

Install dependencies, create a virtual environment, download, install & configure

Using Python2.x

sudo apt-get install virtualenv python-pip libpq-dev python-dev

cd
virtualenv pgadmin4
cd pgadmin4
source bin/activate

pip install https://ftp.postgresql.org/pub/pgadmin/pgadmin4/v4.21/pip/pgadmin4-4.21-py2.py3-none-any.whl

Using Python3.6 (Preferred to avoid encoding related issues)

sudo apt-get install virtualenv python3-pip libpq-dev python3-dev

cd
virtualenv -p python3 pgadmin4
cd pgadmin4
source bin/activate

pip3 install https://ftp.postgresql.org/pub/pgadmin/pgadmin4/v4.21/pip/pgadmin4-4.21-py2.py3-none-any.whl

Configure

Override default paths and set it to single-user mode in the local configuration file:

nano lib/python2.7/site-packages/pgadmin4/config_local.py

For Python3.x:

nano lib/python3.6/site-packages/pgadmin4/config_local.py

Write:

import os
DATA_DIR = os.path.realpath(os.path.expanduser(u'~/.pgadmin/'))
LOG_FILE = os.path.join(DATA_DIR, 'pgadmin4.log')
SQLITE_PATH = os.path.join(DATA_DIR, 'pgadmin4.db')
SESSION_DB_PATH = os.path.join(DATA_DIR, 'sessions')
STORAGE_DIR = os.path.join(DATA_DIR, 'storage')
SERVER_MODE = False

Run

python lib/python2.7/site-packages/pgadmin4/pgAdmin4.py

For Python3.x:

python3 lib/python3.6/site-packages/pgadmin4/pgAdmin4.py

Access

Access at http://localhost:5050

Exit

Exit with Ctrl-C

Run again

cd ~/pgadmin4
source bin/activate
python lib/python2.7/site-packages/pgadmin4/pgAdmin4.py

For Python3.6

#!/bin/bash
cd ~/pgadmin4
source bin/activate
python3 lib/python3.6/site-packages/pgadmin4/pgAdmin4.py

Make a shortcut

touch ~/pgadmin4/pgadmin4
chmod +x ~/pgadmin4/pgadmin4
nano ~/pgadmin4/pgadmin4

Write:

#!/bin/bash
cd ~/pgadmin4
source bin/activate
python lib/python2.7/site-packages/pgadmin4/pgAdmin4.py

For Python3.6

#!/bin/bash
cd ~/pgadmin4
source bin/activate
python3 lib/python3.6/site-packages/pgadmin4/pgAdmin4.py

Now you can just run it with a simpler command:

~/pgadmin4/pgadmin4

Python3 users

Replace [x] in Python3.6 with your respective version.

Conflict with pgAdmin 3 configuration

pgAdmin 4 will not start in the environment where pgAdmin 3 was previously installed and used because of incompatible configuration in the .pgadmin directory. The simplest solution is to either clear that directory or tweak config_local.py to point to a clean new .pgadmin4 directory.

2 of 4
52

Other option is to use docker and a docker image provided by thaJeztah - https://github.com/thaJeztah/pgadmin4-docker

$ docker run --rm -p 5050:5050 thajeztah/pgadmin4

Then to access a PostgreSQL DB instance from within pgadmin4 you should use the IP of the host instead of localhost and 127.0.0.1 since Docker will map those to the container itself.

The IP of a dockerised DB instance could be found with 2 steps:

  • find the container ID of your db with:

    docker ps

  • inspect the container_name to find its ip with:

    docker inspect <ID from previous step>

you are looking for something like "IPAddress": "172.18.0.3"

๐ŸŒ
Gcore
gcore.com โ€บ home โ€บ developers โ€บ how to install pgadmin4 on ubuntu
PgAdmin4 Installation on Ubuntu 22.04 Guide | Gcore
April 8, 2025 - Step-by-step guide for an easy installation of PgAdmin4 on Ubuntu 22.04, simplifying PostgreSQL database management.
๐ŸŒ
ComputingForGeeks
computingforgeeks.com โ€บ home โ€บ install pgadmin 4 on ubuntu 24.04 / 22.04
Install pgAdmin 4 on Ubuntu 24.04 / 22.04 [Step-by-Step]
March 19, 2026 - echo "deb [signed-by=/usr/shar... above. Update the package index to pull metadata from the new repository: ... Install the pgadmin4-web package....
Find elsewhere
๐ŸŒ
DigitalOcean
digitalocean.com โ€บ community โ€บ tutorials โ€บ how-to-install-and-configure-pgadmin-4-in-server-mode-on-ubuntu-22-04
How To Install And Configure pgAdmin 4 in Server Mode on Ubuntu 22.04 | DigitalOcean
September 16, 2022 - In this tutorial, weโ€™ll walk through the process of installing and configuring the latest version of pgAdmin onto an Ubuntu 22.04 server, accessing pgAdmin tโ€ฆ
๐ŸŒ
Time4vps
help.time4vps.com โ€บ all collections โ€บ vps tutorials โ€บ various tutorials โ€บ how to install pgadmin 4 on ubuntu and debian
How To Install pgAdmin 4 on Ubuntu and Debian | Time4VPS Help Center
August 6, 2025 - pgAdmin 4 is a powerful web-based tool for managing PostgreSQL databases. This guide provides step-by-step instructions for installing and configuring pgAdmin 4 on Ubuntu (version 22.04 and later) and Debian 11/12.
๐ŸŒ
Reddit
reddit.com โ€บ r/ubuntu โ€บ i can't install pgadmin 4
r/Ubuntu on Reddit: I can't install pgAdmin 4
April 20, 2025 - I was trying to follow this steps # # Setup the repository # # Install the public key for the repository (if not done previously): curl -fsSโ€ฆ
๐ŸŒ
TecAdmin
tecadmin.net โ€บ how-to-install-pgadmin4-on-ubuntu-20-04
How to Install pgAdmin4 on Ubuntu 20.04 โ€“ TecAdmin
April 26, 2025 - After adding the PPA, update the Apt cache and install the pgAdmin4 package on your system. ... pgadmin4-desktop โ€“ Provides desktop application for Ubuntu system, which required Ubuntu Desktop system.
๐ŸŒ
VITUX
vitux.com โ€บ how-to-install-postgresql-and-pgadmin4-on-ubuntu
How to Install PostgreSQL and pgAdmin4 on Ubuntu 20.04 โ€“ VITUX
pgAdmin4 is not available in Ubuntu 20.04 default repository. So weโ€™re going to add the pgAdmin4 repository in order to install it with the apt-get command.
๐ŸŒ
Linux Mint Forums
forums.linuxmint.com โ€บ board index โ€บ main edition support โ€บ beginner questions
[SOLVED] Trying to install pgAdmin4 - Linux Mint Forums
March 17, 2023 - libpq-dev_15.2-1.pgdg22.04+1_amd64.deb ... 11:20 78855162 pgadmin4-desktop_6.21_amd64.deb 09-Mar-2023 11:20 106187712 Install them, in that order, top to bottom, by double-clicking the deb files....
๐ŸŒ
Linux Compatible
linuxcompatible.org โ€บ story โ€บ how-to-install-pgadmin-4-on-ubuntu-2204-1a
How To Install pgAdmin 4 On Ubuntu 22.04
October 19, 2022 - Citizix published a tutorial about installing pgAdmin 4 on Ubuntu 22.04.PGAdmin is a web-based GUI tool used to interact with the Postgres database sessions, both locally and remote servers as well.
๐ŸŒ
Utho Cloud
utho.com โ€บ docs โ€บ linux โ€บ ubuntu โ€บ how-to-install-and-configure-pgadmin-4-on-ubuntu-22-04
How To Install and Configure pgAdmin 4 on Ubuntu 22.04 | Utho Docs
In this tutorial, you will learn how to install and configure PgAdmin 4 on Ubuntu 22.04. pgAdmin is an open-source tool for managing and developing PostgreSQL and other database management systems that work with it. It was made with Python and jQuery, and it has all of the features of PostgreSQL.
๐ŸŒ
TecAdmin
tecadmin.net โ€บ how-to-install-postgresql-in-ubuntu-20-04
How to Install PostgreSQL and pgAdmin4 in Ubuntu 20.04 โ€“ TecAdmin
April 26, 2025 - After adding the PPA, update the Apt cache and install the pgAdmin4 package on your system. ... pgadmin4-desktop โ€“ Provides desktop application for Ubuntu system, which required Ubuntu Desktop system.
๐ŸŒ
LinuxShout
linux.how2shout.com โ€บ home โ€บ how to install pgadmin 4 on ubuntu 20.04 lts linux
How to install Pgadmin 4 on Ubuntu 20.04 LTS Linux - LinuxShout
August 4, 2022 - Steps to install PostgreSQL pgAdmin 4 on Ubuntu 20.041. Add pgAdmin 4 repository2. Add Public GPG Key3. Update Ubuntu 20.044. Install pgAdmin4 on Ubuntu 20.04 server5. Configure the pgAdmin user account6.
๐ŸŒ
pgAdmin
pgadmin.org
pgAdmin - PostgreSQL Tools
pgAdmin - PostgreSQL Tools for Windows, Mac, Linux and the Web