How to migrate letsencrypt renewal from apache2 to nginx

I did this for 3 domains now and it worked, but try it at your own risk and make backups of original files before you do anything.

  • Make sure you actually have the nginx plugin. You can install it with the command sudo apt-get install python-certbot-nginx
  • Edit /etc/letsencrypt/renewal/*.conf with an editor of your choice
    • I did vim /etc/letsencrypt/renewal/DOMAIN.conf
  • In each of these files, there are two lines where you need to replace apache2 with nginx
    • authenticator: nginx
    • installer: nginx

Finally, to test if it went well, try renewing your certs with

certbot --dry-run renew

If you don't get any errors, it means the renewal succeeded.