pgAdmin 4 is a powerful, open-source administration and development platform for PostgreSQL. In this guide, we will walk through the steps to install and use pgAdmin 4 on Rocky Linux 8.
Step 1: Update Your System
Start by ensuring your system is up to date:
sudo dnf update -y
Step 2: Install Required Dependencies
Install the necessary dependencies for pgAdmin:
sudo dnf install -y python3 python3-pip python3-devel
Step 3: Install pgAdmin 4
Install pgAdmin using pip:
pip3 install pgadmin4
Step 4: Configure pgAdmin 4
After the installation, you need to configure pgAdmin 4. Create a configuration file:
sudo mkdir -p /var/lib/pgadmin
sudo nano /var/lib/pgadmin/config.py
Add the following lines to the configuration file:
SERVER_MODE = False
SESSION_DB_PATH = '/var/lib/pgadmin/sessions'
DATABASE_URI = 'postgresql://pgadmin:your_password@localhost/pgadmin'
Replace your_password
with a strong password of your choice.
Step 5: Create a Database for pgAdmin
Log in to PostgreSQL to create a database for pgAdmin:
sudo -u postgres psql
CREATE DATABASE pgadmin;
CREATE USER pgadmin WITH PASSWORD 'your_password';
GRANT ALL PRIVILEGES ON DATABASE pgadmin TO pgadmin;
\q
Step 6: Start pgAdmin 4
To start pgAdmin 4, use the following command:
python3 /usr/local/lib/python3.*/site-packages/pgadmin4/pgAdmin4.py
By default, pgAdmin runs on port 5050. You can access it by navigating to:
http://your_server_ip:5050
Step 7: Set Up pgAdmin 4
On your first visit, you will be prompted to set up an admin account. Enter your email and password to create the account.
Step 8: Accessing PostgreSQL
After logging in, you can connect to your PostgreSQL database by providing the connection details.
Conclusion
You have successfully installed and configured pgAdmin 4 on Rocky Linux 8. This powerful tool allows you to manage your PostgreSQL databases easily.
If you're looking for a reliable hosting solution for your PostgreSQL databases, consider using Windows VPS UK. With Windows VPS, you can efficiently host your applications and ensure high performance. Whether you need VPS UK Windows or Windows Virtual Private Servers, you'll find a solution that fits your requirements.
For larger deployments or enterprise needs, explore Windows Virtual Dedicated Server Hosting or Virtual Private Server Hosting Windows. Whether you're located in the UK, Italy, or elsewhere, Windows VPS Italy and UK VPS Windows offer reliable hosting options. Visit Windows VPS Hosting UK to discover the best hosting solutions for your database management needs.