Pgadmin

The web-based administration tool for PostgreSQL: browse schemas, run queries and manage roles

pgAdmin on Cubeship

pgAdmin is the web-based administration tool for PostgreSQL: browse schemas, run queries, and manage roles and backups from the browser.

This template installs it on a Cubeship instance, with a volume for everything pgAdmin keeps.

What it creates

  • pgadmin — pgAdmin, from dpage/pgadmin4:9.17, answering on the domain you choose, with a volume at /var/lib/pgadmin: accounts, saved servers, preferences, sessions and the files you upload.

It needs Cubeship 0.7.0 or newer.

What you are asked

InputWhat to give
Where pgAdmin answersA domain you control, pointed at your instance.
The email you sign in withA real address. pgAdmin refuses special-use domains like example.com or .local.
The password you sign in withNothing — the instance generates it and shows it once. Keep a copy.

After installing

  1. Open the domain and sign in with the email and the generated password.
  2. Change the password under your account → Change Password.
  3. Register → Server for each database. A database on the same instance answers at its internal host, cubeship-db-<name>, on port 5432; its credentials are on its page in the dashboard.

The email and password only create the first account. Changing the variables afterwards changes nothing.

The volume

The app runs as one copy on the machine its volume is on, and a deploy stops it for a few seconds. Back the volume up from the app's settings: pgAdmin's saved server passwords are in it.

Resources

The app is limited to 1 CPU and 1 GiB of memory. Raise limits in template.yaml if you need more.

What this creates

pgadmin

dpage/pgadmin4:9.17

/var/lib/pgadmin

Volume of pgadmin

template.yaml
# yaml-language-server: $schema=https://cubeship.dev/schema/template/v1.json
version: 1
# The first release that gives a volume to the user its image runs as;
# pgAdmin runs as 5050 and cannot write to one owned by root.
minCubeship: "0.7.0"
project: pgadmin

inputs:
  - key: domain
    type: domain
    label: Where pgAdmin answers
  - key: email
    type: text
    label: The email you sign in with
    help: pgAdmin refuses special-use domains, like example.com or anything ending in .local.
    pattern: ^[^@\s]+@[^@\s]+\.[^@\s]+$
  - key: password
    type: secret
    label: The password you sign in with
    generate: 24

apps:
  - key: web
    name: pgadmin
    image: dpage/pgadmin4
    tag: "9.17"
    port: 80
    health: /misc/ping
    domains:
      - host: ${input.domain}
    volumes:
      - path: /var/lib/pgadmin
    limits: { cpu: 1, memory: 1Gi }
    env:
      PGADMIN_DEFAULT_EMAIL: ${input.email}
      PGADMIN_DEFAULT_PASSWORD: ${input.password}