Skip to content
_CORE
AI & Agentic Systems Core Information Systems Cloud & Platform Engineering Data Platform & Integration Security & Compliance QA, Testing & Observability IoT, Automation & Robotics Mobile & Digital Banking & Finance Insurance Public Administration Defense & Security Healthcare Energy & Utilities Telco & Media Manufacturing Logistics & E-commerce Retail & Loyalty
References Technologies Blog Know-how Tools
About Collaboration Careers
CS EN DE
Let's talk

Traefik Tutorial

16. 09. 2025 Updated: 27. 03. 2026 1 min read intermediate

Traefik automatically detects services from Docker and Kubernetes without manual configuration. Just add Docker labels or Kubernetes IngressRoute and Traefik immediately starts routing traffic. Automatic SSL certificates via Let’s Encrypt, a built-in dashboard, and a rich middleware ecosystem make Traefik the ideal reverse proxy for cloud-native environments.

Why Traefik

  • Auto-discovery — new containers are automatically registered from Docker, Kubernetes, or Consul
  • Automatic SSL — Let’s Encrypt integration with HTTP-01 and DNS-01 challenge
  • Dashboard — visual overview of routers, services, and middleware
  • Middleware — authentication, rate limiting, redirect, strip prefix, headers, and more

Unlike Nginx or HAProxy, you do not need to restart the proxy when adding a new service. Traefik watches for changes in real time and dynamically updates configuration.

Docker setup

services:
  traefik:
    image: traefik:v3.0
    command:
      - --providers.docker=true
      - --entrypoints.web.address=:80
      - --certificatesresolvers.le.acme.httpchallenge.entrypoint=web
    ports: ['80:80', '443:443']
    volumes: ['/var/run/docker.sock:/var/run/docker.sock:ro']
  webapp:
    image: myapp
    labels:
      - traefik.http.routers.webapp.rule=Host(`app.example.com`)
      - traefik.http.routers.webapp.tls.certresolver=le

Configuration happens through Docker labels directly in docker-compose — no extra configuration files. Traefik reads the labels, creates a router, assigns a service, and automatically provisions an SSL certificate.

Middleware

labels:
  - traefik.http.middlewares.rl.ratelimit.average=100
  - traefik.http.middlewares.auth.basicauth.users=admin:$$apr1...
  - traefik.http.routers.webapp.middlewares=rl,auth

Middleware is chained — you can apply rate limiting, authentication, CORS headers, and redirects to a single router simultaneously. For Kubernetes, Traefik supports IngressRoute CRD with even greater flexibility.

Traefik for Docker/K8s

Auto-discovery + automatic SSL = ideal for cloud-native environments. For static servers, Nginx remains the better choice due to lower overhead and a mature ecosystem.

traefikreverse proxydocker
Share:

CORE SYSTEMS team

We build core systems and AI agents that keep operations running. 15 years of experience with enterprise IT.