Rock8Cloud
Databases & Storage

pgweb

Browse and query a PostgreSQL database from the browser

pgweb is a web-based PostgreSQL browser. Rock8Cloud ships it as a one-click application so you can read rows, inspect schemas and run SQL against a database that has no public address.

Databases on Rock8Cloud are network-isolated - they only accept connections from services inside the same project. pgweb runs inside the project, so it can reach the database, and you reach pgweb over its own URL.

Create a pgweb Service

  1. Click Add Service in the project that holds the database
  2. Select Application
  3. Choose pgweb
  4. Pick a version (0.15.0, 0.16.2, or 0.17.0) and keep replicas at 1
  5. Copy the generated login password
  6. Link PGWEB_DATABASE_URL to your PostgreSQL service's Connection URL
  7. Click Deploy pgweb

pgweb comes up on its own public URL and asks for the generated credentials before it loads.


Environment Variables

VariableDescriptionDefault
PGWEB_DATABASE_URLConnection string for the database pgweb browses(linked)
PGWEB_AUTH_USERLogin useradmin
PGWEB_AUTH_PASSLogin password(auto-generated)

All three are ordinary environment variables. Change the user or password in the service's Environment tab and pgweb redeploys with the new login.

Link the plain Connection URL, not the libpq-compatible variant. The libpq variant appends uselibpqcompat, a Go-specific flag that pgweb's driver rejects. Linking to the PostgreSQL service selects the right key for you.

The link is live rather than a copy, so rotating the database password does not require re-pasting anything into pgweb.


What You Can Do

TabWhat it shows
RowsTable data, with filtering
StructureColumns, types and defaults
Indexes / ConstraintsTable indexes and constraints
QueryA SQL editor, with Explain Query for a plan
HistoryStatements run in this session
ActivityWhat the database is doing right now
ConnectionThe connection pgweb is using

Result sets export as JSON, CSV or XML.


Scope and Security

  • Locked to one database - multiple sessions are disabled and the session is pinned to the linked connection, so a signed-in user cannot point pgweb at another host
  • Full write access - anyone with the login can modify data, so treat the credentials as production access
  • Public URL - the login is the only thing in front of the database. Use a strong password and rotate it from the Environment tab when someone who had it moves on
  • Stop or delete when idle - a browser you are not using is access nobody is watching. Adding it back takes a couple of minutes

Troubleshooting

pgweb fails to start or cannot connect

  • Confirm PGWEB_DATABASE_URL is linked to the plain Connection URL, not the libpq-compatible one
  • Confirm the database is in the same project as the pgweb service
  • Check the Logs tab on the pgweb service for the driver error

The browser does not ask for a login

  • PGWEB_AUTH_USER and PGWEB_AUTH_PASS must both be set. If either is missing, redeploy with both present

Sign-in is rejected

  • Check the current values in the Environment tab. The password shown on the add-service screen is only generated once, and editing the variable replaces it

On this page