How do I connect Caddy to Jellyfin in Docker?

August 4, 2026 3 answers
Asked by segfault!v3
I'm trying to use Caddy as a reverse proxy for Jellyfin, but requests never reach the Jellyfin page. My Caddy container publishes ports 80 and 443 and mounts its configuration, data, and site directories. The Caddyfile currently contains: jellyfin.local { reverse_proxy jellyfin:8096 } I also tried using localhost:8096 as the upstream, but neither HTTP nor HTTPS works in the browser. Caddy appears to be reading the Caddyfile because the changes show up in its autosave.json, so I'm unsure whether the problem is Docker networking, hostname resolution, or the local domain itself. I eventually want to configure several reverse proxies, but I'm trying to get Jellyfin working first.

Answers

CanalLockFan
Caddy and Jellyfin need to share a Docker network. The hostname `jellyfin` is resolved through Dockerโ€™s internal DNS, but that only works when both containers are attached to the same network. You can create a shared external network and attach each stack to it, rather than putting every service into one huge Compose file. For example, create the network once with `docker network create proxy`, then add this to both Compose files: networks: proxy: external: true Attach both services to it with `networks: - proxy`. You generally only need to publish ports 80 and 443 from Caddy; Jellyfin does not need to expose its port to the host.

segfault!v3: I didnโ€™t realize separate Compose files could use the same network. Iโ€™ve been putting everything into one compose file, so Iโ€™ll try the external network approach.

Reply to this answer
OneMoreParagraph
For a local-only name, explicitly use HTTP first so certificate provisioning is not another variable: http://jellyfin.local { reverse_proxy jellyfin:8096 } Once networking and name resolution work, you can decide whether to use Caddyโ€™s internal certificates or a real domain. If you keep HTTPS enabled locally, the browser may warn because the certificate is not trusted until you install the local CA certificate.

polka.dot.fabric: The hostname has two separate jobs here: the browser must resolve `jellyfin.local` to the Docker host, while Caddy must resolve `jellyfin` to the Jellyfin container. Fixing only one of those will still leave the proxy unusable.

Reply to this answer
Vapor7
`localhost:8096` will not point to Jellyfin from inside the Caddy container. In that context, localhost means the Caddy container itself. Use `jellyfin:8096` after placing both containers on the shared network. Also make sure `jellyfin.local` resolves on the client machine to the Docker hostโ€™s IP, using local DNS or a hosts-file entry. You can test the upstream directly with `docker exec caddy curl -v http://jellyfin:8096`.
Reply to this answer

Add your answer

Answers are reviewed before publication.

Related Discussions