HTTPS and TLS
Updated Feb 05, 2023 ·
Overview
To secure your app with HTTPS, Traefik lets you use different types of TLS certificates.
- Let Traefik auto-generate, if no cert is given (not trusted)
- Use your own (manual)
- Let’s Encrypt (automated and trusted)
This keeps your app safe with HTTPS, whether you set up the certificates yourself or let Traefik manage them.
- TLS settings can go in static or dynamic config
- If Let’s Encrypt is used, Traefik creates and renew certs for you
info
Let’s Encrypt is usually the best choice if you want easy, secure, and automated certificate management.
Self-Signed Certificates
If you don’t provide any certificate, Traefik will create a self-signed one.
- Automatically generated by Traefik
- Browser shows warning that it's not trusted
This is useful for testing, but not recommended for production.
User-Defined Certificates
You can provide your own certificates if needed.
- Upload your cert and key files to Traefik
- Define their path in the configuration
- You can set more fine-grained configurations
- Traefik matches them to the correct entry points
You’re responsible for renewing these certificates before they expire.
Sample Configuration (User-defined certificate):
tls:
certificates:
- certFile: "/certs/domain.crt"
keyFile: "/certs/domain.key"
- certFile: "/certs/another-domain.crt"
keyFile: "/certs/another-domain.key"
Once mounted, Traefik will handle the rest automatically.