How do I remove a self-signed SSL certificate on a LEMP server

When rebuilding my website, I installed a self-signed SSL certificate and when I finished, I used LetsEncrypt to get a valid SSL certificate. Unfortunately when browsers attempt to access my website, they are warned that the site uses a self-signed certificate and to proceed at their own risk.

How can I remove all traces of the self signed SSL certificate?


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.


First try using another browser, maybe you’ve got some browser cache and that’s why you are still seeing the old certificate.

If this is not the case what you could do here is:

  • Just run certbot - this should issue a new Let’s Encrypt SSL for you and substitute the old one automatically

If this does not work try the following:

  • Remove your server block for port 443
  • Run certbot again - it will generate a new SSL and it will create a new server block for port 443 automatically

That’s pretty much it! Bobby