Pgweb Quickstart

This quickstart guide will help you get pgweb up and running with Container Apps on Crunchy Bridge. We recommend you start with the Container Apps Quickstart to get a general understanding of Container Apps.

About pgweb

From the pgweb project:

Pgweb is a web-based database browser for PostgreSQL, written in Go and works on OSX, Linux and Windows machines. Main idea behind using Go for backend development is to utilize ability of the compiler to produce zero-dependency binaries for multiple platforms. Pgweb was created as an attempt to build very simple and portable application to work with local or remote PostgreSQL databases.

Pgweb with Container Apps Quickstart

First, make sure you have Container Apps enabled. As a user with superuser privileges, run CREATE EXTENSION pgpodman; to install the extension in the postgres database of the desired cluster.

Next, find your cluster’s database URL to include as the DATABASE_URL parameter when you run the container. You can find the URL in the Connection section of the cluster dashboard (choose the application role), or by running cb uri --role application <cluster name> on the command line.

To start your Pgweb browser, run the following using your own value for DATABASE_URL:

SELECT run_container('-dt -p 5433:8081/tcp -e DATABASE_URL="your-database-URL" docker.io/sosedoff/pgweb');

Now you can visit your running Pgweb at your-host-URL:5433. You can find your Host URL in the Overview section of your cluster dashboard, or by running cb info <cluster name>.