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

Assume you delete the certificate by mistake

certbot delete --cert-name

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

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

sudo certbot --nginx -d

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

❤️ 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.