
{"id":22352,"date":"2024-09-16T12:12:10","date_gmt":"2024-09-16T10:12:10","guid":{"rendered":"https:\/\/contabo.com\/blog\/kb\/103000312197-how-do-i-install-an-ssl-certificate-on-my-linux-server-using-let-s-encrypt\/"},"modified":"2025-04-10T18:10:26","modified_gmt":"2025-04-10T16:10:26","slug":"103000312197-how-do-i-install-an-ssl-certificate-on-my-linux-server-using-let-s-encrypt","status":"publish","type":"kb","link":"https:\/\/contabo.com\/blog\/kb\/103000312197-how-do-i-install-an-ssl-certificate-on-my-linux-server-using-let-s-encrypt\/","title":{"rendered":"How Do I Install an SSL Certificate on My Linux Server Using Let&#8217;s Encrypt?"},"content":{"rendered":"<h4 dir=\"ltr\"><strong dir=\"ltr\">How do I install an SSL certificate on my Linux server using Let&#8217;s Encrypt?<\/strong><\/h4>\n<p dir=\"ltr\">Before you install the SSL Certificate, <strong>you must have the following:<\/strong><\/p>\n<ul>\n<li dir=\"ltr\">A domain name pointing to your server.<\/li>\n<li dir=\"ltr\">Root or sudo access to the server.\n<\/li>\n<\/ul>\n<p dir=\"ltr\">If you have both of the above, <strong>then you can follow the guide below to install your SSL certificate.<\/strong> In this guide, we&#8217;ll use Certbot, a tool that automates the process of obtaining and installing Let&#8217;s Encrypt SSL Certificates.<\/p>\n<ol>\n<li dir=\"ltr\">First you must install Certbot, <strong>if you&#8217;re using Ubuntu\/Debian<\/strong> run the following command:\n<pre>sudo apt update <br class=\"SCXW148979656 BCX2\">sudo apt install certbot python3-certbot-apache&#8239; # For Apache&nbsp;\nsudo apt install certbot python3-certbot-nginx&#8239;&#8239; # For Nginx <\/pre>\n<p><strong>If you&#8217;re using CentOS\/RHEL,<\/strong> run the following command:<\/p>\n<pre>sudo yum install epel-release\nsudo yum install certbot python2-certbot-apache&#8239; # For Apache\nsudo yum install certbot python2-certbot-nginx&#8239;&#8239; # For Nginx<\/pre>\n<\/li>\n<li dir=\"ltr\"><strong>Use the command below to get your SSL certificate.<\/strong> Please replace your_domain in the example below with your actual domain.\n<p><strong>If you&#8217;re using Apache,<\/strong> run the following command:<\/p>\n<pre>sudo certbot --apache -d your_domain -d www.your_domain&nbsp;<br class=\"SCXW175193879 BCX2\"><\/pre>\n<p><strong>If you&#8217;re using Nginx,&nbsp;<\/strong>run the following the command:<\/p>\n<pre>sudo certbot --nginx -d your_domain -d www.your_domain <\/pre>\n<\/li>\n<li dir=\"ltr\">\n<p class=\"Paragraph SCXW258968162 BCX2\" dir=\"ltr\"><strong>Certbot automatically creates a cron job for certificate renewal.<\/strong> You can test this renewal process with this command:<\/p>\n<p class=\"Paragraph SCXW258968162 BCX2\" dir=\"ltr\"><\/p>\n<pre class=\"Paragraph SCXW258968162 BCX2\" dir=\"ltr\">sudo certbot renew --dry-run<\/pre>\n<\/li>\n<li dir=\"ltr\">\n<p class=\"Paragraph SCXW258968162 BCX2\" dir=\"ltr\">Finally, restart your web server.<\/p>\n<p><strong>If you&#8217;re using Apache,<\/strong> run the following command:<\/p>\n<pre class=\"Paragraph SCXW258968162 BCX2\" dir=\"ltr\">sudo systemctl restart apache2&nbsp;<\/pre>\n<p class=\"Paragraph SCXW258968162 BCX2\" dir=\"ltr\"><strong>If you&#8217;re using Nginx,&nbsp;<\/strong>run the following command:<\/p>\n<pre class=\"Paragraph SCXW258968162 BCX2\" dir=\"ltr\">sudo systemctl restart nginx&nbsp;<\/pre>\n<\/li>\n<\/ol>\n<p><span class=\"ast-load-more active\"><a href=\"https:\/\/help.contabo.com\/en\/support\/solutions\/articles\/103000312197-how-do-i-install-an-ssl-certificate-on-my-linux-server-using-let-s-encrypt-\" rel=\"nofollow\">Details&#8230;<\/a> <\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>How do I install an SSL certificate on my Linux server using Let&#8217;s Encrypt? Before you install the SSL Certificate, you must have the following: A domain name pointing to your server. Root or sudo access to the server. If you have both of the above, then you can follow the guide below to install [&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-22352","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 certificate on my Linux server using Let&#8217;s Encrypt? Before you install the SSL Certificate, you must have the following: A domain name pointing to your server. Root or sudo access to the server. If you have both of the above, then you can follow the guide below to install&hellip;","_links":{"self":[{"href":"https:\/\/contabo.com\/blog\/wp-json\/wp\/v2\/kb\/22352","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\/22352\/revisions"}],"predecessor-version":[{"id":22955,"href":"https:\/\/contabo.com\/blog\/wp-json\/wp\/v2\/kb\/22352\/revisions\/22955"}],"wp:attachment":[{"href":"https:\/\/contabo.com\/blog\/wp-json\/wp\/v2\/media?parent=22352"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/contabo.com\/blog\/wp-json\/wp\/v2\/categories?post=22352"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/contabo.com\/blog\/wp-json\/wp\/v2\/tags?post=22352"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}