How to Delete Let’s Encrypt SSL Certificates
You delete Let’s Encrypt SSL certificates created with Certbot by using a specific command in your terminal.
Certbot is the command-line tool that helps you manage Let’s Encrypt certificates, allowing you to create, renew, revoke, and delete them easily.
Typically, Certbot stores your certificates in directories like /etc/letsencrypt/live, /etc/letsencrypt/renewal, and /etc/letsencrypt/archive. You’ll want to remove these when a certificate is no longer needed or if it has been compromised.
Before deleting, you should revoke the certificate to inform the Certificate Authority. You can find instructions on revoking Let’s Encrypt certificates in our companion guide.
Use the command line tool Certbot to delete Let’s Encrypt SSL certificates. Open your terminal and run `sudo certbot delete –cert-name yourdomain.com`, replacing `yourdomain.com` with your actual domain. If you omit the domain name, Certbot will list all registered domains for you to select from.
How to delete Let’s Encrypt SSL certificates on Ubuntu Linux
Deleting Let’s Encrypt certificates on Ubuntu Linux is straightforward using Certbot’s delete command, which helps remove any leftover files after you’ve revoked a certificate.
Here’s how.
First, sign in to your server and open your command terminal. Then, run the commands below for the specific domain whose SSL certificate you want to delete.
sudo certbot delete --cert-name example.com
Replace example.com with the actual domain name.
If you don’t reference a domain name and run the commands below, it will list all the domains registered on the server.
sudo certbot delete
Then select the one from the list to delete.
Saving debug log to /var/log/letsencrypt/letsencrypt.log Which certificate(s) would you like to delete? - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1: example.com 2: example1.net 3: example2.org - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Select the appropriate numbers separated by commas and/or spaces, or leave input blank to select all options shown (Enter 'c' to cancel): 1
Select the domain next to the number you wish to delete and press Enter.
That should do it!
Related post:
Conclusion:
- Deleting Let’s Encrypt SSL certificates using Certbot is essential for maintaining a secure and organized server environment.
- After revoking a certificate, remnants of the certificate may still exist on the server, which can be eliminated by using Certbot to delete them.
- Following the step-by-step process described in this post ensures that unnecessary certificates are removed, optimizing the server’s security and efficiency.
Was this guide helpful?
About the Author
Richard
Tech Writer, IT Professional
Richard, a writer for Geek Rewind, is a tech enthusiast who loves breaking down complex IT topics into simple, easy-to-understand ideas. With years of hands-on experience in system administration and enterprise IT operations, he’s developed a knack for offering practical tips and solutions. Richard aims to make technology more accessible and actionable. He's deeply committed to the Geek Rewind community, always ready to answer questions and engage in discussions.
No comments yet — be the first to share your thoughts!