Install with Docker Compose
This page takes you from an empty server to a running Gophenberg. You need Docker with Compose, and a reverse proxy in front holding your HTTPS certificate, such as Caddy, Traefik, or nginx.
1. The compose file
Section titled “1. The compose file”Create a directory on your server with this compose.yaml:
services: db: image: postgres:18 environment: POSTGRES_DB: gophenberg POSTGRES_PASSWORD: change-me volumes: - db-data:/var/lib/postgresql healthcheck: test: ["CMD-SHELL", "pg_isready -U postgres"] interval: 2s timeout: 2s retries: 15
gophenberg: image: ghcr.io/gopherium/gophenberg:0.3.0 restart: unless-stopped environment: GOPHENBERG_DATABASE_URL: postgres://postgres:change-me@db:5432/gophenberg?sslmode=disable GOPHENBERG_SITE_TITLE: My Site GOPHENBERG_TRUSTED_PROXIES: 172.16.0.0/12 volumes: - themes:/themes - media:/media ports: - "127.0.0.1:8081:8081" depends_on: db: condition: service_healthy
volumes: db-data: themes: media:Three values to change:
- The password, in both places it appears.
- The image tag. Pin the newest version from the
tags page, never
latest. GOPHENBERG_TRUSTED_PROXIES, the network your proxy connects from, in CIDR notation. The value above fits a proxy in Docker and a proxy on the host, which reaches the container through the same Docker bridge.
The healthcheck and the condition keep Gophenberg from starting
before the database is ready on first boot. The themes volume is
where themes you upload in the admin are kept, so it has to stay
writable.
2. Start it and create your login
Section titled “2. Start it and create your login”docker compose up -ddocker compose run --rm -T gophenberg \ createadmin -email admin@example.com -name "Maria Perez"Migrations run at startup, so there is no setup step.
createadmin waits for you to type the password, keeping it out
of your shell history.
3. Point your proxy at it
Section titled “3. Point your proxy at it”Forward your domain to 127.0.0.1:8081. With Caddy:
example.com { reverse_proxy 127.0.0.1:8081}4. Check it works
Section titled “4. Check it works”- Your domain shows the public site.
curl -sI https://example.com | grep -i x-generatoranswers withGophenberg 0.3. The-imatters, HTTP/2 lowercases header names./admin/loads and your login works.
From here: configuration lists every setting, and installing a theme changes how the site looks.