Traefik reverse proxy for Docker automating certificate management and middleware configuration

Key takeaways

• Traefik is a Docker-native reverse proxy. It reads container labels and rebuilds routes on the fly, so adding a service takes one Compose edit instead of an nginx -s reload and a sysadmin ticket.

• Pick Traefik when your services churn; keep NGINX when they don’t. Container-rich workloads (microservices, multi-tenant SaaS, preview environments) gain the most from Traefik’s automatic discovery. A static, high-RPS front-end is still cheaper to run on NGINX or HAProxy.

• Free Let’s Encrypt, built in. Traefik renews certificates automatically over ACME. Single domains use HTTP-01; wildcards need DNS-01 and a supported provider (Cloudflare, Route 53, GCloud DNS). Let’s Encrypt’s default certificates shrink from 90 to 64 days on February 10, 2027 and to 45 days on February 16, 2028, so you now need ACME state that is persisted and monitored.

• v3 is the version to start on in 2026. Traefik v3 has been GA since April 2024. The current line is v3.8 “Salers”, GA on November 23, 2026, and v3.7 now gets security fixes only (latest v3.7.20, November 2026). v3.0–v3.6 are out of support. v3 brings GA HTTP/3, native OpenTelemetry, WASM middleware, Gateway API v1.7.0 support (since v3.8), a drop-in ingress-nginx provider and SPIFFE. Moving from v2 to v3 is gentle.

• This guide ships the full config. You get a working traefik.yml + docker-compose.yml, automated TLS, the dashboard, security middlewares, wildcard certs, and the K8s and multi-tenant patterns we run in production.

Updated November 2026: Traefik v3.8 “Salers” (Gateway API v1.7.0, tap middleware), the November security fixes in v3.7.18–v3.7.20, a five-step Docker tutorial and a production best-practices checklist.

Why Fora Soft wrote this guide

Fora Soft has shipped real-time video, AI, and SaaS products since 2005: 250+ delivered products, 50+ in-house specialists, a 99% job-success score on Upwork. Almost every one of them sits behind a reverse proxy that handles the dull but critical parts: TLS termination, routing, rate limiting, auth, header rewrites. What follows is the Traefik configuration we run in production, not a Hello World. When we do an independent architecture review of a client’s container platform, the reverse-proxy layer is one of the first things we open.

The original version of this post won the 2022 HackerNoon Noonies award for Containers. This is the 2026 rebuild, covering Traefik v3.8, GA HTTP/3, wildcard certificates, OpenTelemetry, the Kubernetes Gateway API, and the security hardening we add by default. If you would rather have the engineers who run that stack build it with you, jump to the closing section.

Stuck on Traefik, NGINX, or your container infra?

We do backend, DevOps and real-time video infrastructure for SaaS, surveillance and edutainment. Bring your config and we’ll review it, or build it for you.

Book a 30-min call → WhatsApp → Email us →

What is Traefik? The one-paragraph answer

Traefik (pronounced “traffic”) is an open-source, cloud-native reverse proxy and load balancer written in Go. It watches your service registry (Docker, Kubernetes, Consul, Nomad, ECS) and builds its routes from labels, so you never hand-write an nginx.conf. You give a container a label like traefik.http.routers.api.rule=Host(`api.example.com`); when the container starts, Traefik picks it up, requests a Let’s Encrypt certificate and begins routing. Stop the service and the route goes away. That is the whole mental model, and Figure 1 shows it end to end.

Traefik request path (Client, EntryPoint, Router, Middlewares, Service) plus the Docker label discovery loop that builds it

Figure 1. The request path on top; the Docker discovery loop that builds it underneath. Only the provider changes on Kubernetes or Consul.

Traefik vs NGINX vs Caddy: pick by churn, not by hype

Which reverse proxy you need depends on two things: how often your services change and how much raw throughput you need. NGINX and HAProxy lead on peak requests-per-second. Traefik is simpler to operate when containers come and go. The table compares the three on the dimensions that decide real projects.

Dimension Traefik v3 NGINX Caddy
Service discovery Native (Docker, K8s, Consul, ECS, Nomad) Manual, or via NGINX Ingress Plugin-based, smaller ecosystem
Auto TLS (Let’s Encrypt) Built-in (HTTP-01, DNS-01, TLS-ALPN-01) Via certbot or NGINX Plus Built-in (best in class)
HTTP/3 & QUIC GA in v3 (one entry-point flag) Yes (recent) Yes
Raw throughput Mid-tier (∼ 15–25k rps/core) High Good
Config style Static YAML/TOML + dynamic labels Imperative nginx.conf + reloads Caddyfile (declarative, terse)
Dashboard / observability Built-in dashboard, native OTel, metrics Plus only, or external Limited
Best fit Microservices, multi-tenant SaaS, preview envs High-RPS static front, raw performance Small static sites, homelab

Be honest about raw numbers. In HAProxy’s own Kubernetes-ingress benchmark from September 2020, HAProxy pushed roughly 42k rps, Traefik about 19k, and the NGINX ingress about 12k (a vendor test, with the NGINX config throughput-limited). Read it as a threshold rather than a scoreboard: below ~10k rps the difference is noise, and above it you trade raw speed (NGINX/HAProxy) against dynamic config (Traefik). Figure 2 turns that into a decision you can make in under a minute.

Decision tree: pick Traefik vs NGINX vs Caddy vs HAProxy by service churn and required requests per second per core

Figure 2. Walk the trunk; the first Yes routes you to a proxy. Churn beats hype.

Reach for Traefik when: your services come and go (microservices, preview environments, multi-tenant deploys), you want auto-TLS without scripting certbot, and a single-digit percentage of CPU on the proxy is an acceptable price for simpler operations.

Reach for NGINX or HAProxy when: the edge is a stable, high-RPS front-end, you need every last request per second per core, or an experienced team already runs it well. A working static edge is not worth migrating for the badge.

Reach for Caddy when: you want the simplest automatic HTTPS for a handful of static sites or a homelab and don’t need Docker/K8s service discovery or a dashboard. Its config is the shortest of the three.

The Traefik vs NGINX difference is easiest to see on the same HTTPS route in both. NGINX wants a server block, a certbot-managed certificate and an nginx -s reload. Traefik wants two labels on the container and reloads nothing:

# NGINX — edit nginx.conf, run certbot, then: nginx -s reload
server {
  listen 443 ssl;
  server_name api.example.com;
  ssl_certificate     /etc/letsencrypt/live/api.example.com/fullchain.pem;
  ssl_certificate_key /etc/letsencrypt/live/api.example.com/privkey.pem;
  location / { proxy_pass http://api:8000; }
}

# Traefik — add labels to the container, no reload, cert issued automatically
labels:
  - traefik.http.routers.api.rule=Host(`api.example.com`)
  - traefik.http.routers.api.entrypoints=https
  - traefik.http.routers.api.tls.certresolver=simple-resolver
  - traefik.http.services.api.loadbalancer.server.port=8000

NGINX still makes sense where that reload is rare and throughput matters most: a stable, high-RPS front-end, mature tooling, a team that already knows it. Traefik pulls ahead once routes change often enough that editing and reloading a config file slows the team down.

Traefik tutorial: Docker setup in five steps

This Traefik tutorial takes a Docker host from zero to a working HTTPS route in five steps; the sections after it give you the exact files for each one. You need a server with ports 80 and 443 open and a DNS record already pointing at it.

1. Create the shared network. Run docker network create traefik once. Every service Traefik should route joins this network.

2. Write the static config. A traefik.yml with HTTP and HTTPS entry points, the Docker provider with exposedByDefault: false, and an ACME resolver for Let’s Encrypt.

3. Start Traefik with Docker Compose. Pin traefik:v3.8, publish ports 80, 443 and UDP 443, and mount the acme.json storage on a volume so certificates survive restarts.

4. Label a service. Add traefik.enable=true, a Host() rule, the https entry point and the certificate resolver. Traefik picks the container up without a restart and requests its certificate.

5. Verify. Open the dashboard over an SSH tunnel and check that the router shows no errors. Then request the hostname and confirm the Let’s Encrypt certificate in the browser.

When that works, add the middlewares, the wildcard resolver and the observability taps from the later sections. We use the same order on client projects.

A minimal production-shaped traefik.yml

We start every project from this static config. It defines the HTTP and HTTPS entry points, redirects HTTP→HTTPS, enables the Docker provider, sets up an ACME resolver against Let’s Encrypt, and turns on the dashboard and metrics.

# traefik.yml — static config

log:
  level: INFO

api:
  dashboard: true
  insecure: true   # only safe behind an ssh tunnel; lock down in prod

providers:
  docker:
    exposedByDefault: false   # opt in per service via labels

entryPoints:
  http:
    address: ":80"
    http:
      redirections:
        entryPoint:
          to: https
          scheme: https
          permanent: true
  https:
    address: ":443"
    http3: {}                 # HTTP/3 is GA in v3 — no experimental flag

certificatesResolvers:
  simple-resolver:
    acme:
      email: ops@example.com
      storage: /letsencrypt/acme.json
      httpChallenge:
        entryPoint: http

accessLog:
  format: json
metrics:
  prometheus: {}              # /metrics endpoint for Prometheus

Companion docker-compose.yml

services:
  traefik:
    image: traefik:v3.8                     # current line: v3.8.0, Nov 2026
    container_name: traefik
    restart: always
    ports:
      - "80:80"
      - "443:443"
      - "443:443/udp"                       # HTTP/3 needs UDP 443
      - "127.0.0.1:8080:8080"               # dashboard, ssh-tunnel only
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - ./traefik.yml:/etc/traefik/traefik.yml:ro
      - /data/letsencrypt:/letsencrypt
    networks:
      - traefik

  whoami:
    image: traefik/whoami
    restart: always
    labels:
      - traefik.enable=true
      - traefik.http.routers.whoami.rule=Host(`example.com`)
      - traefik.http.routers.whoami.entrypoints=https
      - traefik.http.routers.whoami.tls.certresolver=simple-resolver
      - traefik.http.services.whoami.loadbalancer.server.port=80
    networks:
      - traefik

networks:
  traefik:
    external: true

Run docker network create traefik once, then docker compose up -d. Open https://example.com and you should see the whoami output behind a green padlock.

One caveat before production: mounting /var/run/docker.sock, even read-only, gives Traefik root-equivalent reach into the host. On anything internet-facing we put a read-only Docker socket proxy in front of it (for example wollomatic/socket-proxy or Tecnativa’s docker-socket-proxy), run Traefik as non-root on a read-only filesystem, and never expose the raw socket. The pitfalls section goes deeper.

Reaching the dashboard safely

The dashboard is bound to 127.0.0.1:8080 on the host, so the internet can’t reach it. Open it over an SSH port-forward:

ssh -L 8080:localhost:8080 root@example.com
# then open http://localhost:8080 in your browser

If the dashboard must be reachable remotely, route api@internal through Traefik behind a basic-auth plus IP-allowlist middleware and turn off insecure. Never leave api.insecure: true on a public port.

Middlewares we ship by default

Three middlewares cover most real-world needs: basic auth, security headers and rate limiting. They run in the order you attach them, so auth and rate limits go in front of the service and headers apply on the way back out. Figure 3 shows where each one sits in a request’s path.

A request through a Traefik router: TLS, routing, then the middleware chain (headers, rate limit, auth) before the service

Figure 3. EntryPoint to service, with the observability taps Traefik v3 exposes at every hop.

# add to a service’s labels in docker-compose.yml

# 1) basic auth on the dashboard
- traefik.http.middlewares.dashboard-auth.basicauth.users=admin:$$apr1$$Cyl...   # htpasswd

# 2) security headers (HSTS, X-Frame, nosniff)
- traefik.http.middlewares.sec-headers.headers.stsSeconds=31536000
- traefik.http.middlewares.sec-headers.headers.stsIncludeSubdomains=true
- traefik.http.middlewares.sec-headers.headers.contentTypeNosniff=true
- traefik.http.middlewares.sec-headers.headers.browserXssFilter=true
- traefik.http.middlewares.sec-headers.headers.frameDeny=true

# 3) rate limit
- traefik.http.middlewares.api-rl.ratelimit.average=50
- traefik.http.middlewares.api-rl.ratelimit.burst=100

# attach two middlewares to a router
- traefik.http.routers.api.middlewares=sec-headers,api-rl

Note the doubled $$ in the basic-auth string: Compose interpolates a single $, so you have to escape it. Generate the hash with htpasswd -nb admin yourPassword.

Need a Traefik or Kubernetes review?

We’ll audit your reverse-proxy and ingress setup, fix the silent misconfigurations, and leave you with a runbook. Useful before any production launch or migration.

Book a 30-min review → WhatsApp → Email us →

Routing patterns: path prefixes, non-Docker backends, sticky sessions

Most real projects need three routes that a hello-world skips: an API under a path prefix, a backend that isn’t a container, and a stateful service with sticky sessions and health checks. Each takes a few labels or a few lines of dynamic config.

# 1) Path prefix: example.com/api -> api container, prefix stripped
- traefik.http.routers.api.rule=Host(`example.com`) && PathPrefix(`/api`)
- traefik.http.middlewares.api-strip.stripprefix.prefixes=/api
- traefik.http.routers.api.middlewares=api-strip

# 2) Sticky sessions + health check on a stateful service
- traefik.http.services.signal.loadbalancer.sticky.cookie=true
- traefik.http.services.signal.loadbalancer.sticky.cookie.name=signal_affinity
- traefik.http.services.signal.loadbalancer.healthcheck.path=/healthz
- traefik.http.services.signal.loadbalancer.healthcheck.interval=10s

For a backend outside Docker (a VM, a NAS, a legacy service on the LAN), add the file provider next to the Docker one. Traefik watches the directory and picks up changes without a restart:

# traefik.yml — add the file provider
providers:
  docker:
    exposedByDefault: false
  file:
    directory: /etc/traefik/dynamic
    watch: true

# /etc/traefik/dynamic/legacy.yml
http:
  routers:
    legacy:
      rule: Host(`legacy.example.com`)
      entryPoints: [https]
      service: legacy
      tls:
        certResolver: simple-resolver
  services:
    legacy:
      loadBalancer:
        servers:
          - url: "http://10.0.0.20:8080"

We put sticky cookies in front of WebRTC signaling and whiteboard servers that hold room state in memory. Stateless APIs run without them so load spreads evenly. The health check pulls a dead replica out of rotation within one interval, so you don’t wait for Docker to restart it.

Wildcard certificates with DNS-01

In a multi-tenant SaaS where every customer gets a subdomain (acme.example.com, tenant42.example.com), a separate certificate per tenant is the wrong design. Use one wildcard through the DNS-01 challenge. Figure 4 shows the difference, and it is also a rate-limit story we come back to below.

Traefik TLS: HTTP-01 issues one cert per host; DNS-01 issues one wildcard for all tenant subdomains

Figure 4. HTTP-01 issues one certificate per hostname; DNS-01 issues a single wildcard for every subdomain.

# traefik.yml — add a wildcard resolver
certificatesResolvers:
  wildcard-resolver:
    acme:
      email: ops@example.com
      storage: /letsencrypt/acme.json
      dnsChallenge:
        provider: cloudflare
        resolvers:
          - "1.1.1.1:53"
          - "8.8.8.8:53"
# docker-compose.yml — Cloudflare token + wildcard router
services:
  traefik:
    environment:
      - CF_DNS_API_TOKEN_FILE=/run/secrets/cf_token
    secrets:
      - cf_token

  api:
    labels:
      - traefik.enable=true
      - traefik.http.routers.api.rule=HostRegexp(`^[a-z0-9-]+\.example\.com$`)   # v3 uses Go regexp
      - traefik.http.routers.api.entrypoints=https
      - traefik.http.routers.api.tls.certresolver=wildcard-resolver
      - traefik.http.routers.api.tls.domains[0].main=example.com
      - traefik.http.routers.api.tls.domains[0].sans=*.example.com

secrets:
  cf_token:
    file: ./cloudflare-token.txt

Supported providers include Cloudflare, Route 53, GCloud DNS, DigitalOcean, OVH and many more. The full provider list is in the official Traefik ACME docs.

Reach for a DNS-01 wildcard when: you serve more than a handful of subdomains off one apex, or you onboard tenants faster than a per-host certificate flow can keep up. One *.example.com cert covers all of them and stays clear of the per-domain issuance ceiling.

Mini-case: wildcard TLS for a multi-tenant SaaS

We build and run multi-tenant platforms where each customer lives on their own subdomain. BrainCert, the online-learning platform we’ve worked on, runs 100K+ customers and 500M+ delivered classroom minutes on infrastructure of exactly that shape. Below is the reverse-proxy pattern we use and the mistake we keep seeing teams make.

Situation. A multi-tenant SaaS onboards each customer at tenant.app.example.com. The first instinct is one Let’s Encrypt certificate per tenant over HTTP-01. That holds up in a demo and for the first dozen customers.

The plan. Let’s Encrypt caps issuance at 50 certificates per registered domain per week. At roughly 40–50 tenants, a burst of signups brushes that ceiling, issuance stalls, and new tenants hit TLS errors during onboarding, which is the worst first impression a product can make. So we switch to a single *.app.example.com wildcard over DNS-01 with a scoped Cloudflare token. Renewals of an existing certificate don’t count against that per-domain limit, so one wildcard stays cheap however many tenants sign up.

Outcome. The certificate count drops from one per tenant to one. Onboarding a tenant becomes a DNS row and a container label instead of a certificate request. Every Traefik instance reads the same shared acme.json, so a failover never shows a customer a certificate mismatch. Want a similar assessment of your edge? Grab a 30-minute call and bring your tenant model.

Upgrading Traefik: v2 to v3, and v3.7 to v3.8

We run Traefik v3 on new projects in 2026, and the migration from v2 is gentle. Your Docker labels mostly stay as they are, and the routers/services/middlewares model has not changed.

What changes: a small set of static-config renames, the plugin manifest format, and experimental flags promoted to GA (HTTP/3 among them). What stays the same: your labels, your ACME storage, your mental model. Read the official v2→v3 migration guide before you bump the image tag, and pin a specific patch release instead of a floating v3 tag. v2.11 still gets security fixes (v2.11.64 shipped in November 2026), but new features land only in v3 and v3.0–v3.6 no longer receive patches, so if you are on v2 the target is v3.8.

Why upgrade: GA HTTP/3, native OpenTelemetry, WASM middleware, the Kubernetes Gateway API, and SPIFFE for workload identity. v3 also has a higher performance ceiling.

What’s new in Traefik v3.8 (November 2026)

Traefik v3.8, codenamed “Salers”, went GA on November 23, 2026 and is now the only line in active support; v3.7 is listed with security support only (Traefik release table, November 2026). On Docker, upgrading means bumping the tag and reading the v3.8 migration notes. On Kubernetes, update the Gateway API CRDs and RBAC rules to v1.7.0 first.

Gateway API v1.7.0. ListenerSet, listener isolation, HTTPRoute timeouts, retries, mirroring and CORS, plus mTLS on both sides of the proxy. All of it lives in standard Gateway API fields, so you no longer need Traefik middlewares or annotations for it.

Tap middleware. Sends copies of requests and responses as JSON records to an ordinary Traefik service, so you get an audit trail without a fork or a plugin. The records carry Authorization and Cookie headers; treat the receiving service as a secrets store.

Yaegi v2 plugin engine (experimental, opt-in). Traefik Labs reports it runs 1,044 of 1,066 Go test-suite programs, against 641 for Yaegi v1. Enable it with experimental.defaultRuntimeVersion: v2.

Smaller wins. Host(`**.example.com`) matches every subdomain, nested ones included; ACME gets a reusePrivateKey option; routers get a per-route respondingTimeouts.roundTrip; ForwardAuth supports NTLM and Kerberos.

Our default: new projects start on v3.8.0. Existing v3.7 stacks move after one soak in staging, since v3.7 still receives security patches.

HTTP/3 and QUIC, in two lines

Add http3: {} to your HTTPS entry point and open UDP 443. In v3 this is GA, and the old experimental.http3 flag is gone. Browsers negotiate HTTP/3 on their own, and HTTP/1.1 and HTTP/2 clients keep working. Real-time video and edge-served apps gain the most, because QUIC tolerates packet loss without TCP’s head-of-line blocking. We turn it on by default in front of the streaming stacks we build. If you’re new to that world, our Learn primer on digital video covers the fundamentals, and we use it on edge-AI surveillance and mobile streaming deployments. If your product needs QUIC beyond the proxy edge, our QUIC and Media over QUIC development team builds sub-second streaming on quic-go and WebTransport.

Observability: logs, metrics, and OpenTelemetry

We always wire in three things, all visible in Figure 3 as taps off the request path:

1. Access logs. JSON-formatted and shipped to Loki or CloudWatch, with request ID, latency, status and route name. Set accessLog.format: json.

2. Prometheus metrics. Enable metrics.prometheus and scrape /metrics. Watch traefik_router_request_duration_seconds_bucket for tail latencies per route.

3. OpenTelemetry traces (native in v3). Point Traefik at your OTLP collector and you get end-to-end traces from the edge through your services. One OTLP target replaces the v2 Jaeger, Zipkin and Datadog drivers.

Traefik on Kubernetes: Ingress, IngressRoute, Gateway API

On Kubernetes the mental model stays the same; only the provider changes. Traefik is the default ingress controller in k3s, shipped as an official Helm chart, which is why so many teams meet it there first. There are three ways to declare routes, and v3 supports all of them.

1. Standard Ingress. The portable Kubernetes object. It works, but its annotations are limited, so keep it for simple host/path routing.

2. IngressRoute (Traefik CRD). Traefik’s own custom resource. Middlewares, TLS options and priorities fit here cleanly, and it is the day-to-day choice on clusters that run Traefik.

3. Kubernetes Gateway API. The vendor-neutral successor to Ingress. Traefik v3 tracks it closely: v3.8 (November 2026) supports Gateway API v1.7.0, two releases after v1.5 (April 2026) and v1.6 (August 2026), which moved TCPRoute and UDPRoute to the standard channel. In k3s you enable it with a HelmChartConfig that sets providers.kubernetesGateway.enabled=true. Start here if you want portability across ingress vendors.

Reach for the Gateway API when: you want route definitions that survive a change of ingress controller, or a cleaner split of roles between cluster operators and app teams. Stay on IngressRoute if you’re all-in on Traefik and want its full middleware surface today.

Replacing ingress-nginx with Traefik after the March 2026 retirement

Kubernetes retired the community ingress-nginx controller in March 2026. Existing installs keep running, but there are no more releases, bug fixes or security patches (Kubernetes blog, November 2025). For most clusters the lowest-risk exit is Traefik’s Kubernetes Ingress NGINX provider. It serves your existing Ingress objects and translates nginx.ingress.kubernetes.io annotations into Traefik routers, services and middlewares. In v3.7 (May 2026) the provider left experimental and covers 80+ annotations, which Traefik Labs says matches more than 90% of real-world usage.

# Traefik Helm values: serve existing ingress-nginx Ingress objects
additionalArguments:
  - "--providers.kubernetesingressnginx=true"

# inventory the annotations you actually use before cutover
kubectl get ingress -A -o yaml | grep -o 'nginx.ingress.kubernetes.io/[a-z-]*' | sort | uniq -c

How we run the cutover. Inventory the annotations first. Anything outside the supported list, such as custom Lua or templates, becomes a Traefik middleware before the move. Install Traefik next to ingress-nginx on its own load-balancer IP, shift DNS host by host with a low TTL, compare error rates in Prometheus, and only then remove ingress-nginx. If you rely on the auth-url or auth-tls-secret annotations, run v3.7.20 or v3.8.0: the November 2026 releases close a ForwardAuth NTLM credential-reuse hole that the October fix for GHSA-hrpp-p4fc-wwf8 left open (GHSA-p956-6gvv-mxqp) and a client-certificate verification bypass on shared hosts (GHSA-ccgh-9g52-6vwg). Plan the Gateway API move as a separate, later step. The NGINX provider buys time; Gateway API is the long-term target.

Scaling Traefik beyond a single host

Single-host Traefik handles roughly 10–30k rps, depending on hardware and TLS load. Past that, you grow in the three stages shown in Figure 5.

Scaling Traefik: single host, then multiple instances with shared ACME behind an L4 load balancer, then Kubernetes

Figure 5. Three stages as traffic grows: shared ACME storage is what keeps multi-instance and cluster setups honest.

Run several Traefik instances behind a Layer-4 load balancer (HAProxy, AWS NLB) with shared ACME storage, or run Traefik as the cluster ingress on Kubernetes. On clusters we default to the K8s path; on Compose fleets, to multiple instances. Our scalable VMS guide covers scale architecture more broadly.

A decision framework in five questions

When a team asks us to sign off on a proxy choice, we go through these five questions. The answers usually settle it within one meeting.

1. How often do your services change? Daily deploys, preview environments, or tenants coming and going push you toward Traefik’s automatic discovery. A front-end that ships monthly does not.

2. What is your real peak RPS per core? Under ~10k, the proxy is not your bottleneck, so optimize for operations. Above it, weigh NGINX or HAProxy for raw throughput.

3. How many TLS hostnames, and how fast do they grow? For a few stable domains, HTTP-01 is fine. For many subdomains or fast tenant growth, use a DNS-01 wildcard every time.

4. Docker, Kubernetes, or bare VMs? On K8s, Traefik or the Gateway API fits naturally. On bare VMs with a static topology, a hand-tuned NGINX may be easier to reason about.

5. Who owns the proxy at 3 a.m.? If nobody is on call for a self-hosted edge, a managed option or a partner who runs it matters more than any feature checkbox. That is often where we come in.

Cost and effort to wire Traefik into a real product

Scope Effort Typical cost (Fora Soft) Outcome
Bootstrap config + dashboard 1–2 days $0.5–1.5k Working reverse proxy + Let’s Encrypt
Wildcard certs + multi-tenant routing 2–4 days $1–3k Tenant-subdomain SaaS ready
Security hardening + socket proxy + WAF 2–5 days $1.5–4k Hardened edge with rate limit + CSP
Observability (Prometheus, OTel) 3–5 days $2–5k Latency dashboards + tracing
Migration from NGINX or v2→v3 1–2 weeks $5–15k Zero-downtime cutover

Our quotes land below legacy SI vendors for the same scope because Agent Engineering compresses the rote configuration and audit work. Security review, ACME edge cases and observability wiring still need human attention, and that’s where our custom software development team spends its time. After launch, our software maintenance and support team keeps certificates, middlewares and Traefik upgrades current.

Traefik best practices checklist

Traefik best practices for production come down to eight habits: pin a patched image, opt services in, guard the Docker socket, keep the dashboard private, persist ACME state, put headers and rate limits on every public router, measure everything, and rehearse changes in staging. We check each one on every client edge we review.

1. Pin a patch release (traefik:v3.8.0, not latest) and subscribe to the Traefik security advisories.

2. Keep exposedByDefault: false so only labeled containers get routes.

3. Put a read-only socket proxy between Traefik and /var/run/docker.sock, and run Traefik as non-root.

4. Keep the dashboard on 127.0.0.1, or put it behind basic auth plus an IP allowlist.

5. Persist acme.json with chmod 600, and move to a DNS-01 wildcard once you pass a handful of subdomains.

6. Attach security headers and a rate limit to every public router. Use the Compress middleware only where it pays off: a Brotli memory-exhaustion bug in it (GHSA-3rh5-223h-cpwr, High) was fixed only in v3.7.20 and v3.8.0.

7. Ship JSON access logs, Prometheus metrics and OTLP traces from day one.

8. Rehearse upgrades and certificate changes in staging. Let’s Encrypt’s staging environment has issued 64-day certificates since October 14, 2026.

Five Traefik pitfalls we see most often

1. Exposing the raw Docker socket. Mounting /var/run/docker.sock gives Traefik root-equivalent access to the host, so a compromised container means a compromised box. Put a read-only socket proxy in front, run Traefik as non-root, and never expose the socket over the network.

2. Leaving the dashboard public. api.insecure: true on a public port shows anyone every route and certificate. Bind it to 127.0.0.1 or hide it behind basic-auth plus an IP allowlist.

3. Not persisting acme.json. Without a mounted /letsencrypt volume, every restart re-issues certificates and eats into the rate limit. Mount it and chmod 600. The cost grows each year: Let’s Encrypt moves its default profile to 64-day certificates on February 10, 2027 and 45-day certificates on February 16, 2028, so renewals roughly double. Alert on traefik_tls_certs_not_after, and if you opt into the shorter tlsserver profile, set acme.profile and acme.certificatesDuration so Traefik plans renewals for the real lifetime. Traefik’s ACME docs describe a fixed window: Traefik assumes 90-day certificates and starts renewing 30 days before expiry, so with 64-day certificates it renews around day 34 and keeps working. Let’s Encrypt expects the last 90-day certificates to expire on May 11, 2027, and plans to cut authorization reuse from 30 days to 10 days (announced October 7, 2026).

4. Routing collisions across stacks. When two services share the same Host() rule, which one wins is unpredictable. Use unique router names and explicit priority labels when rules overlap.

5. Running an unpatched image. 2025 brought real CVEs, among them one where a TLS verify=on flag silently stopped verifying (CVE-2025-66491, fixed in v3.6.3) and a path-manipulation middleware bypass (CVE-2025-32431). Pin a patched release and watch the security advisories. In 2026 the pace picked up: Traefik published seven security updates for the v3.7 line between September 7 and November 24, 2026 (v3.7.13 to v3.7.20), several rated High, and v3.0–v3.6 are out of support. Run v3.7.20 or v3.8.0 at minimum.

When you should NOT pick Traefik

Three honest cases. 1. A single-tenant, low-churn front-end where you already run NGINX and the team knows it: the migration will cost more than it saves in operations. 2. Extreme RPS at a single edge box, where NGINX or HAProxy still win on raw throughput. 3. Environments where you cannot give Traefik the Docker socket or Kubernetes API access it needs; strictly air-gapped or zero-trust shops sometimes run into this. If any of these is you, we’ll tell you.

FAQ

What is Traefik used for?

Traefik is a cloud-native reverse proxy and HTTP load balancer. It integrates with Docker, Kubernetes, Consul, ECS and Nomad, discovers services automatically, terminates TLS with Let’s Encrypt, runs middlewares (auth, rate limit, headers), and exposes a dashboard, Prometheus metrics and OpenTelemetry traces.

Traefik vs NGINX — which is better in 2026?

NGINX wins on raw throughput; Traefik is simpler to operate for container-rich workloads. If your services churn (microservices, preview envs, multi-tenant SaaS), Traefik saves real time every week. For a static front-end at high RPS, NGINX is still the right answer.

What is the latest version of Traefik?

The latest stable release is Traefik v3.8.0 “Salers”, GA on November 23, 2026. The v3.7 line (latest v3.7.20, November 2026) now receives security fixes only, v3.0–v3.6 are out of support, and v2.11 still gets security patches. Start new projects on v3.8 and pin a specific patch release instead of a floating tag.

What is new in Traefik v3.8?

Traefik v3.8 “Salers” went GA on November 23, 2026. It adds Gateway API v1.7.0 support, a tap middleware that sends audit copies of traffic to a service, the opt-in Yaegi v2 plugin engine, nested wildcard matching with Host(`**.example.com`), and an ACME reusePrivateKey option.

Is Traefik free and open source?

Yes. Traefik Proxy is open source under the MIT license and written in Go. Traefik Labs sells separate commercial products on top of it, such as Traefik Hub API Gateway and API Management; everything in this guide runs on the free proxy.

Does Traefik support free TLS certificates?

Yes. ACME / Let’s Encrypt is built in: HTTP-01 for single domains, DNS-01 for wildcards (Cloudflare, Route 53, GCloud DNS, DigitalOcean and more). Persist acme.json on a volume so you don’t run into issuance rate limits.

How do I get a wildcard certificate in Traefik?

Use a DNS-01 resolver with a supported DNS provider and set tls.domains[0].sans=*.example.com on the router. DNS-01 is the only challenge that can prove control of a wildcard, and a single *.example.com cert then covers every subdomain.

Is Traefik the default ingress in Kubernetes?

It’s the default ingress controller in k3s, shipped as a Helm chart. On full Kubernetes you install it yourself. Traefik v3 supports standard Ingress, its own IngressRoute CRD, and the Kubernetes Gateway API, which you enable in k3s through a HelmChartConfig.

Can Traefik handle WebSocket and HTTP/3 traffic?

Yes. WebSocket upgrades pass through transparently, and HTTP/3 / QUIC is a one-line entry-point flag, GA in v3. We run it at the edge in front of WebRTC signaling and HLS endpoints across our streaming projects.

Traefik vs Nginx Proxy Manager: which one fits?

Nginx Proxy Manager is a web UI on top of NGINX. You add proxy hosts and Let’s Encrypt certificates by hand, which suits a homelab with a few stable services. Traefik builds routes from container labels, which suits stacks where Compose or CI adds and removes services. A handful of hosts managed by clicks: NPM. Routing defined in code next to each service: Traefik.

How do I replace ingress-nginx with Traefik?

Install Traefik v3.7 or later with the Kubernetes Ingress NGINX provider enabled (--providers.kubernetesingressnginx=true). It serves your existing Ingress objects and translates 80+ ingress-nginx annotations, so after the March 2026 retirement you can shift traffic host by host and plan a Gateway API migration later.

How long do Let’s Encrypt certificates last in 2026?

Still 90 days on the default profile. Let’s Encrypt moves the default to 64-day certificates on February 10, 2027 and 45-day certificates on February 16, 2028; the opt-in tlsserver profile switched to 45 days on May 13, 2026. Traefik renews automatically, so keep acme.json persisted and alert on certificate expiry. Let’s Encrypt’s staging environment has issued 64-day certificates since October 14, 2026, so you can test the new cadence today.

Is Traefik safe to put on the public internet?

Yes, if you keep the dashboard private, put a read-only proxy in front of the Docker socket, attach security-headers and rate-limit middlewares, keep the image patched, and consider a CDN/WAF (Cloudflare, AWS WAF) for L7 attack mitigation. Traefik is built for that role.

Stack

Agora.io Alternative in 2026

Custom WebRTC behind Traefik — when the math beats CPaaS.

Stack

Twilio Video Alternatives

When and how to replace a CPaaS with custom infra.

Engineering

Scalable Video Management Systems in 2026

Where Traefik fits in a horizontally scalable VMS.

Architecture

Edge AI vs Cloud AI for Video Surveillance

Latency math that drives HTTP/3 and edge proxy choices.

Mobile

Optimize Android Apps for Smooth Video Streaming

QUIC, HTTP/3, ABR — what your edge proxy should support.

Need a backend, DevOps or video-infra partner who ships?

Traefik is a small piece of the picture. The harder questions tend to be service decomposition, observability, secret management, real-time streaming, and what belongs on the edge. We answer those questions for clients across SaaS, surveillance, edutainment and creator monetization.

If you want a quick second opinion on your reverse-proxy and ingress setup, or a partner to build the backend behind it, start with a 30-minute call with our engineering lead.

Book cover: Video Encoding, Volume 1 of the Fora Soft Video Engineering HandbookBook cover: Video Streaming, Volume 2 of the Fora Soft Video Engineering HandbookBook cover: Video Streaming, Volume 3 of the Fora Soft Video Engineering Handbook

The handbook · 7 volumes

Fora Soft Video Engineering Handbook

This guide stops at the proxy edge: TLS, routing and HTTP/3 in front of your services. Behind that edge, our seven-volume handbook covers the whole video stack, from encoding to delivery, audio and AI. Start with Volume 2 for QUIC, HTTP/3 and ingest protocols, then Volume 3 for CDNs, players and WebRTC. Written by Nikolay Sapunov, CEO at Fora Soft.

Browse the handbook on Amazon →7 volumes · 9,000+ pages · Kindle & paperback

Let’s talk about your edge

Bring your topology and your traffic numbers. We’ll bring 20 years of real-time video and SaaS delivery and a quote we can defend.

Book a 30-min call → WhatsApp → Email us →

  • Technologies