Skip to content

pgAdmin on a VPS

PostgreSQL web interface

Category
Databases
Hosting
Databases
Author
pgAdmin Development Team
License
PostgreSQL
Version
9.18

The script is free · VPS from $2.79 per month · installs in about 60 seconds

Install over SSH

root@vps:~# command -v docker >/dev/null || curl -fsSL https://get.docker.com | sh; P=$(openssl rand -hex 12); echo "$P" > /root/pgadmin-password && chmod 600 /root/pgadmin-password && docker run -d --name pgadmin --restart unless-stopped -p 5050:80 -e PGADMIN_DEFAULT_EMAIL=admin@example.com -e PGADMIN_DEFAULT_PASSWORD=$P -v pgadmin-data:/var/lib/pgadmin dpage/pgadmin4

  • SystemUbuntu 24.04 · x86_64ok
  • Sourcegithub.com/pgadmin-org/pgadmin4ok
  • Version9.18ok
  • Port5050/tcplisten

✓ pgAdmin 9.18 installed · about 60 seconds

root@vps:~#

Install command from the library. Output is shortened and may differ on your server.

What it is

  • PostgreSQL
  • Web interface
  • SQL

pgAdmin is the official web tool for PostgreSQL administration: schemas, tables, SQL editor, query plans, backups and permissions.

Handy for viewing app data and running queries from the browser without exposing the database port: pgAdmin connects to PostgreSQL directly from the server.

The command runs the official dpage/pgadmin4 image. The login password is generated and saved to /root/pgadmin-password.

  • SQL editor with autocompletion
  • Visual query plan (EXPLAIN)
  • Backup and restore
  • Role and permission management
  • Multiple servers in one window

Recommended plan

For pgAdmin: at least 1 vCPU, 2 GB RAM and 10 GB NVMe.

Minimum to run
1 vCPU · 1 GB RAM · 10 GB disk
Systems
Ubuntu 22.04 · Ubuntu 24.04 · Debian 12

How to install

Three steps in the bot or one command over SSH; installation takes about 60 seconds.

  1. 01

    Choose a plan in the bot

    Open @ExpressHost_bot and pay for a VPS. The server will be ready in about 60 seconds.

  2. 02

    Add pgAdmin

    At the “Add-ons” step pick the script from the library, or run it later: Server settings → Scripts.

  3. 03

    Open http://server-IP:5050, login admin@example.com, password in /root/pgadmin-password

    The bot will send the server address and login details to the chat.

Manually over SSH

Connect to the server as root and run the command. Supported systems: Ubuntu 22.04, Ubuntu 24.04, Debian 12.

Install command
command -v docker >/dev/null || curl -fsSL https://get.docker.com | sh; P=$(openssl rand -hex 12); echo "$P" > /root/pgadmin-password && chmod 600 /root/pgadmin-password && docker run -d --name pgadmin --restart unless-stopped -p 5050:80 -e PGADMIN_DEFAULT_EMAIL=admin@example.com -e PGADMIN_DEFAULT_PASSWORD=$P -v pgadmin-data:/var/lib/pgadmin dpage/pgadmin4

Ports

pgAdmin ports
PortProtocolPurpose
5050tcpWeb interface

After installation

  1. 1.Open http://server-IP:5050, login admin@example.com, password in /root/pgadmin-password
  2. 2.Add a server: Register → Server, host 172.17.0.1 (the server as seen from the container) and your PostgreSQL user credentials
  3. 3.To let PostgreSQL on the host accept connections from Docker, allow the 172.17.0.0/16 network in pg_hba.conf and listen_addresses

pgAdmin FAQ

Didn’t find an answer? Message @ExpressHost_SupportBot.

Is it safe to open port 5050?

Better to restrict it to your IP or access it via an SSH tunnel: ssh -L 5050:127.0.0.1:5050 root@IP.

How do I update pgAdmin?

docker pull dpage/pgadmin4 and re-create the container with the same command. Settings remain in the pgadmin-data volume.

Where are the settings stored?

In the pgadmin-data Docker volume: saved servers and interface settings.

pgAdmin installs at checkout — in the bot.