I Turned My Self-Hosting Setup Into 20 Battle-Tested Docker Compose Templates
Every self-hoster I know has the same ritual: you find a cool project, you spend an evening fighting docker-compose.yml, and by midnight you're reading GitHub issues from 2019 to figure out why the healthcheck isn't working.
I've been running production-ish self-hosted stacks for years — reverse proxies, databases, monitoring, logging, VPNs, and a dozen app containers in between. Over time I accumulated compose files that actually work. Not "works on my machine" work. Works-after-a-reboot, survives-an-upgrade, has-a-healthcheck, keeps-your-data-in-a-volume work.
Earlier this year I finally sat down, cleaned up the whole pile, and standardized them into a playbook: 20 production-grade docker-compose templates, each with an .env.example and a deployment checklist.
Here's what's inside, and why each one earns its place.
The foundation layer
01 - Caddy reverse proxy and 02 - Nginx reverse proxy. Both configured with sensible defaults: automatic HTTPS, sane timeouts, and a structure that makes adding a new site a 3-line change. Caddy when you want zero-friction TLS, Nginx when you need fine-grained control.
17 - Traefik edge router — the third option, for people who want label-driven routing and Let's Encrypt built into the orchestration layer.
The data layer
04 - PostgreSQL primary-replica — streaming replication with a healthcheck that actually tells you when the replica has fallen behind, not just when the container is alive.
05 - Redis Sentinel — three nodes, quorum config, and the sentinel healthchecks that catch failover states.
06 - MinIO S3 — self-hosted S3 with a clean bucket policy and TLS via your reverse proxy.
The observability layer
07 - Prometheus + Grafana — scrape configs for the common exporters, dashboards that render immediately, and alert rules that don't fire at 3am for no reason.
08 - Elastic logging stack (Vector → OpenSearch) — shipping container logs to a searchable store, with the retention/rollover config pre-baked.
15 - Grafana + Loki — the lighter alternative when you want logs without running a full Elastic stack.
The app layer
09 - Gitea — lightweight Git hosting with a compose file that survives docker compose up -d --force-recreate.
10 - Nextcloud — the "everyone's homelab needs one" container, with cron-based background jobs so previews don't break after a week.
11 - Uptime Kuma — uptime monitoring with the notification channels pre-configured.
12 - Vaultwarden — password manager, with the volume mapping that actually persists correctly across updates.
13 - n8n — workflow automation, with the right user permissions so the container doesn't run as root.
14 - MediaWiki — the classic, containerized properly.
16 - WireGuard — full VPN stack with the peer config generated and documented.
18 - Portainer — manage the whole thing from a UI, with the agent socket mounted read-only the way it should be.
19 - Ghost CMS — the blog platform, with MySQL sidecar and the mail config that makes newsletter signups work.
20 - Matrix Synapse — the heavy one, with the config file template that took me the longest to get right.
Why a playbook instead of "just clone my repo"
Three reasons:
Context. Each template ships with a CHECKLIST.md — the deployment order, the gotchas (like "create the volume before the first
upor the init script will own it as root"), and how to verify it's actually healthy..env.exampleeverywhere. No hardcoded passwords, no "change this in three places" — every secret goes through environment variables with a documented example file.Healthchecks that matter. Every service has a
healthcheckblock tuned to what the service actually exposes, sodocker compose pstells you the truth.
Steal it
The full pack is on Gumroad: Docker Deployment Playbook - 20 Production Templates — $19, one-time, instant download. Every template is MIT-style re-usable for your own projects (personal or commercial), and you get the zipped set with all 20 CHECKLISTs.
I honestly believe 90% of the value is just not having to re-learn the same 15 footguns every time you spin up a new service. This is that knowledge, packaged.
If you'd rather DIY: the list above is your roadmap. Start with Caddy + one app + Uptime Kuma, and build out from there.
Happy self-hosting.
Top comments (0)