How to Install pgAdmin 4 on Ubuntu 20.04/18.04/16.04?. This post has been written primarily to guide new users on installing pgAdmin 4 on Ubuntu 20.04/18.04/16.04. pgAdmin is a feature-rich and open source PostgreSQL administration and development platform that runs on Linux, Unix, Mac OS X, and Windows.

With pgAdmin you can manage PostgreSQL database servers, from version 9.2 using an intuitive and powerful web interface. We have guides on installing pgAdmin 4 on other platforms.

How to Install pgAdmin 4 on Debian

How to Install pgAdmin 4 on CentOS 7

How to Install pgAdmin4 on FreeBSD 12

Refer to above guides and official pgAdmin documentation for platform different from ones shared. If you’re running an Ubuntu system, or Linux Mint, this guide will work for you. Linux Mint 19 users should use repository for Ubuntu 18.04, and Mint 18 to use Ubuntu 16.04 repositories.

Install pgAdmin 4 on Ubuntu 20.04/18.04/16.04

The one requirement for installation of pgAdmin4 on Ubuntu 20.04/18.04/16.04 is PostgreSQL server. You can choose to go with any version of PostgreSQL server >=9.6. We have guides which can be used as reference while installing PostgreSQL database server.

Install PostgreSQL 12 on Ubuntu

Install PostgreSQL 11 on Ubuntu

Having completed installation of PostgreSQL database server on Ubuntu, proceed to install and initiate pgAdmin4 on Ubuntu 18.04 / Ubuntu 16.04. See below

Add PostgreSQL APT repository

The PostgreSQL Global Development Group (PGDG) maintains an APT repository of PostgreSQL packages for Debian and Ubuntu. The repository can be added using the commands shown below.

wget --quiet -O - | sudo apt-key add -
echo "deb `lsb_release -cs`-pgdg main" |sudo tee  /etc/apt/sources.list.d/pgdg.list

The repository added contains many different packages including third party addons. Mainly:

  • postgresql-client
  • postgresql core database server
  • libpq-dev
  • postgresql-server-dev
  • pgadmin packages

Install pgAdmin4 on Ubuntu 20.04/18.04/16.04

Finally, update the package lists.

sudo apt update

To install pgAdmin4 packages on Ubuntu 20.04/18.04/16.04 system, run these commands, providing correct version number:

sudo apt update
sudo apt install pgadmin4 pgadmin4-apache2

During installation, you’re asked to configure initial user account. Provide email address.

Install pgAdmin4 on Ubuntu

Also set admin password

Install pgAdmin4 on Ubuntu

Apache service should have been started after installation.

$ systemctl status apache2
● apache2.service - The Apache HTTP Server
   Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
  Drop-In: /lib/systemd/system/apache2.service.d
   Active: active (running) since Sun 2019-10-06 13:47:00 UTC; 23s ago
 Main PID: 5678 (apache2)
    Tasks: 83 (limit: 2362)
   CGroup: /system.slice/apache2.service
           ├─5678 /usr/sbin/apache2 -k start
           ├─5682 /usr/sbin/apache2 -k start
           ├─5683 /usr/sbin/apache2 -k start
           └─5684 /usr/sbin/apache2 -k start

Oct 06 13:47:00 ubuntu18 systemd[1]: Stopped The Apache HTTP Server.
Oct 06 13:47:00 ubuntu18 systemd[1]: Starting The Apache HTTP Server...
Oct 06 13:47:00 ubuntu18 systemd[1]: Started The Apache HTTP Server.

If you have UFW firewall configured, allow http and https traffic.

sudo ufw allow http
sudo ufw allow https

Open your browser and http://[ServerIP_or_domain]/pgadmin4.

Install pgAdmin4 on Ubuntu

Login by using set email address and password.

Install pgAdmin4 on Ubuntu

Wait for a few seconds for initialization to complete.

Install pgAdmin4 on Ubuntu

On the first page of pgAdmin, add a PostgreSQL server to administer with pgAdmin by clicking on “Add New Server”. This can be local or a remote PostgreSQL server.

Install pgAdmin4 on Ubuntu

Under the “General” section, give the server a name & description.

Install pgAdmin4 on Ubuntu

Under “Connection” tab, provide access details – DB host, DB user and Password.

Install pgAdmin4 on Ubuntu

When done, Click Save button to save the configurations. If you were successful adding the server, the name will appear in the left sidebar.

Install pgAdmin4 on Ubuntu

Select the server to see database summary information and make changes. Learn more on how to use pgAdmin from the documentation page.

 On-demand video courses to Learn PostgreSQL Database:



  • Install pgAdmin 4 on Ubuntu 20.04/18.04/16.04
  • Installing pgAdmin 4 on Ubuntu 20.04/18.04/16.04
  • pgAdmin 4 installation on Ubuntu

Your support is our everlasting motivation,
that cup of coffee is what keeps us going!

As we continue to grow, we would wish to reach and impact more people who visit and take advantage of the guides we have on our blog. This is a big task for us and we are so far extremely grateful for the kind people who have shown amazing support for our work over the time we have been online.

Thank You for your support as we work to give you the best of guides and articles. Click below to buy us a coffee.


Please enter your comment!
Please enter your name here