22.6 C
Texas
angeloma
Senior Writer and partner

How to install PgAdmin4 on Ubuntu 20.04?

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.

pgAdmin is the most popular and features rich Open Source administration and development platform for PostgreSQL, the most advanced Open Source database in the world.

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.

- Advertisement -

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

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 pgdg.list

:~$ 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
1.- Adding the pgAdmin repository
1.- Adding the pgAdmin repository

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
2.- Installing pgAdmin4 on Ubuntu 20.04
2.- Installing pgAdmin4 on Ubuntu 20.04

During the installation, you will be asked to enter the user’s email address. This email will be used to login.

3.- Configuring pgAdmin4
3.- Configuring pgAdmin4

After that, define the initial password:

4.- Creating the initial user for pgAdmin4
4.- Creating the initial user for pgAdmin4

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:

http://your-server/pgadmin4/

Or:

http://localhost/pgadmin4/

And you will see the Login screen.

5.- pgAdmin4 Login screen
5.- pgAdmin4 Login screen

Enter the email and password you created during the installation and you will see the following screen:

6.- pgAdmin4 dashboard
6.- pgAdmin4 dashboard

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.

7.- Creating a new connection
7.- Creating a new connection

Then, in the Connection tab, define the connection parameters such as host, username, port, and password.

8.- Adding the connection parameters
8.- Adding the connection parameters

If everything went well, the connection will be active.

9.- pgAdmin4 on Ubuntu 20.04
9.- pgAdmin4 on Ubuntu 20.04

So, enjoy it.

Conclusion

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.

- Advertisement -
Everything Linux, A.I, IT News, DataOps, Open Source and more delivered right to you.
Subscribe
"The best Linux newsletter on the web"

LEAVE A REPLY

Please enter your comment!
Please enter your name here



Latest article