{"id":22357,"date":"2024-09-16T12:11:46","date_gmt":"2024-09-16T10:11:46","guid":{"rendered":"https:\/\/contabo.com\/blog\/kb\/103000312205-how-do-i-install-an-ssl-certficate-on-my-linux-server\/"},"modified":"2025-04-10T18:10:29","modified_gmt":"2025-04-10T16:10:29","slug":"103000312205-how-do-i-install-an-ssl-certficate-on-my-linux-server","status":"publish","type":"kb","link":"https:\/\/contabo.com\/blog\/kb\/103000312205-how-do-i-install-an-ssl-certficate-on-my-linux-server\/","title":{"rendered":"How Do I Install an SSL Certficate on My Linux Server?"},"content":{"rendered":"<h4 dir=\"ltr\"><strong>How do I install an SSL certficate on my Linux server?<\/strong><\/h4>\n<ol>\n<li dir=\"ltr\"><strong>First you need to obtain the SSL certificate.<\/strong> After buying your SSL certificate you&#8217;ll receive several files from your Certificate Authority (CA), typically including your SSL certificate file and your CA bundle file which you will need to perform the installation.&nbsp;<\/li>\n<li dir=\"ltr\">Next, <strong>upload the SSL certificate files to your Linux server.<\/strong> It&#8217;s common to place them in \/etc\/ssl\/certs\/ or \/etc\/apache2\/ssl\/.&nbsp;<\/li>\n<li dir=\"ltr\">Now <strong>you&#8217;ll need to configure Apache.<\/strong> Open your Apache configuration file for your site. This might be located in \/etc\/apache2\/sites-available\/ or \/etc\/httpd\/conf.d\/.&nbsp;<\/li>\n<li dir=\"ltr\"><strong>Run the following command:<\/strong>\n<pre>sudo nano \/etc\/apache2\/sites-available\/your_domain.conf <\/pre>\n<\/li>\n<li dir=\"ltr\">\n<p class=\"Paragraph SCXW247929386 BCX2\" dir=\"ltr\">Add the following lines to your VirtualHost configuration to specify the paths to your SSL certificate files:<\/p>\n<pre class=\"Paragraph SCXW94127556 BCX2\">apache <br class=\"SCXW94127556 BCX2\">&lt;VirtualHost *:443&gt; <br class=\"SCXW94127556 BCX2\">&#8239;&#8239;&#8239; ServerName your_domain.com <br class=\"SCXW94127556 BCX2\">&#8239;&#8239;&#8239; DocumentRoot \/var\/www\/html&nbsp;\n&nbsp;SSLEngine on <br class=\"SCXW94127556 BCX2\">&#8239;&#8239;&#8239; SSLCertificateFile \/etc\/ssl\/certs\/your_domain.crt <br class=\"SCXW94127556 BCX2\">&#8239;&#8239;&#8239; SSLCertificateKeyFile \/etc\/ssl\/private\/your_domain.key <br class=\"SCXW94127556 BCX2\">&#8239;&#8239;&#8239; SSLCertificateChainFile \/etc\/ssl\/certs\/ca_bundle.crt&nbsp;\n&#8239; &lt;Directory \/var\/www\/html&gt; <br class=\"SCXW94127556 BCX2\">&#8239;&#8239;&#8239;&#8239;&#8239;&#8239;&#8239; AllowOverride All <br class=\"SCXW94127556 BCX2\">&lt;\/Directory&gt; <br class=\"SCXW94127556 BCX2\">&lt;\/VirtualHost&gt;&nbsp;<\/pre>\n<\/li>\n<li dir=\"ltr\">\n<p class=\"Paragraph SCXW94127556 BCX2\">Run the following command to enable the SSL module and your site configuration:<\/p>\n<pre class=\"Paragraph SCXW94127556 BCX2\">sudo a2enmod ssl \nsudo a2ensite your_domain.conf&nbsp;<br class=\"SCXW94127556 BCX2\"><\/pre>\n<\/p>\n<\/li>\n<li dir=\"ltr\">\n<p class=\"Paragraph SCXW94127556 BCX2\" dir=\"ltr\">Restart the Apache service to apply the changes with the following command:<\/p>\n<pre class=\"Paragraph SCXW94127556 BCX2\" dir=\"ltr\">sudo systemctl restart apache2 <\/pre>\n<\/p>\n<\/li>\n<li dir=\"ltr\">\n<p class=\"Paragraph SCXW94127556 BCX2\" dir=\"ltr\">Finally, use an SSL checker tool, such as <u><a href=\"https:\/\/www.ssllabs.com\/ssltest\" rel=\"noreferrer nofollow noopener nofollow\" target=\"_blank\"><u>SSL labs<\/u><\/a><\/u>, to check that the SSL certificate is installed correctly.<\/p>\n<\/li>\n<\/ol>\n<p><span class=\"ast-load-more active\"><a href=\"https:\/\/help.contabo.com\/en\/support\/solutions\/articles\/103000312205-how-do-i-install-an-ssl-certficate-on-my-linux-server-\" rel=\"nofollow\">Details&#8230;<\/a> <\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>How do I install an SSL certficate on my Linux server? First you need to obtain the SSL certificate. After buying your SSL certificate you&#8217;ll receive several files from your Certificate Authority (CA), typically including your SSL certificate file and your CA bundle file which you will need to perform the installation.&nbsp; Next, upload the [&hellip;]<\/p>\n","protected":false},"author":72,"featured_media":0,"template":"","meta":{"inline_featured_image":false,"_uag_custom_page_level_css":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[2067],"tags":[],"class_list":["post-22357","kb","type-kb","status-publish","hentry","category-kb"],"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false},"uagb_author_info":{"display_name":"Contabo Web","author_link":"https:\/\/contabo.com\/blog\/author\/julius-nalivaiko\/"},"uagb_comment_info":0,"uagb_excerpt":"How do I install an SSL certficate on my Linux server? First you need to obtain the SSL certificate. After buying your SSL certificate you&#8217;ll receive several files from your Certificate Authority (CA), typically including your SSL certificate file and your CA bundle file which you will need to perform the installation.&nbsp; Next, upload the&hellip;","_links":{"self":[{"href":"https:\/\/contabo.com\/blog\/wp-json\/wp\/v2\/kb\/22357","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/contabo.com\/blog\/wp-json\/wp\/v2\/kb"}],"about":[{"href":"https:\/\/contabo.com\/blog\/wp-json\/wp\/v2\/types\/kb"}],"author":[{"embeddable":true,"href":"https:\/\/contabo.com\/blog\/wp-json\/wp\/v2\/users\/72"}],"version-history":[{"count":1,"href":"https:\/\/contabo.com\/blog\/wp-json\/wp\/v2\/kb\/22357\/revisions"}],"predecessor-version":[{"id":22956,"href":"https:\/\/contabo.com\/blog\/wp-json\/wp\/v2\/kb\/22357\/revisions\/22956"}],"wp:attachment":[{"href":"https:\/\/contabo.com\/blog\/wp-json\/wp\/v2\/media?parent=22357"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/contabo.com\/blog\/wp-json\/wp\/v2\/categories?post=22357"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/contabo.com\/blog\/wp-json\/wp\/v2\/tags?post=22357"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}