pgAdmin is a popular open-source administration and development platform for PostgreSQL. It allows users to manage their PostgreSQL databases and interact with them using a graphical user interface (GUI). In this article, we will show you how to install and use pgAdmin 4 on Rocky Linux 8, a community-driven Linux distribution built from the source code of Red Hat Enterprise Linux (RHEL).
Here are a few examples of how you can use pgAdmin 4:
- Connect to a PostgreSQL server and browse the list of databases on the server.
- Create new databases and tables, and modify the existing ones.
- Run SQL queries on the databases and view the results in a tabular format.
- Export the results of a query to a file, such as CSV or JSON.
- Import data from a file, such as CSV or SQL, into a database.
- Create and manage users and their roles and permissions.
- Monitor the performance of the databases using the built-in performance dashboard.
- Use the graphical query builder to create complex queries without having to write the SQL code manually.
These are just a few examples of how you can use pgAdmin 4 to manage and interact with your PostgreSQL databases. There are many more features and capabilities available in pgAdmin 4, and you can explore them as you use the tool.
Before you start, make sure you have a fresh installation of Rocky Linux 8 on your server. You can follow our guide on how to install Rocky Linux 8 if you need help with this. You will also need to have PostgreSQL installed and running on your server.
Once your server is ready, follow these steps to install and use pgAdmin 4 on Rocky Linux 8:
- Add the PostgreSQL yum repository to your system:
sudo yum install -y <https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm>
- Install the
pgadmin4
package:
sudo yum install -y pgadmin4
- Enable and start the
pgadmin4
service:
sudo systemctl enable pgadmin4
sudo systemctl start pgadmin4
- Open a web browser and go to
http://server-ip/pgadmin4
. You will be prompted to log in with the default credentials:
Username: pgadmin4@pgadmin.org
Password: admin
- After logging in, you will see the pgAdmin 4 dashboard. To add a new PostgreSQL server, click on the “Add New Server” button in the “Object Browser” section.
- In the “Create – Server” dialog, enter a name for the server and the connection details for your PostgreSQL instance. You can find the connection details in the
pg_hba.conf
andpostgresql.conf
files in the/var/lib/pgsql/data
directory. - Click on the “Save” button to add the server. You should now see the new server in the “Object Browser” section, and you can expand it to view and manage the databases on the server.
In conclusion, pgAdmin 4 is a powerful tool for managing PostgreSQL databases. By following the steps outlined in this article, you can easily install and use pgAdmin 4 on Rocky Linux 8 to administer your PostgreSQL databases.