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 Also: How to Install Ubuntu 18.04 Dual Boot with Windows 10
Prerequisite
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
Output
By default, PostgreSQL runs on port 5432. To verify this, run the netstat command as shown
# netstat -pnltu | grep "5432"
Output
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
Output
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
Output
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"
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
http://38.76.11.34 /pgadmin4/
You will be presented with a login page as shown below
Provide the email address and the password you had defined earlier during the installation process and hit the 'Login' button.
This will usher you to PgAdmin4's dashboard as seen below.
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
so..... everything will be ok except one point... there is no repo yet for pgadmin4 and you didnt wrote........ :)
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
**
Hey Joflix, did you update the system repositories before you started the installation process ?
You should add the apt.postgresql.org repository:
sudo nano /etc/apt/sources.list.d/pgdg.list
# add the following line:
deb http://apt.postgresql.org/pub/repos/apt/ bionic-pgdg main
sudo wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt update
sudo apt install pgadmin4 pgadmin4-apache2
Thanks Jamie and Rowel, worked for me as a Linux noob after following Rowel's additional instructions.