A self-signed certificate is an SSL certificate you generate yourself without involving an official certificate authority. For development and local testing, this is ideal: you get an https connection instantly, without cost or waiting time. In this article you’ll learn how to create such a certificate using OpenSSL and via Plesk, and how to deal with the well-known browser warning.
What is a self-signed certificate
With a normal SSL certificate, a certificate authority verifies that you own a domain, after which they sign the certificate. With a self-signed certificate, you skip that verification and sign the certificate yourself. Browsers don’t automatically trust this signature, which triggers a warning. This makes it unsuitable for a live website with visitors, but for a local development environment, a password-protected staging server, or internal testing purposes it works perfectly fine and costs nothing.
Creating a certificate with OpenSSL
On most systems (Linux, macOS, and Windows with WSL), OpenSSL is already available. With a single command, you generate both the private key and the certificate.
Open a terminal
Navigate to the folder where you want to store the certificate.
Run the OpenSSL command
Use: openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout localhost.key -out localhost.crt. Answer the questions that appear, such as country and organization; for development purposes, generic values are fine.
Link the certificate to your web server
In your virtual host or server configuration, point to the generated .crt and .key files.
Restart your local server
Reload the configuration so the new certificate becomes active.
Creating a certificate in Plesk
If your development or staging environment runs on a server with Plesk, you can create a self-signed certificate without using the command line. Go to SSL/TLS Certificates within the domain, choose Create Self-Signed Certificate, and fill in the requested details. Plesk instantly generates a valid self-signed certificate that you can assign to the domain. This is especially handy if you manage multiple test or staging subdomains and don’t want to run manual OpenSSL commands every time.
Resolving the browser warning
Because browsers don’t automatically trust self-signed certificates, you’ll see a message like “Your connection is not private.” For development purposes, this usually isn’t a problem: you can dismiss the warning via “Advanced” and “Proceed to site.” If you want to permanently avoid this message on your own development machine, you can manually add the certificate to your operating system’s or browser’s trusted root certificates. Look for your OS’s certificate manager and import the .crt file as trusted.
Keep in mind this only works on the machine where you imported the certificate. Colleagues or other devices will still see the warning unless they also add the certificate themselves. For shared staging environments, a real certificate is therefore often more practical. You can find more explanations about SSL and other server settings in the knowledge base.
Frequently Asked Questions
Can I use a self-signed certificate on a live website?
Technically possible, but not recommended. Visitors will see a warning, and search engines may view this as untrustworthy. Always use a certificate from a recognized certificate authority for production.
How long is a self-signed certificate valid?
You determine that yourself when generating it, for example via the -days parameter in OpenSSL. A validity of one year is common for development, but you can adjust this as needed.
Does a self-signed certificate work with all browsers?
Yes, all browsers accept self-signed certificates after manual confirmation or after importing the certificate as trusted.
Is a self-signed certificate the same as no SSL?
No. The connection is still encrypted; only the identity of the certificate holder hasn’t been verified by an external party. That’s not an issue for local development.
Can I also use a self-signed certificate for email?
Technically yes, but for business email with good deliverability, a trusted certificate is recommended. Check out the options for business email for a reliable solution.
Conclusion
A self-signed certificate is quick to create with OpenSSL or, if you work with Plesk, in just a few clicks in the control panel. It’s a great solution for local development and test setups, but doesn’t belong on a live website. If you already use web hosting with Plesk, you can easily arrange free SSL and self-signed certificates from the same panel.