Self Host Wizard Docs

Shared PostgreSQL (postgres)

Shared PostgreSQL on a Self Host Wizard box: the postgres piece, internal only, none sign-in, memory limit 241 MB.

At a glance

FieldValue
Addressnot on the web (reached only by the pieces that need it)
Sign-innone: no office sign-in in front of it
Memory limit241 MB (ram_mb: measured peak × 1.3)
Databasenone shared: it keeps its own data in THX_DATA
Needsnothing
Needed byglitchtip, listmonk, umami
Containerspostgres
Image: postgrespostgres:18.7-trixie@sha256:c699303802144847d238196173655dbbecf7a96aeca1565f2b02eb671a1f0b6b
Licence (from the README)PostgreSQL Licence
Upstream (from the README)https://www.postgresql.org

Turn it on

thx enable adds postgres and everything it needs to the box's state; thx apply then installs it. Apps are applied only once site_domain is set.

sudo thx enable postgres
sudo thx apply

Engineering notes (pieces/postgres/README.md)

PostgreSQL 18.7, PostgreSQL Licence. Image postgres:18.7-trixie (Docker Library), pinned by index digest sha256:c6993038…0b6b; the index has linux/arm64 (docker buildx imagetools inspect, 2026-11-24). Upstream image, unmodified.

How it is wired

  • Internal only: postgres:5432 on the thx network; no host port, no web host.
  • For each enabled piece with db = "postgres", thx apply creates database and owner <name> (- → _) with the piece's generated password; the check logs in as that user over TCP, which proves the password. The superuser password stays in /etc/thx/secrets/postgres/.
  • Sized for a 12 GB box shared by many apps: shared_buffers=128MB, max_connections=100, work_mem=4MB.
  • Data in THX_DATA (PostgreSQL 18 keeps PGDATA in a versioned subdirectory). A major upgrade (19) needs a dump/restore; the pin keeps it from happening by surprise.

Measured

RAM: measured peak 185 MiB (anon + shmem + kernel from memory.stat, sampled through the whole check.sh docker stage including a 10-client database load; 512 MiB with page cache) × 1.3 = ram_mb 241, mem_limit 241m. Measured 2026-11-25, e2e run 6.

Known gaps

  • No backups here (the backup lane's job). No connection pooler.

Facts on this page come from these files in the selfhostwizard repository:

  • pieces/postgres/piece.toml
  • pieces/postgres/compose.yaml
  • pieces/postgres/README.md
  • internal/piece/piece.go

This page is generated from the code at build time, so it changes when the code does.