> ## Content Index
> Fetch the complete content index at: https://ettayeb.fr/llms.txt
> Use this file to discover other available public pages before exploring further.

# Traefik doesn’t get configured — it discovers your Docker containers and gives them HTTPS before you lift a finger
- URL: https://ettayeb.fr/en/selfhosted/traefik-cloud-native-reverse-proxy-en/
- Published: 2026-06-12T00:00:00.000Z
- Updated: 2026-11-23T15:26:38.000Z
- Description: Traefik v3.7.0, released May 5 2026, takes the reverse proxy to its logical conclusion: it reads your Docker container labels, provisions Let’s Encrypt certificates, and routes traffic without a single static config file.
- Author: Walid ETTAYEB
- Tags: Self-hosted, traefik, reverse-proxy, docker, lets-encrypt, cloud-native, middleware, #en, #Import 2026-11-23 14:52

**Traefik** shipped **v3.7.0** in **May 2026**, sitting on **64,000 GitHub stars** and a philosophy unchanged since **Emile Vauge** started the project in **2015**: a reverse proxy shouldn’t need to be configured. It should *discover* services, *provision* their certificates, and *route* traffic while you write the `docker-compose.yml` for your next container. By **June 2026**, releases were landing at a weekly cadence — **v3.7.3**, **v3.7.4**, **v3.7.5** — and the message was unmistakable: **Traefik** had won the cloud-native reverse proxy war.

Most homelabs start with **Nginx Proxy Manager**, and that’s the right call. NPM turns reverse proxy configuration into three form fields and a click, with zero `nginx.conf` editing. But past ten or fifteen services, the model frays: every new container means a visit to the admin UI, every port change a manual edit. **Traefik** inverts the problem: instead of declaring routes in a central tool, it reads them straight from the containers it’s supposed to proxy.

## A reverse proxy that listens to Docker, not a config file

The idea is simple and radical. **Traefik** connects to the Docker socket (`/var/run/docker.sock`) and watches daemon events: a container starts, it reads its labels; a container stops, it drops its route. No reload, no `nginx -s reload`, no static file to maintain. The configuration lives where the service lives — in the `docker-compose.yml` that defines it.

Here’s what it looks like to expose **Whoogle** behind a subdomain with automatic **Let’s Encrypt**:

```yaml
services:
  whoogle:
    image: benbusby/whoogle-search:latest
    networks: [traefik]
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.whoogle.rule=Host(`search.yourdomain.com`)"
      - "traefik.http.routers.whoogle.entrypoints=websecure"
      - "traefik.http.routers.whoogle.tls.certresolver=letsencrypt"
      - "traefik.http.services.whoogle.loadbalancer.server.port=5000"

```

**Five labels.** No Nginx config file, no admin form, no reload. You run `docker compose up -d` and thirty seconds later, `search.yourdomain.com` answers over HTTPS with a valid certificate. Tear down the container, the route vanishes. This is the behaviour that orchestrators like **Kubernetes** offer natively, pulled down to a single Docker host.

## Installation: a compose file you never touch again

**Traefik**’s core fits in three files: a static configuration (`traefik.yml`), a dynamic configuration (`dynamic.yml`), and a `docker-compose.yml`. The static config defines *entrypoints* (ports 80 and 443), *providers* (Docker, file), and *certificate resolvers* (Let’s Encrypt). Once written, it never changes.

```yaml
# traefik.yml
api:
  dashboard: true

entryPoints:
  web:
    address: ":80"
    http:
      redirections:
        entryPoint:
          to: websecure
          scheme: https
          permanent: true
  websecure:
    address: ":443"

providers:
  docker:
    endpoint: "unix:///var/run/docker.sock"
    exposedByDefault: false
    network: traefik
  file:
    filename: /etc/traefik/config/dynamic.yml
    watch: true

certificatesResolvers:
  letsencrypt:
    acme:
      email: "admin@yourdomain.com"
      storage: /etc/traefik/acme.json
      httpChallenge:
        entryPoint: web

```

Two critical safeguards in that file. **`exposedByDefault: false`** prevents **Traefik** from auto-routing every container on the network — only those carrying the `traefik.enable=true` label get exposed. **`network: traefik`** limits discovery to containers explicitly attached to the `traefik` network: a container isolated on a different Docker network is invisible to the proxy, reducing the attack surface.

**Traefik**’s own `docker-compose.yml` is minimal:

```yaml
services:
  traefik:
    image: traefik:v3.7
    container_name: traefik
    networks: [traefik]
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - ./traefik.yml:/etc/traefik/traefik.yml:ro
      - ./config:/etc/traefik/config:ro
      - ./acme.json:/etc/traefik/acme.json
    restart: unless-stopped

networks:
  traefik:
    external: true

```

Deploy this compose once and never touch it again. All operational configuration — routes, middleware, certificates — is driven by your application containers’ labels or the dynamic file.

## Middleware: the processing chain that replaces `nginx.conf`

Where **Nginx Proxy Manager** gives you checkboxes (SSL, force SSL, block common exploits), **Traefik** exposes a declarative *middleware* system. A middleware is a transformation applied to a request before it reaches the target service — and you chain them like building blocks.

Here are the most useful ones for a homelab:

- **Rate limiting**: `traefik.http.middlewares.ratelimit.ratelimit.average=100` caps each IP at 100 requests per second. Essential in front of an exposed API.
- **Basic Auth**: `traefik.http.middlewares.auth.basicauth.users=admin:$2y$…` protects the dashboard or any service without native authentication.
- **Security headers**: `traefik.http.middlewares.secureheaders.headers.sslredirect=true` adds missing security headers (HSTS, X-Frame-Options, Content-Security-Policy).
- **Redirect regex**: redirects `/old-path` to `/new-path`, strips `www`, or enforces a canonical URL.
- **IP whitelist**: `traefik.http.middlewares.internalip.ipwhitelist.sourcerange=192.168.0.0/16` locks a service to the local network.
- **Compression**: enables gzip or Brotli compression on the fly for text responses.

Each middleware is defined in `dynamic.yml` or directly as a Docker label, then attached to a router by name. The syntax is verbose — that’s the price of declarative mode — but it’s self-documenting: six months later, you read the label and know exactly what it does.

## Traefik vs Nginx Proxy Manager: the right tool at the right time

The table below summarises a comparison you should read as a progression, not a fight.

| Criterion                   | **Nginx Proxy Manager**         | **Traefik**                       |
| --------------------------- | ------------------------------- | --------------------------------- |
| Philosophy                  | GUI, click to add a host        | Automatic discovery via labels    |
| Docker auto-discovery       | No (manual UI entry)            | Yes, real-time                    |
| Let’s Encrypt               | Yes, via the interface          | Yes, automatic via labels         |
| Configuration               | Stored in SQLite                | Docker labels + YAML files        |
| Middleware                  | Checkboxes (SSL, exploits)      | Full declarative chain            |
| Dashboard                   | Host and certificate management | Routing overview                  |
| HTTP/3                      | Limited                         | Yes, native                       |
| Metrics                     | None                            | **Prometheus**, **OpenTelemetry** |
| Resources (idle, 10 routes) | \~60–80 MB RAM                  | \~40–60 MB RAM                    |
| Learning curve              | Very low                        | Moderate                          |

**Nginx Proxy Manager** is the ideal entry point. **Traefik** is the next stage — the one where the number of services makes manual management counter-productive. The threshold sits around **ten exposed containers**: below that, NPM does the job friction-free; above it, **Traefik** turns each new service into three labels instead of a configuration session.

The good news: both coexist perfectly on separate entrypoints. You can migrate service by service without a big-bang switch.

## Dashboard, metrics, and observability

**Traefik** ships a **web dashboard** that displays routers, services, and middleware state in real time. It’s not a configuration tool — it’s a visual diagnostics panel. Enable it locally, lock it behind **Basic Auth** or an **IP whitelist**, and keep it for debugging sessions.

For those pushing observability further, **Traefik** exposes natively:

- A **Prometheus** endpoint (`/metrics`) publishing request counts, HTTP status codes, and response times per service and router.
- **OpenTelemetry** traces to follow a request end-to-end through the middleware chain and backend services.
- **Access logs** in Apache combined format, with tunable verbosity and rotation.

These three pillars turn **Traefik** into the central traffic observation point. In a homelab where five to twenty services share ports 80 and 443, knowing which one is cascading 502 errors or saturating the rate limiter becomes invaluable.

## Pitfalls to know before migrating

**The Docker socket is an attack surface.** Mounting `/var/run/docker.sock` into a container gives that container root access to the Docker daemon. In production, prefer **Docker Swarm** mode or a socket proxy (`docker-socket-proxy`) that filters allowed API calls. For a single-host homelab, the risk is acceptable as long as the **Traefik** container is the only one mounting the socket and the dashboard is not exposed to the internet without authentication.

**The label syntax is verbose.** `traefik.http.routers.myservice.middlewares=auth,ratelimit,secureheaders@file` isn’t as readable as a Caddyfile. The counterpoint: the verbosity is predictable and scriptable. Once you’ve written three services with **Traefik**, the fourth is a copy-paste of labels where you change the name and port.

**TLS-ALPN-01 requires port 443 reachable.** If your ISP blocks port 443 or you’re behind CGNAT, switch to the **DNS-01** challenge — **Traefik** supports over forty DNS providers (Cloudflare, OVH, Route 53) to provision wildcard certificates without exposing port 443.

## Verdict

**Choose Nginx Proxy Manager** if you have fewer than ten exposed services and want a reverse proxy you configure in three clicks. **Choose Traefik** if you regularly exceed ten containers, want your services to self-register with the reverse proxy, or need a middleware chain you can version in a Git repository.

**Traefik** isn’t harder than NPM — it’s *different*. Where NPM centralises configuration in an interface, **Traefik** distributes it across every container. The result is a reverse proxy you no longer administer: you describe the service, it handles the rest. That’s the definition of cloud-native, and it works just as well on a **Raspberry Pi** as on a fifty-node **Kubernetes** cluster.

## References

- [Traefik v3.7.0 Release Notes](https://github.com/traefik/traefik/releases/tag/v3.7.0?ref=ettayeb.fr) — GitHub, May 5 2026
- [Traefik as a Reverse Proxy for Docker](https://blog.gntech.me/posts/2026-05-09-traefik-reverse-proxy-docker/?ref=ettayeb.fr) — GnTech Blog, May 9 2026
- [Nginx Proxy Manager vs Traefik (2026)](https://homelabcompass.com/compare/nginx-proxy-manager-vs-traefik?ref=ettayeb.fr) — HomelabCompass, 2026
- [Nginx Proxy Manager vs Traefik vs Caddy 2026](https://selfhostr.com/comparatifs/nginx-proxy-manager-vs-traefik-vs-caddy-2026/?ref=ettayeb.fr) — Selfhostr, May 28 2026
- [Traefik Official Documentation](https://doc.traefik.io/traefik/?ref=ettayeb.fr) — traefik.io
- [Nginx Proxy Manager gives your homelab a domain name and HTTPS in three clicks](https://ettayeb.fr/selfhosted/nginx-proxy-manager-reverse-proxy/) — ETTAYEB, May 15 2026