Hey everyone,
I have been using Traefik for quite some time now with a custom domain. However, this domain is getting expensive and for now I’m switching to a self signed domain.
I was following some tutorials and this is what I’ve done:
Created my certificates using
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout certs/selfsigned.key -out certs/selfsigned.crt -subj "/CN=home.lan"
and pointed home.lan to the IP of the VM running traefik. Put the certificates inside a /certs folder and updated docker-compose.yml:
traefik:
container_name: traefik
image: traefik:latest
restart: unless-stopped
security_opt:
- no-new-privileges:true
networks:
- traefik
ports:
- 80:80
- 8080:8080
- 443:443
volumes:
- /etc/localtime:/etc/localtime:ro
- ./certs:/certs
- ./config/traefik.yml:/traefik.yml:ro
- ./config/acme.json:/acme.json
- ./config/local.json:/local.json
- ./config/config.yml:/config.yml:ro
- ./config/traefik.log:/traefik.log
Simplified version of config.yml
http:
routers:
test:
entryPoints:
- "https"
rule: "Host(`home.lan`)"
service: test
services:
test:
loadBalancer:
servers:
- url: <redacted>
traefik.yml
api:
dashboard: true
debug: true
entryPoints:
http:
address: ":80"
http:
redirections:
entryPoint:
to: https
scheme: https
https:
address: ":443"
serversTransport:
insecureSkipVerify: true
log:
filePath: "/traefik.log"
level: DEBUG
providers:
docker:
endpoint: <redacted>
exposedByDefault: false
file:
filename: /config.yml
tls:
certificates:
- certFile: /certs/selfsigned.crt
keyFile: /certs/selfsigned.key
stores:
- default
certificatesResolvers:
local:
acme:
tlschallenge: true
email: a@example.com
storage: local.json
I also installed the custom certificate on my computer and phone, and in both I get an insecure error. Looking at the traefik logs I see:
2025-11-25T22:20:04Z DBG github.com/traefik/traefik/v3/pkg/tls/tlsmanager.go:288 > Serving default certificate for request: "home.lan"
2025-11-25T22:20:04Z DBG log/log.go:245 > http: TLS handshake error from 172.30.92.1:49735: remote error: tls: unknown certificate
I tried looking in the forums, YouTube, Google, ChatGPT and none of the solutions seem to work, I always get this result.