How to Restore a Deleted Let's Encrypt Cert (Nginx Authenticator, Certbot)

Assume you delete the certificate by mistake

certbot delete --cert-name www.domain.com

Trying to add back the domain doesn't work anymore with the following error

emerg BIO_new_file("/etc/letsencrypt/live/www.mydomain.com/fullchain.pem") failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/etc/letsencrypt/live/www.mydomain.com/fullchain.pem','r') error:2006D080:BIO routines:BIO_new_file:no such file)

sudo certbot --nginx -d www.mydomain.com

Find the nginx configuration file for your domain at /etc/nginx/sites-available and remove all line with # managed by Certbot.

Check for nginx configuration error and reload nginx.

sudo nginx -tsudo nginx -s reload

Try to add the domain again.

sudo certbot --nginx -d www.mydomain.com

❤️ Is this article helpful?

Buy me a coffee ☕ or support my work via PayPal to keep this space 🖖 and ad-free.

Do send some 💖 to @d_luaz or share this article.

✨ By Desmond Lua

A dream boy who enjoys making apps, travelling and making youtube videos. Follow me on @d_luaz

👶 Apps I built

Travelopy - discover travel places in Malaysia, Singapore, Taiwan, Japan.