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.
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.
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 core database server
- 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.
Also set admin password
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: Stopped The Apache HTTP Server. Oct 06 13:47:00 ubuntu18 systemd: Starting The Apache HTTP Server... Oct 06 13:47:00 ubuntu18 systemd: Started The Apache HTTP Server.
If you have UFW firewall configured, allow http and https traffic.
sudo ufw allow http sudo ufw allow https
Login by using set email address and password.
Wait for a few seconds for initialization to complete.
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.
Under the “General” section, give the server a name & description.
Under “Connection” tab, provide access details – DB host, DB user and Password.
When done, Click Save button to save the configurations. If you were successful adding the server, the name will appear in the left sidebar.
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:
- SQL and PostgreSQL: The Complete Developer’s Guide
- The Complete Python/PostgreSQL Course 2.0
- SQL & PostgreSQL for Beginners: Become an SQL Expert
- Learn SQL Using PostgreSQL: From Zero to Hero
- PostgreSQL Bootcamp : Go From Beginner to Advanced, 60+hours
- Install PostgreSQL 12 on Ubuntu
- Best Free and Open Source Web Hosting Control Panels
- How to Install ClickHouse analytic DBMS on Ubuntu
- How to Install ArangoDB on Ubuntu
- 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