Dev Tools

Host pgAdmin 4 on VeloxaHost

pgAdmin 4 is an administration and development tool for PostgreSQL: a web interface to browse databases, run and explain queries, manage roles, tables and backups, and keep connections to several servers in one place. Developers and database administrators run it in server mode so a team can manage PostgreSQL from a browser.

The one-click install adds pgAdmin's own APT repository for Ubuntu 24.04, installs the pgadmin4-web package, which runs pgAdmin under Apache, and runs pgAdmin's setup-web.sh --yes to configure web mode. That script creates pgAdmin's configuration database and its first user, enables Apache's WSGI module and pgAdmin's configuration, and restarts Apache, so pgAdmin is at /pgadmin4 on port 80.

Signing in

Sign in as admin@example.com with the generated password shown on the server's page. The install passes both to pgAdmin's setup through PGADMIN_SETUP_EMAIL and PGADMIN_SETUP_PASSWORD, the variables pgAdmin reads when it is set up without a terminal. VeloxaHost replaces the install script's placeholder password with a random one at deploy time and stores it encrypted; organization owners and admins can reveal it on the server's page, and every reveal is recorded in the audit log.

This first account is a superuser and can add other users, each with their own email address, through pgAdmin's user management. Change its password from the user menu after you first sign in, then delete the stored copy.

Reaching it on VeloxaHost

Every server gets a block of ports (10 by default) on the region's shared IPv4 address. The first forwards to SSH; under How to connect on the server's page, forward another to port 80 and open http://<shared address>:<port>/pgadmin4.

That connection is plain HTTP, and pgAdmin holds the keys to your databases, so attach a VeloxaHost firewall that allows only your own addresses, or skip the forward and use an SSH tunnel on the first port of your block:

ssh -N -L 8080:127.0.0.1:80 -p 20000 root@203.0.113.10

and open http://localhost:8080/pgadmin4. For a domain with HTTPS on port 443, use a dedicated IPv4 address (a paid add-on with limited availability) and add a certificate to Apache. IPv6 is not available in US East yet.

Connecting to PostgreSQL

In pgAdmin, Register, Server takes a host, port, database and user. A PostgreSQL server on the same machine is at localhost. For one on another VeloxaHost server, such as the PostgreSQL one-click app, use that server's shared address and the port you forwarded to its 5432: servers cannot reach each other over the host's bridge. PostgreSQL then has to listen on its network address and allow your pgAdmin server in pg_hba.conf, and the traffic crosses the public network, so require SSL on the connection.

What it needs

pgAdmin's docs set no hardware figures. It is a Python web application under Apache, and one pgAdmin serves a small team. The catalogue's minimum is 1 vCPU and 512 MB; the recommended 1 GB fits the Veloxa Nano size: 1 vCPU, 1 GB RAM and 25 GB of disk for $4 a month, billed at $0.01 an hour and capped at the monthly price.

Backups and updates

pgAdmin keeps its own data, its users and the servers you registered, in /var/lib/pgadmin, which the setup script creates. Turn on automatic snapshots on the server page (hourly up to weekly, kept for 1 to 30 days) or scheduled backups (every 6 hours up to weekly, keeping 1 to 10). Your databases are on the PostgreSQL servers themselves; back those up there.

pgAdmin's repository is in the server's APT sources, so apt update && apt upgrade brings new pgAdmin releases. Take a snapshot first.

FAQ

Where do I sign in?

At /pgadmin4 on the address you forwarded to port 80, as admin@example.com with the generated password shown on the server's page.

Can pgAdmin reach a database on my computer?

Only if that database is reachable from the internet. pgAdmin runs on the server, so every connection it makes starts there, not from your browser.

Can several people share one pgAdmin?

Yes. In server mode every user signs in, and the first account, a superuser, can add other superusers and ordinary users. Each user's file storage is kept to its own folder.

What license is pgAdmin under?

pgAdmin 4 is released under the PostgreSQL Licence.

Which VeloxaHost size fits pgAdmin?

The recommended 1 vCPU and 1 GB of RAM is a Veloxa Nano: 1 vCPU, 1 GB RAM and 25 GB of disk for $4 a month, billed at $0.01 an hour and capped at that price.