Traefik
Avoid common Traefik mistakes — router priority, TLS configuration, Docker labels syntax, and middleware ordering.
by clawic★ 23 GitHub stars
Install Traefik in Claude Code & Claude Desktop
Sign up to install this skill
Create a free account to reveal the install command and save the skill to your library.
- Reveal the one-line install command
- Save skills to your synced library
- Get notified when skills update
About this skill
Router Basics
- Router must have
ruleANDservice— missing either = not working - Rule priority: longer rules win by default — explicit
priorityto override Host()is case-insensitive —Host(\example.com`)` matches Example.com- Multiple hosts:
Host(\a.com`) || Host(`b.com`)` — OR logic
Docker Labels Syntax
- Labels on container, not compose service level —
deploy.labelsfor Swarm - Backticks for rules in Docker Compose —
Host(\example.com`)` with escaping - Enable per-container:
traefik.enable=true— ifexposedByDefault=false - Service name auto-generated from container — or set explicitly with
traefik.http.services.myservice.loadbalancer.server.port=80
TLS and Certificates
- EntryPoint
websecureneeds TLS config — otherwise plain HTTP on 443 - Let's Encrypt:
certificatesResolvers.myresolver.acme.emailrequired — registration fails without - HTTP challenge needs port 80 open — DNS challenge for wildcard or closed 80
tls=trueon router activates TLS —tls.certresolver=myresolverfor auto-cert- Staging ACME for testing —
caServerto staging URL, avoids rate limits
EntryPoints
- Define in static config —
--entrypoints.web.address=:80 - Redirect HTTP to HTTPS at entrypoint level — cleaner than per-router middleware
- Router binds to entrypoint with
entryPoints=web,websecure— comma-separated list
Middlewares
- Chain order matters — first middleware wraps all following
- Middleware defined once, used by many routers —
middlewares=auth,compress - Common:
stripPrefix,redirectScheme,basicAuth,rateLimit - BasicAuth: use
htpasswdformat — escape$in Docker Compose with$$
Service Configuration
loadbalancer.server.portwhen container exposes multiple — Traefik can't guess- Health check:
healthcheck.path=/health— removes unhealthy from rotation - Sticky sessions:
loadbalancer.sticky.cookie.name=srv_id— for stateful apps
Common Mistakes
- Router without entryPoint — defaults may not be what you expect
- Forgetting
traefik.docker.networkwith multiple networks — Traefik picks wrong one - ACME storage not persisted — certificates regenerated, hits rate limit
- Dashboard exposed without auth —
api.insecure=trueis dangerous in production - PathPrefix without StripPrefix — backend receives full path, may 404
- Services on different ports — each needs explicit port label
File Provider
watch=truefor hot reload — otherwise restart Traefik on changes- Can coexist with Docker provider — useful for external services
- Define routers, services, middlewares in YAML — same concepts as labels
Debugging
--log.level=DEBUGfor troubleshooting — verbose but helpful- Dashboard shows routers, services, middlewares — verify configuration
--api.insecure=truefor local dev only — secure with auth in production
Allowed tools
Tools this skill is permitted to call.
No restriction — this skill can use any tool.
Bundled files
- _meta.json
FAQ
What does the Traefik skill do?
Avoid common Traefik mistakes — router priority, TLS configuration, Docker labels syntax, and middleware ordering.
How do I install the Traefik skill?
Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.
Does the Traefik skill run scripts?
No, this skill is instructions only (SKILL.md) with no executable scripts.
Related skills
ci-review
AnthropicThe scan that the plugin's GitHub Action runs.
azure-static-web-apps
GitHubHelps create, configure, and deploy Azure Static Web Apps using the SWA CLI. Use when deploying static sites to Azure, setting up SWA local development…
ai-ready
GitHubMake any repo AI-ready — analyzes your codebase and generates AGENTS.md, copilot-instructions.md, CI workflows, issue templates, and more. Mines your PR…
aws-cdk-python-setup
GitHubSetup and initialization guide for developing AWS CDK (Cloud Development Kit) applications in Python. This skill enables users to configure environment…