How To Install pgAdmin 4 in Linux Mint
Overview:
This guide shows how to install the latest version of pgAdmin 4 in Linux Mint, from the official APT repository.
Page Contents
What is pgAdmin?
pgAdmin is a popular and feature-rich open-source database administration and development environment for the PostgreSQL database management system. It is a powerful tool that can help you in your day-to-day database management activities with PostgreSQL. pgAdmin is powered by Python and React, using the Flask framework.
Key pgAdmin Features
- Multi-platform support,
- It supports multiple PostgreSQL versions,
- It comes with extensive documentation,
- It supports multiple deployment modes: desktop mode, using a purpose-built runtime and server mode, supporting multiple users over the web,
- It offers several database development and management tools, such as a powerful query tool with syntax highlighting, fast datagrid for display/entry of data, graphical query plan display, grant Wizard for rapid updates to ACLs, procedural language debugger (supporting pl/pgsql and edb-spl), schema diff tool for managing differences between schemas, and ERD tool for designing and documenting schemas,
- It allows you to create, view, and edit all common PostgreSQL objects, and
- It also comes with multibyte support.
Setup pgAdmin Repository on Linux Mint
The first step is to set up the APT repository for pgAdmin 4 on your computer as follows. This contains the pgAdmin packages. Start by installing the public key for the repository by running this command:
$curl -fsS https://www.pgadmin.org/static/packages_pgadmin_org.pub | sudo gpg --dearmor -o /usr/share/keyrings/packages-pgadmin-org.gpg
Next, create the repository configuration file like this:
$sudo vim /etc/apt/sources.list.d/pgadmin4.list
Copy and paste the following line into the file.
deb [signed-by=/usr/share/keyrings/packages-pgadmin-org.gpg] https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/<ubuntu_codename> pgadmin4 main
Note: By default, the above repository is intended for Ubuntu versions. Because every Linux Mint version is derived from or is based on a corresponding Ubuntu version, you need to set the correct Ubuntu version code name in the repository file.
To get your Linux Mint version description and code name, run this command:
$ lsb_release -dc
![](https://fossguides.com/wp-content/uploads/2023/08/check-linux-mint-version-and-codename.png)
In this example, the Linux Mint codename is una, now get the corresponding codename for Ubuntu. You can find a list of all supported Linux Mint releases and code names and their corresponding Ubuntu package base (code name) on this page.
Your repository configuration should now look like this.
![](https://fossguides.com/wp-content/uploads/2023/08/pgadmin-apt-repository-configuration-file-1024x62.png)
Next, update the local package index to include packages from the newly added pgAdmin repository, by running the following commands:
$sudo apt update
If the repository is set up correctly, you should be able to view information about the pgAdmin package by running the following command:
$apt show pgadmin4
![](https://fossguides.com/wp-content/uploads/2023/08/show-information-about-pgadmin4-package.png)
Install pgAdmin 4 in Linux Mint
As I mentioned earlier, pgAdmin has two modes: desktop mode and web mode. To install for both desktop and web modes, run this command:
$sudo apt install pgadmin4
To only install the desktop mode, run this command:
$sudo apt install pgadmin4-desktop
To install for web mode only, issue this command:
$sudo apt install pgadmin4-web
Besides, to configure the webserver, if you installed pgadmin4-web, then run this command:
$sudo /usr/pgadmin4/bin/setup-web.sh
How To Connect to a Database using pgAdmin 4
After successfully installing pgAdmin, search for it in the system menu and open it. To connect to a database server, under Quick Links, click on Add New Server.
![](https://fossguides.com/wp-content/uploads/2023/08/pgadmin-default-desktop-interface-1024x725.png)
In the pop window, under the General tab, enter the connection Name as shown in the following screenshot.
![](https://fossguides.com/wp-content/uploads/2023/08/enter-database-server-connection-name-in-pgadmin.png)
Then click the Connection tab and enter the database name/IP address, port (default is 5432), database name (maintenance database), database username, and the user’s password. Then click Save.
![](https://fossguides.com/wp-content/uploads/2023/08/enter-database-connection-details-in-pgadmin.png)
If the database connection is successful, the new connection will appear under the list of servers. Click on the connection name to expand it. A list of all databases on the server will appear. Click on the database you intend to connect to and start using pgAdmin 4.
![](https://fossguides.com/wp-content/uploads/2023/08/list-of-connected-database-in-pgadmin4-1024x725.png)
Conclusion
Congratulations! You have successfully installed pgAdmin 4 on your Linux Mint system. For more information, see the pgAdmin 4 website which includes the documentation. You can also ask any questions about this guide via the feedback form below.