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

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

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"

Output

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

Output

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

Output

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

http://38.76.11.34 /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

Jamie Arthur 2:08 am

About Jamie Arthur

James is a passionate Linux and Windows Systems Administrator with 4 years of experience in Linux, databases and Front-End development. He loves doing research on different Linux distributions and experimenting with installation and configuration of different services and features. His hobbies include swimming, reading novels and playing video games.

Author's All Posts
Like to become part of Linoxide Team and contribute tips? Contact us here.

Comments

Your email address will not be published. Required fields are marked *

All comments are subject to moderation.

5 Comments

  1. so..... everything will be ok except one point... there is no repo yet for pgadmin4 and you didnt wrote........ :)

  2. 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
    **