How to Install pgAdmin 4 on Ubuntu 24.04
Introduction
pgAdmin 4 is a powerful and feature-rich administration and management tool for PostgreSQL databases. This guide will walk you through the steps to install pgAdmin 4 on Ubuntu 24.04.
Prerequisites
- An Ubuntu 24.04 server with sudo privileges
- PostgreSQL installed on your system
- A stable internet connection
Step 1: Update System Packages
Before installing any software, it is essential to update your system packages. Run the following commands:
sudo apt update
sudo apt upgrade -y
Step 2: Install pgAdmin 4
- Add the pgAdmin 4 repository by running the command:
curl https://www.pgadmin.org/static/packages_pgadmin_org.pub | sudo tee /etc/apt/trusted.gpg.d/pgadmin.asc
- Add the repository to your system:
echo "deb https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/ubuntu/ focal-pgdg main" | sudo tee /etc/apt/sources.list.d/pgadmin4.list
- Update the package list:
sudo apt update
- Install pgAdmin 4:
sudo apt install pgadmin4 -y
Step 3: Configure pgAdmin 4
After installation, you need to configure pgAdmin 4. Follow these steps:
- Run the setup script to configure the web server:
sudo /usr/pgadmin4/bin/setup-web.sh
- Follow the prompts to set up an email and password for accessing the pgAdmin web interface.
Step 4: Access pgAdmin 4
Once configured, you can access pgAdmin 4 by opening a web browser and navigating to:
http:///pgadmin4
Log in with the email and password you set during configuration.
Conclusion
Congratulations! You have successfully installed and configured pgAdmin 4 on Ubuntu 24.04. You can now use this tool to manage your PostgreSQL databases efficiently.
For advanced hosting solutions, check out our VPS Windows offers.