Renewing LetsEncrypt Certificates
LetsEncrypt certificates expire every three months and must be renewed to prevent certificate validation errors in client web browsers. This guide documents the certificate renewal process for DTaaS platform installations using LetsEncrypt certificates.
Overview
The certificate renewal process involves three main phases:
- Certificate Generation: Renewing certificates using LetsEncrypt certbot
- Certificate Deployment: Copying new certificates to appropriate directories
- Service Restart: Restarting affected services to load new certificates
Prerequisites
- Administrative access to the DTaaS server
- LetsEncrypt certbot installed on the system
- Valid domain name configured for certificate generation
- Access to Docker commands
Certificate Renewal Process
Step 1: Generate New Certificates
Use LetsEncrypt certbot to renew existing certificates:
Step 2: Locate Certificate Files
After successful renewal, locate the new certificate files:
Step 3: Deploy Certificates to DTaaS
Copy the renewed certificates to the appropriate DTaaS directories:
Step 4: Verify Container Volume Mappings
Before restarting services, verify the volume mappings to ensure certificates are mounted correctly:
Step 5: Restart DTaaS Service Gateway
Navigate to the DTaaS docker deployment directory and restart Traefik:
Step 6: Restart Platform Services
Navigate to the services directory and restart individual services:
Step 7: Configure RabbitMQ Certificates
RabbitMQ requires a specific certificate format. Create a copy of the private key and restart the service:
Step 8: Configure MongoDB Certificates
MongoDB requires a combined certificate file containing both the certificate chain and private key:
Verification
After completing the renewal process, verify that certificates are properly installed:
Troubleshooting
Common Issues
Certificate Not Found Error : Verify that certificate files exist in the specified directories and have correct permissions (typically 644 for certificates, 600 for private keys).
Service Restart Failures : Check Docker service logs for specific error messages. Ensure that certificate paths in Docker Compose files match the actual file locations.
Browser Certificate Warnings : Clear browser cache and verify that the certificate chain is complete. Check that intermediate certificates are included in the fullchain.pem file.
Log Analysis
Monitor service logs for certificate-related errors:
Security Considerations
- Store private keys with restrictive permissions (600 or 640)
- Regularly monitor certificate expiration dates
- Implement automated monitoring to alert before certificate expiration
- Maintain backups of certificate files
- Use strong file system permissions on certificate directories