ssl-guides 2026-12-02 ⏱ 3 min read

Configure SSL with Traefik: Let's Encrypt

Configure SSL with Traefik: Let's Encrypt

To configure SSL with Traefik, define a certificate resolver, point a router at it, and Traefik obtains and renews the certificate itself through ACME. This guide uses Traefik v3 syntax with a Docker setup.

SSL with Traefik: static configuration

# traefik.yml
entryPoints:
  web:
    address: ":80"
    http:
      redirections:
        entryPoint:
          to: websecure
          scheme: https
  websecure:
    address: ":443"

certificatesResolvers:
  le:
    acme:
      email: you@example.com
      storage: /letsencrypt/acme.json
      httpChallenge:
        entryPoint: web

providers:
  docker:
    exposedByDefault: false

The global redirect on the web entry point sends all HTTP traffic to HTTPS. The email is used by Let's Encrypt for account contact. acme.json stores keys and certificates, so it must persist between restarts and be readable only by its owner.

touch acme.json && chmod 600 acme.json

Docker Compose

services:
  traefik:
    image: traefik:v3.1
    ports: ["80:80", "443:443"]
    volumes:
      - ./traefik.yml:/etc/traefik/traefik.yml:ro
      - ./letsencrypt:/letsencrypt
      - /var/run/docker.sock:/var/run/docker.sock:ro

  app:
    image: nginx:alpine
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.app.rule=Host(`app.example.com`)"
      - "traefik.http.routers.app.entrypoints=websecure"
      - "traefik.http.routers.app.tls.certresolver=le"

Mounting the Docker socket gives Traefik broad access to Docker, so use a socket proxy in production setups where that matters.

SSL with Traefik: challenge types

ChallengeNeedsWildcard
HTTP-01Port 80 reachable from the internetNo
TLS-ALPN-01Port 443 reachableNo
DNS-01DNS provider API credentialsYes

Use your own certificate

To serve a certificate you issued elsewhere, for example on TryFreeSSL, provide it through the file provider. Use a full-chain file with the leaf first:

# dynamic/certs.yml
tls:
  certificates:
    - certFile: /certs/fullchain.pem
      keyFile: /certs/privkey.pem

Traefik watches the file provider directory, so replacing the files after a renewal does not need a restart.

Harden TLS options

tls:
  options:
    default:
      minVersion: VersionTLS12

Traefik's defaults are sensible. Raising the minimum to TLS 1.2 removes older protocol versions explicitly.

Test and troubleshoot

  • Run the SSL Checker on each hostname to confirm the certificate and chain.
  • If issuance fails, check the Traefik log for the ACME error, and confirm DNS points to the server.
  • Use the Let's Encrypt staging CA URL while experimenting to avoid rate limits.
  • A router with no matching host rule falls back to Traefik's default self-signed certificate, which browsers will reject.
  • Check redirects with the Redirect Checker.

Behind another proxy or load balancer

If a CDN or load balancer terminates TLS in front of Traefik, you may not need Traefik certificates at all. Let the front proxy handle the public certificate, run Traefik on an internal entry point and trust the forwarded headers only from the proxy address. If you want encryption end to end, keep a certificate on Traefik as well and use a mode on the front proxy that validates it. For Cloudflare in front, use Full (strict) with a Traefik certificate, and use DNS-01 for issuance since the origin is hidden from the public ACME server.

Related reading: free SSL on Docker, free SSL for a reverse proxy and SSL with HAProxy.

Frequently Asked Questions

Where does Traefik store certificates?

In the file set by storage, usually acme.json. Keep it on a persistent volume.

Can Traefik issue wildcard certificates?

Yes, with the DNS-01 challenge and a supported DNS provider.

Why do I see the default Traefik certificate?

The router rule did not match, the resolver is not set on the router, or issuance has not finished or has failed.

How does renewal work?

Traefik checks stored certificates and renews them automatically before expiry while it is running.

🔒 Test Your Website SSL Certificate Now
Run Free SSL Check →

✅ Post-Installation Verification & SEO Checklist

After applying the steps above, run through this 5-point checklist to prevent browser warnings and protect your Google SEO rankings:

  • Verify full CA chain trust and TLS 1.3 support using our Live SSL Checker.
  • Scan for Mixed Content HTTP links and check HSTS/CSP headers on Security Headers Checker.
  • Enforce a permanent 301 HTTP-to-HTTPS redirect with our HTTPS Redirect Generator.
  • Confirm both root and www versions resolve cleanly to one canonical HTTPS URL.
  • Verify your HTTPS property and sitemap.xml inside Google Search Console and Bing Webmaster Tools.
Technically Reviewed by TryFreeSSL Security Team
Last updated: 2026-12-05
About Us →

Free SSL Certificates, Live SSL Checker & CSR Generator

Issue trusted Let's Encrypt SSL certificates in 60 seconds with zero server setup.

Related Articles

🤖 TryFreeSSL AI Assistant