Skip to main content
The full configuration reference is in the Self-Hosted Configuration page. This page is a quick-reference index of every key.

Top-level keys

server

storage

database

server_tls

acme

dns

call_home

Environment variable overrides

These environment variables always win over the YAML file:
Never store database passwords, storage keys, or proxy passwords in config.yaml, and don’t put them in the systemd unit itself: unit files and systemctl show are readable by every local user. Put them in a file only root can read and reference it from a drop-in:
Keep a copy of the key somewhere safe outside the server. Without it, encrypted keys, credentials and backups can’t be recovered.

Rotating the storage key

You can replace the storage key without downtime. CertGov keeps accepting the old key while it re-encrypts everything with the new one. One server:
  1. Generate a new key: certforge storage-key generate. Save a copy somewhere safe.
  2. In the key file, make the new key CERTFORGE_STORAGE_KEY and set CERTFORGE_STORAGE_KEY_PREVIOUS to the old key.
  3. Restart CertGov. At startup it re-encrypts every value still on the old key and logs [storage-key] re-encrypted ….
  4. Check that nothing is left: certforge storage-key status (with the same environment and DATABASE_URL) should report 0 value(s) on a previous key, 0 unreadable.
  5. Remove CERTFORGE_STORAGE_KEY_PREVIOUS and restart.
Several servers sharing one database: add one step first, so that servers still on the old key can read what an upgraded one writes:
  1. On every server, set CERTFORGE_STORAGE_KEY_NEXT to the new key, and restart them one at a time.
  2. On every server, make the new key current, move the old one to CERTFORGE_STORAGE_KEY_PREVIOUS, remove _NEXT, and restart them one at a time.
  3. Continue from step 4 above, on every server.
Backup files are encrypted with the key that was current when they were made, and rotation doesn’t rewrite them. Keep the old key while you still need those backups: restore accepts any key in CERTFORGE_STORAGE_KEY_PREVIOUS, and certforge decrypt-backup does too.
See Full Configuration Reference → for complete examples.