It looks like you're new here. If you want to get involved, click one of these buttons!
Sign In RegisterIt looks like you're new here. If you want to get involved, click one of these buttons!
pgAdmin 4 is a powerful web-based tool for managing PostgreSQL databases. This guide provides step-by-step instructions for installing and configuring pgAdmin 4 on Ubuntu (version 22.04 and later) and Debian 11/12.
Apache: pgAdmin requires a web server like Apache. If Apache is not installed, you can install it using our guide.
Update package lists:
apt update
Run this command to add the repository key:
curl https://www.pgadmin.org/static/packages_pgadmin_org.pub | apt-key add
Add the pgAdmin repository by running the following command:
sh -c 'echo "deb https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/$(lsb_release -cs) pgadmin4 main" > /etc/apt/sources.list.d/pgadmin4.list && apt update'
Now you can install pgAdmin 4:
apt install pgadmin4 -y
Nest run the pgAdmin 4 installation script:
/usr/pgadmin4/bin/setup-web.sh
To allow web traffic to pgAdmin, open the necessary ports based on your firewall setup.
Using IPtables
If you use IPtables, run:
iptables -I INPUT -p tcp --dport 80 -j ACCEPT
iptables -I INPUT -p tcp --dport 443 -j ACCEPT
To save the changes, install iptables-persistent (if not installed):
apt install iptables-persistent -y
Then save the rules:
iptables-save | tee /etc/iptables/rules.v4
Using UFW
If you use UFW (Uncomplicated Firewall), run:
ufw allow 'Apache Full'
Reload UFW:
ufw reload
Once installed, access pgAdmin 4 via:
http://SERVER_IP/pgadmin4
Replace SERVER_IP with your server's actual IP address.
On the Login page, enter the email address and password you set during the installation process.
After logging in, you will see the pgAdmin dashboard. Now you can start working with pgAdmin:
PgAdmin 4 has been installed and set up successfully on your server. You can now use its web interface to manage your PostgreSQL databases efficiently.