Custom SSL certificates
Traefik normally obtains HTTPS certificates through the letsencrypt certificate resolver. Use a custom certificate when a private certificate authority, an organization-managed certificate, or another certificate workflow must terminate TLS at Traefik.
The certificate and private key must exist on every server whose Traefik proxy serves the domain.
Prepare the certificate files
You need:
- a PEM-encoded certificate file that includes any required intermediate certificates
- the matching unencrypted private key
- shell access to the server running the resource
Copy the key over an encrypted connection, restrict its permissions, and never commit it to a repository or paste it into the Coolify dashboard.
On the resource server, create the certificate directory:
sudo install -d -m 700 /data/coolify/proxy/certsCopy the files from your machine to the resource server. Replace the local paths and server address:
scp /path/to/example.com.crt root@<server-address>:/data/coolify/proxy/certs/example.com.crt
scp /path/to/example.com.key root@<server-address>:/data/coolify/proxy/certs/example.com.keyRestrict access to the private key on the server:
sudo chmod 600 /data/coolify/proxy/certs/example.com.keyCoolify mounts /data/coolify/proxy/ at /traefik/ inside the Traefik container.
Add the dynamic TLS configuration
Open Servers > your server > Proxy > Dynamic Configurations, select Add, and create a file such as custom-certificates.yaml:
tls:
certificates:
- certFile: /traefik/certs/example.com.crt
keyFile: /traefik/certs/example.com.keySave the file. Traefik watches the dynamic configuration directory and selects a matching certificate from the certificate's subject alternative names when a request arrives.
Verify the certificate
Open the HTTPS domain and inspect the certificate issuer, subject alternative names, and expiration date. You can also check from a terminal:
openssl s_client -connect example.com:443 -servername example.com </dev/null 2>/dev/null \
| openssl x509 -noout -subject -issuer -datesIf Traefik continues to serve another certificate, confirm that the certificate covers the requested hostname and inspect Servers > your server > Proxy > Logs for file or key parsing errors.
