How to Install pgAdmin4 on Ubuntu 18.04 / Ubuntu 16.04?. This post has been written primarily to guide new users on how to install pgAdmin 4 on Ubuntu 18.04 / Ubuntu 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 pgAdmin4 on Ubuntu 18.04 / Ubuntu 16.04

The one requirement for installation of pgAdmin4 on Ubuntu 18.04 / Ubuntu 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 - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
echo "deb http://apt.postgresql.org/pub/repos/apt/ `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 18.04 / Ubuntu 16.04

Finally, update the package lists.

sudo apt update

To install pgAdmin4 packages on Ubuntu 18.04 / Ubuntu 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
           └─apache2-systemd.conf
   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.

Related:

Install PostgreSQL 12 on Ubuntu 18.04 / Ubuntu 16.04

Best Free and Open Source Web Hosting Control Panels

How to Install ClickHouse analytic DBMS on Ubuntu

How to Install ArangoDB on Ubuntu 18.04 Bionic Beaver

Tags:

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