Secrets Management for Self-Hosted Apps
Hardcoded passwords and API keys in config files are a security disaster. Proper secrets management keeps your infrastructure safe.
The Problem
Secrets are everywhere in self-hosted apps: database passwords, API keys, JWT secrets, SMTP credentials. Where do you put them?
What NOT to Do
Environment Variables
The simplest approach and sufficient for most self-hosters.
How It Works
Pass secrets as environment variables to containers. They're never stored in the image or source code.
docker run -e DATABASE_URL=postgres://... -e JWT_SECRET=... myapp
Or with docker-compose / podman:
environment:
Best Practices
Secret Stores
For more advanced setups:
HashiCorp Vault
Enterprise-grade secret management. Secrets are encrypted at rest, access is audited, and secrets can auto-rotate.
Infisical
Open-source alternative. Self-hostable (naturally). Dashboard for managing secrets across environments.
SOPS (Secrets OPerationS)
Encrypt secret files with age, GPG, or cloud KMS. Store encrypted files in git safely.
Secret Rotation
Secrets should be rotated periodically:
TinyPod Secrets
TinyPod stores your environment variables encrypted and injects them at container runtime. You manage secrets through the dashboard — they never appear in logs or container definitions.