Hi, folks. In this post, you will learn how to install pgAdmin4 on Ubuntu 20.04 This is, perhaps, the most advanced PostgreSQL front-end in the world. So if you work with PostgreSQL is a good idea to have it installed.
Thanks to this application, you can have a graphical interface to manage everything related to PostgreSQL. The main advantage of this program is the ability to view all the records we have stored. On the other hand, we can create connections and customize them to achieve even more security. It is also possible to create, modify and delete databases.
So, pgAdmin4 becomes a printable application if you use a lot of PostgreSQL or if you want to use it for educational purposes.
So, let us install pgAdmin4 on Ubuntu 20.04.
Install pgAdmin4 on Ubuntu 20.04
First, you need to install PostgreSQL on Ubuntu 20.04
To install pgAdmin4 on Ubuntu 20.04 we need to add an external repository. This is so that we can have the latest version available for this program.
So, create a new repository file called
:~$ sudo nano /etc/apt/sources.list.d/pgdg.list
And add the next line in the file:
deb http://apt.postgresql.org/pub/repos/apt/ focal-pgdg main
Save the changes and close the file.
Then add the GPG key to the repository to make sure the system can recognize it.
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - OK
Refresh the repositories:
:~$ sudo apt-get update
And now yes, install pgAdmin4 on Ubuntu 20.04 with the following command:
:~$ sudo apt install pgadmin4 pgadmin4-apache2
During the installation, you will be asked to enter the user’s email address. This email will be used to login.
After that, define the initial password:
When the installation is complete, enable the rewrite PHP mod:
:~$ sudo a2enmod rewrite Enabling module rewrite. To activate the new configuration, you need to run: systemctl restart apache2
So, restart Apache:
:~$ sudo systemctl restart apache2
Now let’s test it by making a connection.
Testing pgAdmin4 on Ubuntu 20.04
We need to prove that everything is OK, to do so, open your web browser and go to the following address:
And you will see the Login screen.
Enter the email and password you created during the installation and you will see the following screen:
Now we will create a new connection, to do this click on the option Add New Server.
In the General tab, assign a name to the connection.
Then, in the Connection tab, define the connection parameters such as host, username, port, and password.
If everything went well, the connection will be active.
So, enjoy it.
pgAdmin4 is a vital tool to manipulate PostgreSQL visually and very easily. Its potentials are vast and it is recommended that you visit the project website to learn more about it.
Please share this post with your friends and join our Telegram Channel. Also, buy us a coffee.