{"id":684,"date":"2012-07-11T05:04:32","date_gmt":"2012-07-11T11:04:32","guid":{"rendered":"http:\/\/blog.supportpro.com\/?p=684"},"modified":"2026-03-23T03:12:34","modified_gmt":"2026-03-23T09:12:34","slug":"how-to-install-ssl-certificate","status":"publish","type":"post","link":"https:\/\/www.supportpro.com\/blog\/how-to-install-ssl-certificate\/","title":{"rendered":"How to Install an SSL Certificate on Ubuntu with Nginx"},"content":{"rendered":"\n<p><strong>Prerequisites<\/strong><\/p>\n\n\n\n<p>Before you begin, ensure the following requirements are met:<\/p>\n\n\n\n<p><strong>Tools Required:<\/strong> OpenSSL<\/p>\n\n\n\n<p><strong>Operating System:<\/strong> Ubuntu<\/p>\n\n\n\n<p><strong>Web Server:<\/strong> Nginx<\/p>\n\n\n\n<p><strong>Assumptions<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>You have SSH access to your server. Your domain name is: <strong>mydomain.com<\/strong> Required files:<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>SSL Certificate: <code>mydomain.com.cert<\/code><\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Required files:<\/li>\n<\/ul>\n\n\n\n<ol class=\"wp-block-list\">\n<li>SSL Certificate: <code>mydomain.com.cert<\/code><\/li>\n\n\n\n<li>Private Key: <code>mydomain.com.key<\/code><\/li>\n\n\n\n<li>CSR (Certificate Signing Request): <code>mydomain.com.csr<\/code><\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step-by-Step Installation Guide<\/strong><\/h3>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>1. Generate a Private Key<\/strong><\/h4>\n\n\n\n<p>Start by creating a 2048-bit RSA private key. Log in to your server via SSH and run:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>openssl genrsa -out mydomain.com.key 2048<\/code><\/pre>\n\n\n\n<p>This will generate the private key file: <code>mydomain.com.key<\/code>.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>2. Generate a Certificate Signing Request (CSR)<\/strong><\/h4>\n\n\n\n<p>Use the private key to generate a CSR:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>openssl req -new -key mydomain.com.key -out mydomain.com.csr<\/code><\/pre>\n\n\n\n<p>You will be prompted to enter the following details:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Country Name (2-letter code)<\/li>\n\n\n\n<li>State or Province<\/li>\n\n\n\n<li>City or Locality<\/li>\n\n\n\n<li>Organization Name<\/li>\n\n\n\n<li>Organizational Unit (optional)<\/li>\n\n\n\n<li>Common Name (your domain, e.g., mydomain.com)<\/li>\n\n\n\n<li>Email Address<\/li>\n<\/ul>\n\n\n\n<p>Ensure the <strong>Common Name matches your domain name exactly<\/strong>.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>3. Purchase an SSL Certificate<\/strong><\/h4>\n\n\n\n<p>Submit the generated CSR to a trusted Certificate Authority (CA) such as:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>DigiCert<\/li>\n\n\n\n<li>Comodo<\/li>\n\n\n\n<li>Let\u2019s Encrypt<\/li>\n<\/ul>\n\n\n\n<p>After validation, the CA will issue your SSL certificate (<code>mydomain.com.cert<\/code>).<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>4. Verify the Certificate and Private Key<\/strong><\/h4>\n\n\n\n<p>To ensure proper SSL functionality, confirm that the certificate, private key, and CSR match by comparing their MD5 hashes:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>openssl x509 -noout -modulus -in mydomain.com.cert | openssl md5<br>openssl rsa -noout -modulus -in mydomain.com.key | openssl md5<br>openssl req -noout -modulus -in mydomain.com.csr | openssl md5<\/code><\/pre>\n\n\n\n<p>All three outputs must be identical.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>5. Install the SSL Certificate in Nginx<\/strong><\/h4>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Copy your SSL files to the Nginx directory:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo mkdir -p \/etc\/nginx\/certs<br>sudo cp mydomain.com.* \/etc\/nginx\/certs\/<\/code><\/pre>\n\n\n\n<ol start=\"2\" class=\"wp-block-list\">\n<li>Open your Nginx virtual host configuration file:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo nano \/etc\/nginx\/sites-enabled\/mydomain.com<\/code><\/pre>\n\n\n\n<ol start=\"3\" class=\"wp-block-list\">\n<li>Add the following configuration inside the <code>server {}<\/code> block:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>listen 443 ssl;ssl_certificate \/etc\/nginx\/certs\/mydomain.com.cert;<br>ssl_certificate_key \/etc\/nginx\/certs\/mydomain.com.key;<\/code><\/pre>\n\n\n\n<ol start=\"4\" class=\"wp-block-list\">\n<li>Save the file and restart Nginx:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl restart nginx<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Important Notes<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Always keep a secure backup of your private key (<code>.key<\/code> file).<\/li>\n\n\n\n<li>Losing the private key means you must generate a new CSR and reissue the SSL certificate.<\/li>\n\n\n\n<li>Ensure proper file permissions to protect sensitive key files.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Conclusion<\/strong><\/h3>\n\n\n\n<p>Once completed, your SSL certificate will be successfully installed, enabling secure HTTPS connections for your domain. You can verify the installation by visiting:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>https:&#47;&#47;mydomain.com<\/code><\/pre>\n\n\n\n<p>If you require help, <a href=\"https:\/\/www.supportpro.com\/requestquote.php\">contact SupportPRO Server Admin<\/a><\/p>\n\n\n\n<p class=\"has-text-align-center\"><span id=\"hs-cta-wrapper-9d590242-d641-4383-94b4-8cfd62f0af6b\" class=\"hs-cta-wrapper\"><span id=\"hs-cta-9d590242-d641-4383-94b4-8cfd62f0af6b\" class=\"hs-cta-node hs-cta-9d590242-d641-4383-94b4-8cfd62f0af6b\"><a href=\"https:\/\/cta-redirect.hubspot.com\/cta\/redirect\/2725694\/9d590242-d641-4383-94b4-8cfd62f0af6b\"><\/a><\/span><\/span><\/p>\n\n\n\n<div class=\"wp-block-media-text alignwide has-media-on-the-right is-stacked-on-mobile is-vertically-aligned-center has-white-background-color has-background\"><div class=\"wp-block-media-text__content\">\n<p class=\"has-large-font-size\">Partner with <strong>SupportPRO<\/strong> for 24\/7 proactive cloud support that keeps your business secure, scalable, and ahead of the curve.<\/p>\n\n\n\n<!--HubSpot Call-to-Action Code --><span class=\"hs-cta-wrapper\" id=\"hs-cta-wrapper-3350a795-db50-482f-9911-301930d1b1be\"><span class=\"hs-cta-node hs-cta-3350a795-db50-482f-9911-301930d1b1be\" id=\"hs-cta-3350a795-db50-482f-9911-301930d1b1be\"><!--[if lte IE 8]><div id=\"hs-cta-ie-element\"><\/div><![endif]--><a href=\"https:\/\/cta-redirect.hubspot.com\/cta\/redirect\/2725694\/3350a795-db50-482f-9911-301930d1b1be\" ><img decoding=\"async\" class=\"hs-cta-img\" id=\"hs-cta-img-3350a795-db50-482f-9911-301930d1b1be\" style=\"border-width:0px;\" src=\"https:\/\/no-cache.hubspot.com\/cta\/default\/2725694\/3350a795-db50-482f-9911-301930d1b1be.png\"  alt=\"Contact Us today!\"\/><\/a><\/span><script charset=\"utf-8\" src=\"https:\/\/js.hscta.net\/cta\/current.js\"><\/script><script type=\"text\/javascript\"> hbspt.cta.load(2725694, '3350a795-db50-482f-9911-301930d1b1be', {\"useNewLoader\":\"true\",\"region\":\"na1\"}); <\/script><\/span><!-- end HubSpot Call-to-Action Code -->\n<\/div><figure class=\"wp-block-media-text__media\"><img fetchpriority=\"high\" decoding=\"async\" width=\"904\" height=\"931\" src=\"https:\/\/www.supportpro.com\/blog\/wp-content\/uploads\/2022\/09\/Free-server-checkup.png\" alt=\"guy server checkup\" class=\"wp-image-12943 size-full\" srcset=\"https:\/\/www.supportpro.com\/blog\/wp-content\/uploads\/2022\/09\/Free-server-checkup.png 904w, https:\/\/www.supportpro.com\/blog\/wp-content\/uploads\/2022\/09\/Free-server-checkup-291x300.png 291w, https:\/\/www.supportpro.com\/blog\/wp-content\/uploads\/2022\/09\/Free-server-checkup-768x791.png 768w, https:\/\/www.supportpro.com\/blog\/wp-content\/uploads\/2022\/09\/Free-server-checkup-585x602.png 585w\" sizes=\"(max-width: 904px) 100vw, 904px\" \/><\/figure><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Prerequisites Before you begin, ensure the following requirements are met: Tools Required: OpenSSL Operating System: Ubuntu Web Server: Nginx Assumptions Step-by-Step Installation Guide 1. Generate a Private Key Start by&hellip;<\/p>\n","protected":false},"author":4,"featured_media":16494,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_lmt_disableupdate":"","_lmt_disable":"","footnotes":""},"categories":[1],"tags":[],"class_list":["post-684","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-miscellaneous"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts\/684","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/comments?post=684"}],"version-history":[{"count":6,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts\/684\/revisions"}],"predecessor-version":[{"id":16493,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts\/684\/revisions\/16493"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/media\/16494"}],"wp:attachment":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/media?parent=684"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/categories?post=684"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/tags?post=684"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}