You’ve got Nextcloud on port 8080, Jellyfin on 8096, and Vaultwarden on yet another port. Remembering all those numbers — and typing them on your phone — gets old fast. A reverse proxy fixes this: one entry point, clean URLs, and HTTPS on everything.
This guide shows you how to use Caddy, the simplest reverse proxy there is. It’s the missing piece that turns a pile of services into a proper, polished homelab.
What is a reverse proxy?
A reverse proxy sits in front of your services and routes incoming requests to the right one. When you visit https://nextcloud.example.com, the proxy sees “nextcloud” and forwards the request to the Nextcloud container. Your services stay on their internal ports; the proxy is the single public face.
Why Caddy?
Most people reach for Nginx, but Caddy is the better starting point for a homelab:
- Automatic HTTPS. Caddy obtains and renews TLS certificates for you, with zero config.
- Tiny config. Most setups are two or three lines.
- Built-in security defaults. Sensible headers and modern TLS out of the box.
If you’ve ever wrestled with certbot, Caddy feels like cheating.
Install Caddy
sudo apt install -y caddy
That’s it. Caddy runs as a systemd service automatically. Its config lives at /etc/caddy/Caddyfile.
Your first reverse proxy
Point a subdomain at your server, then add this to the Caddyfile:
nextcloud.example.com {
reverse_proxy localhost:8080
}
Reload with sudo systemctl reload caddy, and Caddy handles the certificate and serves Nextcloud at https://nextcloud.example.com. That’s the entire config.
Multiple services with subdomains
Add one block per service, each on its own subdomain:
nextcloud.example.com {
reverse_proxy localhost:8080
}
jellyfin.example.com {
reverse_proxy localhost:8096
}
vault.example.com {
reverse_proxy localhost:8080
}
One file, one entry point, HTTPS everywhere. This is the pattern behind our guides to Nextcloud, Jellyfin, and Vaultwarden.
Add headers and compression
A little polish goes a long way:
nextcloud.example.com {
reverse_proxy localhost:8080
encode zstd gzip
header {
X-Content-Type-Options nosniff
Referrer-Policy strict-origin-when-cross-origin
}
}
Compression shrinks responses; the headers harden your site slightly.
Reverse proxy vs exposing ports directly
The alternative — mapping every service to a public port — is messy and insecure. A reverse proxy gives you:
- One port (443) for everything.
- HTTPS on all services, even ones that don’t support it natively.
- Centralized logging and security.
For any homelab with more than one service, a reverse proxy is non-negotiable.
Caddyfile basics
The Caddyfile is refreshingly simple. Each site is a block with a hostname and a list of directives:
example.com {
root * /var/www/html
file_server
}
That two-line config serves a static site with automatic HTTPS. For a reverse proxy, you swap file_server for reverse_proxy. There’s no separate virtual-host config, no listen directives, and no manual cert management — Caddy infers all of it.
WebSockets and streaming services
Some services need more than a simple HTTP forward. Media servers and real-time apps rely on WebSockets and long-lived connections. The good news: Caddy’s reverse_proxy handles WebSockets automatically, no extra config.
For Jellyfin and similar streaming apps, the default reverse proxy “just works” — streaming, seeking, and live playback all pass through cleanly.
Rate limiting and basic security
Once a service is public, a little hardening is wise. Caddy can throttle requests with a one-line rate limit:
example.com {
reverse_proxy localhost:8080
rate_limit {
zone dynamic 10 requests 1s
}
}
Combine that with Caddy’s default TLS and the security headers from earlier, and you’ve covered the basics without turning your homelab into a firewall administration project.
Caddy vs Nginx: which should you pick?
Nginx is the battle-tested giant powering a huge slice of the internet. Caddy is the friendly newcomer with batteries included. For a homelab, Caddy wins on ease: automatic HTTPS with no certbot cron jobs, a config you can read at a glance, and sensible security defaults. Nginx still wins for ultra-high-traffic production and when you need its deep module ecosystem.
For the vast majority of self-hosters, the answer is Caddy. If you ever outgrow it, the concepts — virtual hosts, proxying, TLS — transfer directly to Nginx, so you lose nothing by starting simple.
Running Caddy in Docker vs on the host
Both work, and the choice is mostly preference. Running Caddy directly on the host via the system package is the simplest option, and it sidesteps a subtle chicken-and-egg problem: if your proxy runs in Docker, restarting Docker briefly takes down the public face of every service behind it.
Some people prefer Caddy in Docker for consistency with the rest of their stack. Either way, the Caddyfile is identical. If you’re just getting started, use the host package — it’s one less layer to think about.
Wildcard certificates and DNS challenges
By default, Caddy uses HTTP challenges to issue certificates. For a wildcard certificate (covering *.example.com), you use a DNS challenge instead — Caddy needs API access to your DNS provider to prove ownership. Most popular providers are supported with a couple of lines:
*.example.com {
tls {
dns cloudflare {env.CLOUDFLARE_API_TOKEN}
}
}
For most homelabs, individual certs per subdomain are simpler and sufficient. Reach for wildcards only if you spin up subdomains frequently.
Common mistakes to avoid
- Using IP addresses instead of subdomains — you’ll hit certificate warnings and confusing config.
- Forgetting to reload after editing the Caddyfile.
- Pointing two subdomains at the same service by accident.
FAQ
Is Caddy really easier than Nginx?
Yes, dramatically. Automatic HTTPS alone removes the most painful part of Nginx setup.
Do I need a domain name?
For clean URLs and HTTPS, yes — but a cheap domain is well worth the $10/year.
Can Caddy run in Docker?
Absolutely, but running it directly on the host (or as the system package) is simpler for a homelab.
The bottom line
Caddy is the fastest way to give every self-hosted service a clean URL and automatic HTTPS. Once it’s set up, adding a new service is three lines of config — and your homelab finally feels like the professional setup it deserves.