Self-host PostgreSQL with pgweb with Levelrail

A PostgreSQL 17 server paired with the pgweb browser console, already wired together. The database is not published on the host, so other services in this project reach it at db:5432. pgweb opens straight into the database with the generated credentials, so keep its address private.

  • Authorsosedoff
  • LicenceMIT
  • Memory384 MiB
  • Services2

How to self-host PostgreSQL with pgweb

  1. Pull the images

    2 images are pulled on your server.

    Show images
    • postgres:17.11-alpine
    • sosedoff/pgweb:0.17.0
  2. Create the app

    2 services start in a single Compose app, with 1 named volume mount for your data, on port 8081.

  3. Fill in the secrets

    2 secrets are generated and stored encrypted, you do not have to fill in anything.

  4. Open it

    Without a domain the app gets an sslip.io address; add --domain SERVICE=HOST to use your own.

After the first start

  • Open the page, the console is already connected to the bundled database.

PostgreSQL with pgweb requirements

Memory
About 384 MiB
Architectures
amd64 unknown, arm64 unknown
Ports
8081
Domain
Optional, an sslip.io address is used without one
Settings
none to fill in
License
MIT, permissive license
  • Listed. It is in the catalog but not verified. Back up the data volume before changing an image tag.

Install Levelrail first

On a server with Levelrail running, run the command above, or open the dashboard: Apps, New app, Browse templates, then PostgreSQL with pgweb. New to Levelrail? Install it on a fresh VPS first.

docker pull ghcr.io/glincker/levelrail:latest

Then levelrail-cli login --device. See Getting started and the PostgreSQL with pgweb docs page.

Deploy PostgreSQL with pgweb your way

Every format below deploys the same pinned images. Pick the one that fits how you work.

Deploy PostgreSQL with pgweb from the CLI

Add --domain SERVICE=HOST to serve a service on your own domain, for example --domain db=app.example.com.

levelrail-cli templates install postgres-pgweb --name my-postgres-pgweb

Deploy PostgreSQL with pgweb with the API

Create a token in the dashboard first. Name, env and domains are the request fields.

curl -X POST -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
  https://levelrail.example.com/api/v1/service-templates/postgres-pgweb/install \
  -d '{
    "name": "my-postgres-pgweb"
  }'

PostgreSQL with pgweb configuration

PostgreSQL with pgweb services

ServiceImagePortsVolumes
db postgres:17.11-alpine none pgdata -> /var/lib/postgresql/data
pgweb sosedoff/pgweb:0.17.0 8081 none

PostgreSQL with pgweb environment variables

VariableServiceValue
POSTGRES_PASSWORD db Generated at deploy
PGWEB_DATABASE_URL pgweb Generated at deploy

Ports and volumes

Ports
8081
Volumes
1 named mount: pgdata -> /var/lib/postgresql/data

PostgreSQL with pgweb FAQ

How much memory does PostgreSQL with pgweb need?

The catalog lists about 384 MiB of memory for PostgreSQL with pgweb across its 2 services.

Does PostgreSQL with pgweb run on arm64?

For PostgreSQL with pgweb, arm64 support is not confirmed; amd64 is unknown.

What licence is PostgreSQL with pgweb under?

PostgreSQL with pgweb is licensed under MIT, which is permissive, with few conditions on reuse.

Does PostgreSQL with pgweb need configuration before it starts?

No. The template fills in its own defaults and generates secrets at deploy time.

Which database does PostgreSQL with pgweb bundle?

The template includes Postgres, running as its own service.

Which ports does PostgreSQL with pgweb use?

PostgreSQL with pgweb listens on port 8081 inside the stack.

Where does PostgreSQL with pgweb keep its data?

In a named volume: pgdata mounted at /var/lib/postgresql/data.

Can I deploy PostgreSQL with pgweb on Dokploy or Dokku?

The services and pinned images on this page can be run on any Docker host. The public Dokploy templates list we compared does not have an entry with the same id for PostgreSQL with pgweb, so on Dokploy you would use a Docker Compose application with the file from this page. Dokku deploys container images with its own commands, so the pinned image postgres:17.11-alpine, sosedoff/pgweb:0.17.0 is what you deploy there.

levelrail-cli templates install postgres-pgweb --name my-postgres-pgweb