How to safely delete a subdomain certificate

I was using a subdomain. Now all I wanna know is how to delete/uninstall the certs related to it safely.


Hello :slightly_smiling_face:

Once the usage of the certificates has been removed (by, for example, removing references to them in any webserver configuration files), all that is needed is to permanently delete the certificates and especially their private keys. No need to revoke any certificates unless their private keys have been or would be compromised.


What exactly do I have to delete to avoid future problems? The folder /etc/letsencrypt/ Also what is in the folder /etc/letsencrypt/archive/ and all their respective symlinks? Because, when I was going to renew the certificates via cron, and manually, there was an error due to the fact I'd already deleted the /etc/letsencrypt/archive/ previously.

1 Like

You would use the following to cleanly delete the certificate:

sudo certbot delete --cert-name

You want to avoid manually removing files and folders under the letsencrypt folder whenever possible.

1 Like

Ok, I've just done it using your command. And what you say is true. That's why I was looking for a manner of doing this without having to mess things up. Thanks a whole lot.


You're quite welcome! :blush:

If you need any more help, you know where to find us.


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.