Back to Home Buy Me a Beer

Secure Nginx with Certbot SSL

Free Let's Encrypt certificates for your website

This comprehensive guide will walk you through securing your Nginx server with a free SSL certificate from Let's Encrypt using Certbot. SSL is essential for protecting your users' data and improving your site's SEO ranking.

1 Install Certbot and Nginx plugin

First, install Certbot and its Nginx plugin package using your package manager.

sudo apt update && sudo apt install certbot python3-certbot-nginx

For other systems, check certbot.eff.org for specific instructions.

2 Obtain SSL Certificate

Run Certbot with the Nginx plugin to automatically obtain and install the certificate.

sudo certbot --nginx -d example.com -d www.example.com
Replace "example.com" with your actual domain

3 Follow the Prompts

  • Provide a valid email address for urgent renewal and security notices
  • Agree to the Let's Encrypt Terms of Service
  • Decide whether to redirect HTTP to HTTPS (recommended)

Test Automatic Renewal

Certbot sets up automatic renewal for you, but you can test the renewal process with:

sudo certbot renew --dry-run

Certificates are valid for 90 days and should renew automatically. The command above verifies that automatic renewal works properly.

Success!

Your site should now be accessible via https:// and all traffic will be securely encrypted.

Need help? Found an issue? Contact us

© 2023 tomskbs.info - All Rights Reserved