From 77325a1004bc26fd313b0dc72da6b8d371e43dc4 Mon Sep 17 00:00:00 2001 From: Diaco Soltanpour Date: Wed, 3 Jun 2026 02:16:55 +0330 Subject: [PATCH] docs: add custom certificate alternative to Traefik ACME switching guide --- TRAEFIK-ACME-CHALLENGE-SWITCHING.md | 65 ++++++++++++++++++++++++++++- 1 file changed, 64 insertions(+), 1 deletion(-) diff --git a/TRAEFIK-ACME-CHALLENGE-SWITCHING.md b/TRAEFIK-ACME-CHALLENGE-SWITCHING.md index 97a7edb..bbbe96c 100644 --- a/TRAEFIK-ACME-CHALLENGE-SWITCHING.md +++ b/TRAEFIK-ACME-CHALLENGE-SWITCHING.md @@ -81,4 +81,67 @@ If issuance fails, switch back to the previous working challenge type in .env an ```bash docker compose up -d traefik -``` \ No newline at end of file +``` + +## Alternative method: use your own certificate files (no ACME) + +Use this method if you already have a certificate and private key and do not want Traefik to request certificates from Let's Encrypt. + +1. Place your certificate and key files in the mounted cert directory: + +```bash +cp your-cert-fullchain.pem certs/custom.crt +cp your-private-key.pem certs/custom.key +chmod 644 certs/custom.crt +chmod 600 certs/custom.key +``` + +Important: `certs/custom.crt` should contain the leaf certificate plus intermediate chain in PEM format. + +2. Configure Traefik dynamic TLS certs in `config/traefik/dynamic/certs.yml`: + +```yaml +tls: + certificates: + - certFile: /certs/custom.crt + keyFile: /certs/custom.key + stores: + - default +``` + +3. Switch services to static TLS mode in `.env`: + +```env +TRAEFIK_SERVICES_TLS_CONFIG=tls=true +``` + +4. Restart Traefik: + +```bash +docker compose up -d traefik +``` + +5. Verify the served certificate: + +```bash +echo | openssl s_client -connect your-server-ip:443 -servername your-domain.tld 2>/dev/null | openssl x509 -noout -subject -issuer -dates +``` + +### Wildcard option for multiple subdomains + +For domains like `cloud.example.com`, `git.example.com`, and `odoo.example.com`, you can use one wildcard certificate for `*.example.com`. + +Example dynamic config: + +```yaml +tls: + certificates: + - certFile: /certs/wildcard.example.com.crt + keyFile: /certs/wildcard.example.com.key + stores: + - default +``` + +Notes: +- Wildcards cover one label only (`*.example.com`), not the apex (`example.com`) unless it is included separately. +- Keep `TRAEFIK_SERVICES_TLS_CONFIG=tls=true` while using custom certificates. \ No newline at end of file