How to Install pgAdmin4 on Ubuntu

How to install pgadmin4 on ubuntu

pgAdmin4 is a feature-rich, cross-platform, web-based interface that allows you to administer and manage PostgreSQL database instances in a web browser.  In this guide, you will learn how to install pgAdmin4 on Ubuntu 18.04 LTS.

Read AlsoHow to Install Ubuntu 18.04 Dual Boot with Windows 10


Before proceeding, ensure that you have PostgreSQL  database installed on Ubuntu server 18.04 LTS

To verify that PostgreSQL is running on your system execute

# /etc/init.d/postgres status


check status of postgreSQL service

By default, PostgreSQL runs on port 5432. To verify this, run the netstat command as shown

# netstat -pnltu | grep "5432"


posgres running

Installing pgAdmin4 on Ubuntu 18.04

Now that you have verified that PostgreSQL is up and running,  proceed to update & upgrade the system as shown

# sudo apt update -y && sudo apt upgrade -y


update and upgrade the system

Next, run the command below to install pgAdmin4.

This will also install a host of other extra software packages and dependencies.

# sudo apt install pgadmin4 pgadmin4-apache2


install pgadmin4 on Ubuntu 18.04 LTS

The pgadmin4-apache2  package will get integrated with pgAdmin4 and  Apache2 web server.

During this setup, you will be prompted for an email address. Provide your preferred email address

and hit "Ok"

Enter pgadmin4 user email address

Next, provide the password you are going to use during log in and hit "Ok"

Thereafter, the setup will continue and wrap up.

Great! At this point, you have successfully installed pgAdmin4 on your System.

Connecting to PostgreSQL via pgAdmin4

Now that you have successfully installed  pgAdmin4 on your Ubuntu System, you can connect to PostgreSQL by browsing your server's IP address or domain name followed by the suffix /pgAdmin4  in the URL.

In my case my server's URL is /pgadmin4/

You will be presented with a login page as shown below

pgadmin4 login page

Provide the email address and the password you had defined earlier during the installation process and hit the 'Login' button.

pgadmin4 login credentials

This will usher you to PgAdmin4's dashboard as seen below.

pgadmin4 dashboard

Wonderful! If you have come this far, you have been able to install pgAdmin4 on Ubuntu 18.04 LTS. Please share your feedback in the comment section below.

Resource Link - Pgadmin4

5 Comments... add one

  1. This did not work for me, I get this error:
    **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
    E: Unable to locate package pgadmin4-apache2


Leave a Comment