How to Install pgAdmin on Ubuntu 22.04

In this post, we will show you how to Install pgAdmin on Ubuntu 22.04 and will also cover how to connect to existing PostgreSQL database server.

pgAdmin is a graphical user interface for PostgreSQL administration, it allows admin to manage postgresql databases efficiently. With an active community of users and developers, pgAdmin receives regular updates and bug fixes, ensuring a reliable database management experience.


  •  Pre-Install Ubuntu 22.04
  • Sudo User with admin access
  • Internet Access
  • Pre-Install PostgreSQL

Without any delay, lets quickly jump into pgadmin installation steps on Ubuntu 22.04

1) Install Curl Utility

We need curl command line utility to install public keys of package repository. So, open the terminal and run below apt command,

$ sudo apt update && sudo apt install curl -y


2) Configure pgAdmin APT Package Repository

In order to configure pgadmin repository, first install its public key using below curl command.

$ curl -fsS | sudo gpg --dearmor -o /usr/share/keyrings/packages-pgadmin-org.gpg

Now create the repository configuration file using beneath command.

$ sudo sh -c 'echo "deb [signed-by=/usr/share/keyrings/packages-pgadmin-org.gpg]$(lsb_release -cs) pgadmin4 main" > /etc/apt/sources.list.d/pgadmin4.list && apt update'


3) Install pgAdmin on Ubuntu 22.04

Once you are done with setup of pgAdmin repository then run following apt command to install pgAdmin for both desktop and web modes.

$ sudo apt install pgadmin4 -y

Install pgAdmin on Ubuntu 22.04

4) Configure User Account for pgAdmin Web Interface

Whenever we install pgadmin4 package then it also installs a script “/usr/pgadmin4/bin/” which is used to configure user account for web interface. Using this script, user accounts will be secured and disallow unauthorized access.

Run the script from the terminal.

$ sudo /usr/pgadmin4/bin/


Script will prompt you to enter email address, password and restart Apache service.

5) Access pgAdmin Web Interface

With the setup complete, you can now access pgAdmin through your web browser. Open your preferred web browser and enter the following URL in the address bar:


You will be prompted to log in using the email address and password you provided during the setup process.


Upon successful login, you will gain access to the PGAdmin interface, where you can start managing your PostgreSQL databases with ease.


6) Connect to PostgreSQL From pgAdmin

Now that you’re logged in to pgAdmin, it’s time to connect it to your PostgreSQL database server. Follow these steps:

a ) Right Click on Servers Icon, choose Register and then server as shown below:


b) Fill in the following details in General and Connection tab

  • Registered Server Name
  • Hostname/address: Enter the IP address or hostname of your PostgreSQL server.
  • Port: By default, PostgreSQL listens on port 5432.
  • Maintenance database: Enter the name of the default database you want to connect to.
  • Username: Enter the username of your PostgreSQL user with appropriate privileges.
  • Password: Enter the password associated with the username.



Click “Save” to register the server to pgAdmin.

Once the server is added, you can expand it in the pgAdmin dashboard to access the databases, schemas, tables, and other objects within your PostgreSQL server. You can perform various administrative tasks, execute queries, and manage your databases efficiently using pgAdmin’s intuitive interface.


That’s all from this post, I hope above mentioned steps were informative and useful. Feel free to post your queries and feedback in below comments section.

2 thoughts on “How to Install pgAdmin on Ubuntu 22.04”

  1. Need Help

    As a prerequisite, I installed PostgreSQL, using your instructions.

    I then followed your instructions to install pgAdmin.
    When I execute Step 3 “sudo apt install pgadmin4 -y”, the output says “Package ‘pgadmin4’ has no installation candidate”

    Can you help me fix this please.
    I placed all of the steps and output below:


    rbrown@HiveMQ:~$ sudo apt update && sudo apt install curl -y
    Hit:1 stable InRelease
    Hit:2 noble-security InRelease
    Hit:3 noble InRelease
    Hit:4 noble-updates InRelease
    Hit:5 noble-pgdg InRelease
    Hit:6 noble-backports InRelease
    Reading package lists... Done
    Building dependency tree... Done
    Reading state information... Done
    All packages are up to date.
    Reading package lists... Done
    Building dependency tree... Done
    Reading state information... Done
    The following NEW packages will be installed:
    0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
    Need to get 227 kB of archives.
    After this operation, 532 kB of additional disk space w
    ill be used.
    Get:1 noble-updates/main amd64 curl amd64 8.5.0-2ubuntu10.1 [227 kB]
    Fetched 227 kB in 1s (383 kB/s)
    Selecting previously unselected package curl.
    (Reading database ... 151349 files and directories currently installed.)
    Preparing to unpack .../curl_8.5.0-2ubuntu10.1_amd64.deb ...
    Unpacking curl (8.5.0-2ubuntu10.1) ...
    Setting up curl (8.5.0-2ubuntu10.1) ...
    Processing triggers for man-db (2.12.0-4build2) ...
    rbrown@HiveMQ:~$ curl -fsS | sudo gpg --dearmor -o /usr/share/keyrings/packages-pgadmin-org.gpg
    rbrown@HiveMQ:~$ sudo sh -c 'echo "deb [signed-by=/usr/share/keyrings/packages-pgadmin-org.gpg]$(lsb_release -cs) pgadmin4 main" > /etc/apt/sources.list.d/pgadmin4.list && apt update'
    Hit:1 noble InRelease
    Hit:2 noble-updates InRelease
    Hit:3 stable InRelease
    Hit:4 noble-backports InRelease
    Hit:5 noble-security InRelease
    Hit:6 noble-pgdg InRelease
    Get:7 pgadmin4 InRelease [4,217 B]
    Fetched 4,217 B in 1s (2,865 B/s)
    Reading package lists... Done
    Building dependency tree... Done
    Reading state information... Done
    All packages are up to date.
    rbrown@HiveMQ:~$ sudo apt install pgadmin4 -y
    Reading package lists... Done
    Building dependency tree... Done
    Reading state information... Done
    Package pgadmin4 is not available, but is referred to by another package.
    This may mean that the package is missing, has been obsoleted, or
    is only available from another source

    E: Package 'pgadmin4' has no installation candidate

    • Hi Robert,

      As I can see you are trying to install pgadmin4 on Ubuntu 24.04 but it is not yet supported by Ubuntu 24.04 that’s why you are getting above error.

      We are expecting that it will be supported by June but till that time you can follow the below workaround.

      1) Use mantic instead of noble
      2) Make sure python3.11 is installed.

      $ sudo sh -c 'echo "deb [signed-by=/usr/share/keyrings/packages-pgadmin-org.gpg] pgadmin4 main" > /etc/apt/sources.list.d/pgadmin4.list && apt update'
      $ sudo apt install pgadmin4
      $ sudo add-apt-repository ppa:deadsnakes/ppa
      $sudo apt update
      $ sudo apt install python3.11


Leave a Comment