Analytics cookies only (Google Analytics, PostHog). No ad networks, no cross-site tracking. See our privacy policy.
Pg
Self-host pgweb
updated Oct 2026deployed by usprices checked · Jul 2026Install verified on Ubuntu 26.04 · Oct 2026 · how we test
We earn commissions when you shop through the links below. Full disclosure →
A small PostgreSQL browser that runs as a single Go binary: connect to a database, browse tables and schemas, run queries, view results and export tables and query results to CSV, JSON or XML. It keeps a query history and server bookmarks, supports SSH tunnels and can hold several database sessions.
Runs on a VPS from $4/mo (Kamatera 1GB, 1 GB RAM) · prices checked Sep 2026
Our recommendation
Pick pgweb when you only need to look at a PostgreSQL database in a browser, not administer a server. It is a single Go binary, works with PostgreSQL 9.6 and newer, and lets you browse tables and schemas, run SQL, keep a query history, export tables and query results to CSV, JSON or XML, open an SSH tunnel to the database and save server bookmarks; `--sessions` allows several database sessions and `--readonly` runs the connection in read-only mode. It is MIT-licensed. Our snippet is a Compose file with the Docker Hub image pinned to a release tag and a throwaway PostgreSQL, with HTTP basic auth switched on. We did not find an upstream RAM minimum, so our 64 MB floor is an estimate. pgAdmin is the full administration tool and CloudBeaver and Adminer cover more engines.
What you need
Any VPS with at least 64 MB of RAM
A domain you control — most self-hosted setups need HTTPS in front of them
pgweb's command-line options and README flag these before you point it at real data:
non-negotiablepgweb's own default is to bind to localhost (--bind); the Docker image listens on all interfaces, so our compose publishes it. Access control is optional: we set PGWEB_AUTH_USER and PGWEB_AUTH_PASS for HTTP basic auth (the page answers 401 without them), the README does not cover authentication, and port 8081 is plain HTTP, so add TLS with a reverse proxy.
non-negotiableThe database connection comes from PGWEB_DATABASE_URL. Ours connects as the postgres superuser with sslmode=disable on the Compose network; for a real database use a least-privilege role, turn on --readonly if you only browse, and enable TLS for any connection that leaves the host.
non-negotiableThe README mentions Docker only for its test suite and does not document the container; the image is published on Docker Hub as sosedoff/pgweb, and we pin 0.17.0 (released 2025-11-22). Our first run of this snippet restarted pgweb three times because it started before PostgreSQL accepted connections, so the final snippet waits for the database health check.
non-negotiableThe PostgreSQL container exists only so there is something to connect to; its data sits in the db_data volume and both passwords are generated into .env.