Install
openclaw skills install initial-traefikInitialize and configure Traefik reverse proxy with Docker. Install Traefik, configure Docker Compose, set up service routing via path prefix or host-based r...
openclaw skills install initial-traefikInitialize and configure Traefik v3 reverse proxy with Docker Compose for service routing and load balancing.
mkdir -p ~/.docker/compose
cd ~/.docker/compose
Use assets/docker-compose.yml as template. Key configuration:
services:
traefik:
image: traefik:v3.0
container_name: traefik
ports:
- "80:80"
- "443:443"
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./traefik-dynamic.yml:/etc/traefik/dynamic.yml:ro
command:
- --api=true
- --api.dashboard=true
- --providers.docker=true
- --providers.docker.exposedbydefault=false
- --providers.file.directory=/etc/traefik
- --providers.file.watch=true
- --entrypoints.web.address=:80
- --accesslog=true
- --metrics.prometheus=true
Use assets/traefik-dynamic.yml as template for service routing.
docker compose up -d
for container in <service-names>; do
docker network connect compose_default $container
done
Access services via http://<IP>/<service>:
http:
routers:
n8n:
rule: "PathPrefix(`/n8n`)"
service: n8n
entryPoints:
- web
middlewares:
- n8n-stripprefix
middlewares:
n8n-stripprefix:
stripPrefix:
prefixes:
- /n8n
services:
n8n:
loadBalancer:
servers:
- url: "http://n8n:5678"
Access: http://192.168.9.192/n8n
Access services via http://<service>.<IP>.nip.io:
http:
routers:
n8n:
rule: "Host(`n8n.192.168.9.192.nip.io`)"
service: n8n
entryPoints:
- web
services:
n8n:
loadBalancer:
servers:
- url: "http://n8n:5678"
Access: http://n8n.192.168.9.192.nip.io
Configure routing directly in docker-compose.yml labels:
services:
traefik:
labels:
- "traefik.enable=true"
- "traefik.http.routers.dashboard.rule=Host(`traefik.192.168.9.192.nip.io`)"
- "traefik.http.routers.dashboard.service=api@internal"
- "traefik.http.routers.dashboard.entrypoints=web"
See references/features.md for complete feature list and configuration.
Connect container to network:
docker network connect compose_default <container-name>
Add router to traefik-dynamic.yml:
routers:
myservice:
rule: "PathPrefix(`/myservice`)"
service: myservice
entryPoints:
- web
middlewares:
- myservice-stripprefix
services:
myservice:
loadBalancer:
servers:
- url: "http://<container-name>:<port>"
Traefik auto-reloads configuration.
docker logs traefik | grep -E "router|error"
docker exec traefik wget -q -O - http://localhost:8080/api/http/routers
docker restart traefik
references/features.md for all available featuresreferences/examples.md for common configurationsassets/ for configuration templatescompose_default networktraefik-dynamic.yml YAML syntax--api.dashboard=true is in command