Free SSL certificates with nginx and auto renew

Using lets-encrypt you are able to get free SSL certificates which can be used for serving HTTPS via nginx.

Each certificate has a 90 day duration and has to be renewed manually but using certbot we are able to automatically renew these.

apt update
apt install certbot python3-certbot-nginx
certbot --nginx -d -d

Certbot and the nginx plugin search your nginx configuration files for the server {} blocks looking for the domains that got passed in via the -d parameter and then apply the configurations required for SSL

Certbot automatically installs a cronjob to auto renew, this is located in /etc/cron.d/certbot

Leave a comment

Your email address will not be published.