In this article, we will have explained the necessary steps to install and configure pgAdmin4 on Ubuntu 20.04 LTS. Before continuing with this tutorial, make sure you are logged in as a user with sudo privileges. All the commands in this tutorial should be run as a non-root user.
Install pgAdmin4 on Ubuntu 20.04
Step 1. First, before you start installing any package on your Ubuntu server, we always recommend making sure that all system packages are updated.
Step 2. Install PostgreSQL on Ubuntu.
Run the following commands to install PostgreSQL server on Ubuntu:
Once the installation is completed, the PostgreSQL service will start automatically. To check the Postgres version and confirm installation run following psql command:
Step 3. Install pgAdmin on Ubuntu.
First, add pgAdmin4 Key and Repository for Ubuntu 20.04:
curlhttps://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
Then, add the pgAdmin4 repository:
sudosh-c'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
Now Install pgAdmin4 packages with additional packages for Apache UwsGI application using the apt command:
Step 4. Setup PostgreSQL Authentication.
Log in to the PostgreSQL shell using the ‘psql’ command below:
Now change the password for the ‘postgres’ user using the following query:
Step 5. Accessing pgAdmin 4.
Open your web browser and type the server IP address following by the ‘pgadmin4’ path URL:
On the pgAdmin4 login page, type your email address and password, then click the ‘Login‘ button.
That’s all you need to do to install pgAdmin4 on Ubuntu 20.04 LTS Focal Fossa. I hope you find this quick tip helpful. Don’t forget to share your valuable queries/suggestions in the below comment box & also drop your worthwhile feedback.