Renewing LetsEncrypt Certificates
LetsEncrypt certificates expire every three months and must be renewed. This guide covers renewal for the current DTaaS package layouts.
Prerequisites
- Administrative access to the host
certbotinstalled- Access to Docker commands
Step 1: Renew certificates
CLI shortcut for generated deployments
If the DTaaS CLI created the deployment (dtaas deployment generate)
and [common.security].certs-src in dtaas.toml points to the directory
holding the renewed fullchain.pem / privkey.pem (e.g.
/etc/letsencrypt/live/your-domain.com), one command replaces the manual
copy and restart below:
The command validates the renewed pair: it must parse, the key must
match the certificate, and neither the leaf nor any intermediate may have
expired. It then stops traefik, swaps the new files into the
deployment's certs/ directory (restoring the previous pair if anything
goes wrong), restarts traefik and waits for it to come back up. On
POSIX hosts it also restores 0600 on the private key; on Windows it
prints a warning, because file permissions cannot be enforced there. If
validation fails, the live certificates stay untouched. See the
DTaaS CLI page for details.
The manual steps below apply to the deploy/dtaas/docker/* package
layouts and the services project.
Step 2: Deploy to DTaaS server package
For the secure server package (deploy/dtaas/docker/secure-server):
For the integrated package (deploy/dtaas/docker/secure-server_with_integrated-gitlab):
Step 3: Restart Traefik in DTaaS package
Server package:
Integrated GitLab package:
Step 4: Deploy to services project (if used)
If the platform services run from a project generated by
dtaas-services, refresh that project's certs/ directory. Set
CERTS_SRC in config/services.env to the certbot directory that holds
the renewed certificates, then run from the project directory:
host setup copies the newest certificate pair from CERTS_SRC into
certs/ as fullchain.pem and privkey.pem, and rebuilds the
per-service certificate files and permissions.
Step 5: Restart affected services project containers
If the ThingsBoard or GitLab compose stacks run in the same project:
Verification
Check the logs of the traefik service if needed.