- Shell 48.9%
- PHP 31%
- Dockerfile 10.3%
- Makefile 9.8%
| Dateiname | Letzte Commit-Nachricht | Letztes Commit-Datum |
|---|---|---|
| .devcontainer | ||
| .forgejo/workflows | ||
| docker | ||
| scripts | ||
| .env.example | ||
| .gitattributes | ||
| .gitignore | ||
| docker-compose.yml | ||
| LICENSE | ||
| Makefile | ||
| README.md | ||
| renovate.json | ||
webtrees in a container
webtrees as a container image plus a compose stack with MariaDB, for rootless Podman.
- Alpine + nginx + php-fpm, PHP 8.4 from Alpine packages (nothing compiled)
- every process runs as uid 33: no capabilities, read-only root filesystem, no setuid binaries
- configured from
.env, including first setup and HTTPS - scripts for backup/restore, upgrades, modules and start on boot
Images are built on Forgejo and pushed to artifacts.serk-b.de/private/webtrees,
or built locally. Started as a fork of
NathanVaughn/webtrees-docker.
Quickstart
Podman 4.7+ with podman compose, as your normal user (not root).
make init # .env from .env.example
$EDITOR .env # DB_PASS, MARIADB_ROOT_PASSWORD, WT_*, BASE_URL
make up # builds the image if missing, starts the stack
make logs
Then open http://localhost:8080. BASE_URL must be the URL you type into the
browser - webtrees redirects to it. Data lives in the volumes
webtrees_app_data, webtrees_app_modules and webtrees_db_data.
make help lists all targets.
Registry image instead of a local build - podman login artifacts.serk-b.de
once, then in .env:
WEBTREES_IMAGE=artifacts.serk-b.de/private/webtrees
WEBTREES_VERSION=2.2.6
and ./scripts/upgrade.sh.
Start on boot - make autostart installs a systemd user unit (enables
lingering, runs podman compose up -d on boot); make autostart-remove
removes it.
HTTPS
Behind a reverse proxy
Recommended for public installations (webtrees docs):
BASE_URL=https://family.example.com
HTTPS=0
BIND_ADDRESS=127.0.0.1 # reachable only through the proxy
TRUSTED_PROXIES=10.0.2.0/24 # proxy address as seen by the container
With rootless Podman the proxy appears as an internal gateway address - see
Control panel → Server information. Only set TRUSTED_PROXIES when the app
port is not reachable directly, otherwise clients can spoof their IP.
TRUSTED_HEADERS for custom client-IP headers (e.g. cf-connecting-ip).
Caddy: family.example.com { reverse_proxy 127.0.0.1:8080 }.
Directly in the container
make certs # self-signed into certs/, host from BASE_URL (or HOST=...)
Then HTTPS=1, optionally HTTPS_REDIRECT=1, BASE_URL=https://<host>:8443
and make down up. Own certificates: same paths or SSL_CERT_FILE/SSL_CERT_KEY_FILE.
The key must be readable by uid 33 (a subuid on the host): make certs sets
644; private alternative:
chmod 600 certs/webtrees.key && podman unshare chown 33:33 certs/webtrees.key.
Operations
./scripts/upgrade.sh [2.2.7] # backup, build/pull, restart (--no-backup)
./scripts/backup.sh # -> backups/<timestamp>/ while running
./scripts/restore.sh backups/<dir> # replaces data, modules and database
./scripts/install-module.sh <url|file> # --list, --remove <name>
make fix-perms # volumes back to uid 33, see below
- Upgrade:
.envis only changed once the new image exists. webtrees and MariaDB migrate their schemas on the first start of a newer version. - Backup: SQL dump, both volumes and
.env, readable only by you. SQL dumps also survive MariaDB major upgrades. Keepbackups/safe - it contains secrets. - Modules: enable them afterwards under Control panel → Modules.
- Volume permissions: Podman takes the owner from the image only for a new,
empty volume. A volume from an older image or
podman volume createbelongs to root - the container then refuses to start (data/) or module installs fail.make fix-permsfixes this once;restore.shdoes it automatically.
Configuration
All settings are in .env. Every container variable also works as
<NAME>_FILE (e.g. a secret); empty means unset.
.env |
Default | Meaning |
|---|---|---|
BASE_URL |
required | URL as typed in the browser |
WEBTREES_LANG |
en-US |
first-setup language, a folder in resources/lang (de, not de-DE) |
PRETTY_URLS |
1 |
pretty URLs |
HTTPS, HTTPS_REDIRECT |
0 |
HTTPS on 8443, optional redirect from 8080 |
HTTP_PORT, HTTPS_PORT |
8080, 8443 |
host ports; HTTPS_PORT is the redirect target |
SSL_CERT_FILE, SSL_CERT_KEY_FILE |
/certs/webtrees.{crt,key} |
relative paths: below data/ |
BIND_ADDRESS |
0.0.0.0 |
host address for the ports |
TRUSTED_PROXIES, TRUSTED_HEADERS |
- | reverse proxy |
DB_NAME, DB_USER, DB_PASS, DB_PREFIX |
webtrees, webtrees, required, wt_ |
MariaDB |
MARIADB_ROOT_PASSWORD |
required | used by the backups |
WT_USER, WT_NAME, WT_PASS, WT_EMAIL |
- | first administrator |
PHP_MEMORY_LIMIT, PHP_MAX_EXECUTION_TIME, PHP_POST_MAX_SIZE, PHP_UPLOAD_MAX_FILE_SIZE |
1024M, 90, 50M, 50M |
nginx's upload limit follows PHP_POST_MAX_SIZE |
WEBTREES_IMAGE, WEBTREES_VERSION |
localhost/webtrees, - |
image and webtrees version |
MARIADB_IMAGE, MARIADB_VERSION |
docker.io/library/mariadb, 12 |
database image |
First start (no data/config.ini.php): the container waits for the
database and runs the setup wizard with DB_*/WT_*; if a WT_* value is
missing, the wizard opens in the browser instead. Every start writes
BASE_URL, PRETTY_URLS, TRUSTED_* and DB_* into config.ini.php.
Passwords are not passed to PHP (clear_env) and don't show up in webtrees.
The image
| File | Purpose |
|---|---|
| Dockerfile | stage 1 downloads and patches webtrees, stage 2 is the Alpine runtime |
| webtrees-entrypoint | starts and supervises php-fpm + nginx |
| webtrees-init.php | config from the environment, checks, setup wizard |
| nginx, php84 | nginx rules = webtrees .htaccess; php-fpm pool, opcache |
- Only
data/andmodules_v4/are writable; nginx serves onlypublic/directly,index.phpis the only PHP entry point. - Runtime files live in
/tmp/webtrees, logs go to the container log. /healthz(php-fpm ping) works in every HTTPS mode; the healthcheck is also in compose because Podman ignores it in OCI images.- The in-app upgrade is disabled by UpgradeService.patch
(
fetchLatestVersion()returnsSite::getPreference('LATEST_WT_VERSION')). Ifcheck.ymlreports that it no longer applies, regenerate it against the new release withdiff -u. - From the old Apache image: same uid 33, so volumes keep working;
PHP_VERSION/UPGRADE_PATCH_VERSIONin.envare ignored. Only MariaDB/MySQL is supported.
Development container
.devcontainer (VS Code or devcontainer CLI with podman, on
macOS via podman machine and "dev.containers.dockerPath": "podman") has
shellcheck, yamllint, php-cli and openssl for make lint, and Claude Code
with your ~/.claude mounted (must exist on the host; on macOS log in once
inside the container with /login). VS Code copies your ~/.gitconfig. The
container has no container engine - build and run from the host terminal.
CI on Forgejo
The runner is unprivileged (no daemon, privileges, user namespaces or mknod).
| Workflow | Trigger | Does |
|---|---|---|
| check.yml | PR, branch push | lint, patch check, runtime test in Alpine (configs, nginx -t, php-fpm -t, entrypoint, /healthz) |
| release.yml | push to main changing docker/ |
next patch tag (v0.2.3 → v0.2.4) |
| image.yml | tag v*, branch push |
kaniko build and push |
| renovate.yml | Mondays | update PRs |
Renovate PR --check--> merge --release--> tag --image--> registry --> ./scripts/upgrade.sh
Image tags
| Built from | Tags |
|---|---|
tag v0.3.0 |
2.2.6 (webtrees), v0.3.0, latest, <commit> |
branch foo/bar |
br-foo-bar, br-foo-bar-<commit> - never latest/webtrees version |
To test a branch on a server: WEBTREES_VERSION=br-<branch> in .env, then
./scripts/upgrade.sh.
Releases: tags version this repository (semver). Patch releases are
automatic; minor/major: commit, make release V=0.3.0, push.
[skip release] in the commit message suppresses the automatic one.
kaniko builds the Dockerfile without privileges (Chainguard fork, free
image from kaniko-build) and clones
the repo itself; layers are cached in webtrees-cache. Because of kaniko the
Dockerfile has no VOLUME and skips /kaniko and /busybox in find.
Renovate
renovate.json tracks ARG ALPINE_IMAGE (digest updates are
merged automatically, minor updates need approval), webtrees, MariaDB (majors
need approval), the workflow images/actions and the devcontainer features.
Secrets
| Secret | Used by | Content |
|---|---|---|
AK_TOKEN, AK_USER |
image.yml | registry credentials (AK_USER may be a variable) |
RELEASE_TOKEN |
release.yml | Forgejo token, write access to the repo - tags pushed with the automatic token would not trigger image.yml |
RENOVATE_TOKEN |
renovate.yml | Forgejo token of the Renovate user |
RENOVATE_GITHUB_COM_TOKEN |
renovate.yml | read-only GitHub token |