Docker + Traefik: A Simple Self-Hosting Setup for Client Projects
For client projects too small to justify a managed platform's monthly cost, but real enough to need proper HTTPS, uptime, and the ability to host multiple sites on one box, Docker plus Traefik became my default self-hosting setup.
Why Traefik specifically, over Nginx
Traefik discovers services automatically from Docker labels — no manually maintained config file that drifts from what's actually running. Add a new container with the right labels, and Traefik picks up the routing rule, including automatic HTTPS via Let's Encrypt, with zero separate certbot setup. For a box hosting several small client sites that come and go, that auto-discovery is the entire reason to prefer it over hand-written Nginx config.
The shape of the setup
One Traefik container as the entrypoint, listening on 80/443, with Let's Encrypt configured for automatic certificate issuance and renewal. Every client site is its own Docker Compose stack, on its own internal Docker network, with labels telling Traefik which hostname routes to it. Adding a new client site is: write its Compose file, add the routing labels, docker compose up -d — no touching the Traefik config at all.
labels:
- "traefik.http.routers.clientsite.rule=Host(`clientsite.com`)"
- "traefik.http.routers.clientsite.tls.certresolver=letsencrypt"
What this setup is honestly not good for
High-traffic sites that need genuine horizontal scaling across machines, or clients who need strict compliance guarantees a managed platform provides out of the box (SOC 2, specific data residency). This is a "small client site, real hosting, minimal monthly cost" solution — not a replacement for a proper cloud platform once a project outgrows a single box.
The maintenance cost that's easy to underestimate
You're now responsible for OS updates, Docker updates, disk space monitoring, and backup strategy — all things a managed platform would otherwise handle. For one or two client sites that's a manageable, occasional chore. For a dozen, it starts to become a part-time job, and that's the point where migrating some clients to a managed platform becomes the better trade.
Takeaway
Docker + Traefik gets small client projects real HTTPS, real uptime, and near-zero ongoing hosting cost, with a setup that scales from one site to a handful without much added complexity. It stops being the right call once you're either hosting at meaningful traffic or hosting enough sites that server maintenance becomes its own job.