Operations¶
This page is organized around common operator tasks. For a complete command list, see the Command reference.
Daily checks¶
A small daily check can be:
Also open https://status.<DOMAIN> and run all service checks.
Look for:
- containers that are restarting or stopped;
- repeated DNS challenge failures;
- upstream connection errors;
- disk space pressure under
caddy-data/; - a Caddy update recommendation;
- certificate snapshot errors.
Start, stop, and restart¶
Start:
Stop without removing containers:
Restart existing containers:
Remove containers and the project network:
down is usually safer than clean because it does not intentionally remove
volumes. clean is project-scoped and does not prune unrelated Docker state.
Follow logs¶
Both services:
Only Caddy:
Only dnsmasq:
Press Ctrl+C to stop following. The service continues running.
The application also writes rotating logs to:
Add a service safely¶
- Add one entry to
upstreams.yml. - Preview the Caddyfile:
- Confirm Caddy can resolve and reach the target.
- Restart the stack:
- Follow Caddy logs and test with
curl --resolvebefore changing shared DNS. - Run the service checks in the dashboard.
Example:
If wiki is a Docker service, ensure it shares the same Compose network as Caddy.
Change an upstream address or port¶
Edit upstreams.yml, preview the generated configuration, then restart:
./caddy-docker.sh print-caddyfile >/tmp/Caddyfile
./caddy-docker.sh restart
./caddy-docker.sh logs --follow caddy
A changed upstream does not normally require rebuilding Caddy. Rebuilds are for Caddy versions or DNS provider plugins.
Change the DNS provider¶
- Create a restricted token at the new provider.
- Update
DNS_PROVIDER,DNS_TOKEN, and when necessaryCADDY_DNS_PLUGIN_TOKEN_FIELD. - Force a plugin rebuild:
- Validate the generated Caddyfile.
- Watch DNS-01 challenge logs closely.
- Revoke the old provider token after the migration is verified.
Changing providers is a security-sensitive operation because both old and new tokens may remain valid during the transition.
Pin or upgrade Caddy¶
Check current state:
Set an explicit version in .env:
Then restart or rebuild:
The wrapper runs a build-only operation. The temporary binary must be executable, contain the exact configured DNS module, and match the requested version before it can replace the active file. When Caddy is already running, the wrapper restarts only the Caddy service after successful installation. A failed validation leaves the previous binary and running process untouched.
After an upgrade:
Test every important route, not only the dashboard.
Reload dnsmasq¶
After changing wildcard DNS target settings:
Confirm from a client that uses this dnsmasq instance:
Replace the hostname and DNS server address.
If the result is wrong, inspect:
Export and distribute the internal CA¶
Caddy must initialize its internal PKI before export files exist.
Export:
Generated public trust files appear below:
Inspect the certificate:
openssl x509 \
-in caddy-data/exported-certs/caddy-internal-ca.pem \
-noout -subject -issuer -dates -fingerprint -sha256
Distribute only the public CA certificate. Never distribute a private CA key.
The generated endpoint also serves the public files:
https://internal-ca.<DOMAIN>/cert/caddy-internal-ca.pem
https://internal-ca.<DOMAIN>/cert/caddy-internal-ca.crt
Protect access according to your network policy even though root CA certificates are public trust material.
Back up runtime state¶
Important state is under caddy-data/. Back it up while preserving permissions.
Example local archive:
Store backups away from the host and protect them as sensitive because runtime data may contain private keys and service certificates.
Also back up application volumes independently. certify-reverse does not back up WordPress, databases, or other upstream data.
Restore runtime state¶
- Stop the stack:
- Move the current directory aside rather than deleting it:
- Extract the backup in the repository root.
- Check ownership and permissions.
- Start and inspect logs:
- Test routes and certificate behavior before deleting the pre-restore copy.
Inspect generated state¶
Redacted configuration plus generated-file summary:
Generated files and logs:
Inside the container:
Use the shell for diagnosis, not permanent manual changes. Generated files can be replaced on restart.
Emergency Caddyfile override¶
If caddy-data/Caddyfile.overwrite exists, certify-reverse starts Caddy with it
instead of the generated Caddyfile.
Use this only for a controlled emergency:
- copy the generated file;
- make the smallest change;
- validate it with Caddy;
- document why the override exists;
- remove it after moving the change into supported configuration.
An old override creates configuration drift because later upstreams.yml changes do
not affect the active runtime file.
Rotate a DNS token¶
- Create the new restricted token.
- Replace
DNS_TOKENin.env. - Restart the stack.
- Force a certificate-related operation or observe a normal renewal path.
- Confirm DNS API operations succeed.
- Revoke the old token.
- Check shell history, backups, and operator notes for accidental copies.
The dashboard does not reveal the configured token.
Release verification¶
Run the complete gate:
It checks:
- synchronized package versions;
- frozen Python dependency resolution;
- unit, regression, and Compose integration tests;
- Ruff and Mypy;
- wheel and source-distribution creation;
- shell syntax;
- base and Caddyfile-print Compose configurations;
- generated Caddyfile validation;
- static site, HTML handbook, PDF handbook, man pages, manifest, and docs archive.
Build and preview documentation¶
See Documentation publishing for renderer pins and output details.
Maintenance checklist¶
Weekly¶
- inspect logs for repeated warnings;
- run dashboard service checks;
- confirm backups completed;
- inspect disk usage;
- check Caddy updates.
Monthly¶
- restore one backup into a test location;
- review DNS provider tokens and operator access;
- inspect certificate expiration data;
- update pinned documentation dependencies when needed;
- run the full release gate on the current main branch.
Before any major change¶
- save redacted configuration output;
- back up
caddy-data/and upstream data; - record the current commit and Caddy version;
- validate the rollback path;
- change one layer at a time.