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

July 22, 2019 512 views
WordPress Security LEMP Ubuntu 18.04

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?

1 Answer


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!

  • I tried both of the above to no avail. Unfortunately, in trying to fix it, I screwed things up so bad that I had to start over. Next time, I will know better. Don’t ever install a self-signed certificate.

Have another answer? Share your knowledge.

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