Free, auto-renewable SSL certificate.
docker compose stop nginxapt install -y certbot
certbot certonly --standalone -d yourdomain.com -d www.yourdomain.com \
--email you@email.com --agree-tos --non-interactivemkdir -p ssl
cp /etc/letsencrypt/live/yourdomain.com/fullchain.pem ssl/fullchain.pem
cp /etc/letsencrypt/live/yourdomain.com/privkey.pem ssl/privkey.pemdocker compose start nginx# Add to crontab
crontab -eAdd this line:
0 3 * * * certbot renew --quiet && cp /etc/letsencrypt/live/yourdomain.com/fullchain.pem /root/wordpress-site/ssl/fullchain.pem && cp /etc/letsencrypt/live/yourdomain.com/privkey.pem /root/wordpress-site/ssl/privkey.pem && docker compose -f /root/wordpress-site/docker-compose.yml restart nginx
If you use Cloudflare as DNS proxy:
- Set Cloudflare SSL mode to Full (Strict)
- Go to SSL/TLS → Origin Server → Create Certificate
- Download the certificate and key
- Save as
ssl/fullchain.pemandssl/privkey.pem
This certificate is valid for 15 years and auto-trusted by Cloudflare.
curl -I https://yourdomain.com
# Should show HTTP/2 200Check with SSL Labs — aim for A or A+ rating.