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.

2 Likes

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.

2 Likes

What exactly do I have to delete to avoid future problems? The folder /etc/letsencrypt/subdomain.site.com? Also what is in the folder /etc/letsencrypt/archive/subdomain.site.com? 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/subdomain.site.com previously.

1 Like

You would use the following to cleanly delete the certificate:

sudo certbot delete --cert-name subdomain.site.com

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.

3 Likes

You're quite welcome! :blush:

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

2 Likes

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