Discovery service


Does Caddy 2 has an auto discovery service like Traefik? Or something similar?
Perhaps it’s named differently.

I’m referring to this:

My goal is to deploy Portainer once I get Caddy2 running as load balancer and reverse proxy.
In portainer, we want to deploy applications like Wordpress, Nextcloud, etc…
In Traefik it’s very easy with the special labels to add and it auto discovers the application and routes the traffic.

I have gone through the documentation but I could not find anything clear about this topic how we could do something like this with Caddy.
Except for something called “CaddyFile”, but not sure if this is what I need.

Are there any tutorials available or Youtube series that show step by step how to setup Caddy for a few popular use cases? Like deploying Wordpress or other simple applications?
I think such information is very helpful for anybody who is just starting with these concepts.


We just merged in SRV support, is this something that could work for you?

Caddy v1 had a docker proxy plugin that does what you describe with labels:

It would need to be ported to v2 though. It would likely transform labels into Caddy JSON config instead of Caddyfile. This might be a bigger project to implement.

1 Like

For Caddy v1, we had a GitHub - caddyserver/examples: OBSOLETE. This repo was for Caddy v1. For v2 and newer, see our forum's wiki category. repo which was community maintained with all kinds of examples. We don’t have the same yet for Caddy v2 for (hopefully) obvious reasons. We do have an upgrade guide written here: Upgrading to Caddy 2 — Caddy Documentation which can be used in conjunction with examples from the repo to get something running for v2. If you can’t figure it out, don’t worry, just ask here on the forums and someone will help :slightly_smiling_face:

The Caddyfile is the most common way to configure Caddy. It’s the most user-friendly approach, because it has a very declarative syntax that mostly reads like English as to how the server will behave. In v2, the Caddyfile is adapted to JSON, which is what is internally used for configuration. You can start here to learn more about it: The Caddyfile — Caddy Documentation

1 Like

hmm very interesting repos :slight_smile:
I hope they soon come for v2. I just sent my information and feedback to Lucas to think about.

I also had a look at the example files, they look very similar to NGINX rules, so that already give me quite some confidence using Caddy won’t give much problems on that front.
I’m ok with both JSON or other syntaxes, I prefer to use the native one always or at least learn it as it makes things easier on the longer run.

The only thing I’m now left with before I can start, is figuring out how I will get everything in HA for Caddy2 with Docker in my Swarm cluster and than move forward to Portainer.
As most plugins are not ready for v2, I might have to do workaround based on HA storage instead of using KV solution.

Do you happen to know of any tutorials that can guide me step by step how to get started with Caddy?
I always like visual guides doing step by step tutorials rather than just looking at docs and lost in a million of pages.
I’m more of a practical and “do it” guy and learn it while doing things.

The Caddy v2 docs are written as a guided tour!

1 Like

This topic was automatically closed after 180 days. New replies are no longer allowed.