Traefik Docker Labels Generator
Generate Traefik v3 Docker Compose labels for a router with a host rule, TLS through a certificate resolver, an HTTPS redirect, security headers, prefix stripping and basic auth.
Free · No sign-up · Your inputs stay in your browser
Input
Generate Traefik Docker labels
Output
compose.yaml labels
1,043 characters
Assumes Traefik v3 runs with entrypoints named web (:80) and websecure (:443), a certificate resolver of the same name, and a shared external network called proxy. The loadbalancer port label is what lets Traefik reach a container that exposes several ports, or none.
Runs in this browser. Nothing you paste is sent to a server.
About this tool
Method, assumptions, practical next steps, and limits.
How Traefik finds the container
Traefik's Docker provider watches the Docker API and builds routes from container labels, so adding a service is a label change rather than a proxy config change. The container and Traefik must share a network, and loadbalancer.server.port tells Traefik which port to use when the container exposes several. See the Docker provider routing reference.
Dollar signs in Compose
Basic auth hashes from htpasswd contain $ characters, and Compose treats $ as the start of a variable. Each one has to be doubled to $$ in the YAML, which the generator does.