{"id":87,"date":"2021-07-22T08:21:36","date_gmt":"2021-07-22T08:21:36","guid":{"rendered":"https:\/\/elevenguard.com\/blog\/?p=87"},"modified":"2022-06-27T17:48:25","modified_gmt":"2022-06-27T17:48:25","slug":"certbot-renew","status":"publish","type":"post","link":"https:\/\/elevenguard.com\/blog\/certbot-renew\/","title":{"rendered":"How To Renew Your Let\u2019s Encrypt SSL Certificate"},"content":{"rendered":"\n<p>Let&#8217;s Encrypt, an initiative of the EFF, Mozilla, and many other organizations, offers free certificates through Certbot. Certbot is designed to run directly on a web server, normally by a system administrator, because it is able to automatically generate Let&#8217;s Encrypt SSL certificates for any web server or web application. Most well-known web servers, like Apache and Nginx, can be directly configured using standard plugins, while others are supported using a generic mode that\u2019s compatible with the majority of web applications.<\/p>\n\n\n\n<p>If you run either Apache or Nginx, you can work with the -apache or -nginx switch to automate your Let&#8217;s Encrypt generation, renewal, and installation process.<\/p>\n\n\n\n<p>If you have a web server that requires you to work in a generic mode, you can use the -webroot switch to complete the same automatic renewal process. If you can\u2019t access your web server\u2019s root file system, an alternative method is to use certbot-auto\u2019s web server, accessed by the -standalone switch, to produce the certificates.<\/p>\n\n\n\n<p>Note: Let\u2019s Encrypt issues short-lived certificaticates that last 90 days, make sure that you or the sysadmin set aside time to renew your certificates every three months. Most Certbot installations come out of the box with automatic renewal set up.<\/p>\n\n\n\n<p>You can set up a scheduled task to automatically renew your certificates in the background by following these instructions:<\/p>\n\n\n\n<p>Note: For these instruction to set up Certbot to automate your SSL certificate generation process, you have to confirm that you\u2019re running it on the production box of the web application. The DNS has to be set up for the production box to run correctly and the automated generation process is based on this set up.<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Install Certbot<\/li><li>Install Cron if you don\u2019t already have it<br>\u2022 Run the following line, which will add a cron job to \/etc\/crontab:<\/li><\/ol>\n\n\n\n<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow\">\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:100%\">\n<p>SLEEPTIME=$(awk &#8216;BEGIN{srand(); print int(rand()*(3600+1))}&#8217;); echo &#8220;0 0,12 * * * root sleep $SLEEPTIME &amp;&amp; certbot renew -q&#8221; | sudo tee -a \/etc\/crontab &gt; \/dev\/null<\/p>\n<\/div>\n<\/div>\n<\/div><\/div>\n\n\n\n<ol class=\"wp-block-list\" start=\"3\"><li>Obtain your first certificate<br>\u2022 The easiest scenario is if you\u2019re operating on a supported, popular web server such as Apache or Ngnix, which will handle the process through your web server\u2019s plugin. This happens after you invoke the switch, which creates and installs the certificate for you.<br>\u2022 If you\u2019re running an unsupported web server, you need to give Certbot access to the root of your web server and state where to install the web challenge. Don\u2019t forget to specify which domain the certificates will be issued for. You should also note that you\u2019ll have to covert the certificates into the correct format because Certbot won\u2019t know.<\/li><\/ol>\n\n\n\n<p>Note: If you need to stop your web server to run Certbot, you should add pre and post hooks to automatically stop and start your web server during this process.<\/p>\n\n\n\n<ol class=\"wp-block-list\" start=\"4\"><li>Install your certificate<\/li><\/ol>\n\n\n\n<p>Assuming your web server will be looking in \/var\/certificates, this is what you would do.<\/p>\n\n\n\n<ol class=\"wp-block-list\" start=\"5\"><li>Renew regularly:<br>\u2022 Remember that Let\u2019s Encrypt certs are short-term and to schedule renewal every 3 months. Use the following command to renew: \/usr\/local\/bin\/certbot-auto renew<\/li><\/ol>\n\n\n\n<p>Note: the above command won\u2019t work if its too early for a certificate renewal. You can use Cron to set up a job, which will automatically initiate the renewal process every week until the correct interval of time has passed from the last issue date. You will receive notification emails from the CA if you fail to renew certificates about to expire. You can monitor the certificate expiration with <a href=\"https:\/\/elevenguard.com\/\">ElevenGuard<\/a> and get notified beforehand, otherwise your site could become unreachable, decreasing your traffic.<\/p>\n\n\n\n<ol class=\"wp-block-list\" start=\"6\"><li>Install the renewed certs<br>Don\u2019t forget to install the certs after the renewal, your keys will be copied into \/etc\/letsencrypt\/live, and your web server won\u2019t know about the certs until you install the keys. Simply repeat step 4 each time your certificates are renewed, this can be done with a Cron job as well.<\/li><\/ol>\n","protected":false},"excerpt":{"rendered":"Let&#8217;s Encrypt, an initiative of the EFF, Mozilla, and many other organizations, offers free certificates through Certbot. Certbot&hellip;\n","protected":false},"author":4,"featured_media":235,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":{"0":"post-87","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-howto"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How To Renew Your Let\u2019s Encrypt SSL Certificate - DevOps Squad<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/elevenguard.com\/blog\/certbot-renew\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How To Renew Your Let\u2019s Encrypt SSL Certificate - DevOps Squad\" \/>\n<meta property=\"og:description\" content=\"Let&#8217;s Encrypt, an initiative of the EFF, Mozilla, and many other organizations, offers free certificates through Certbot. Certbot&hellip;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/elevenguard.com\/blog\/certbot-renew\/\" \/>\n<meta property=\"og:site_name\" content=\"DevOps Squad\" \/>\n<meta property=\"article:published_time\" content=\"2021-07-22T08:21:36+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-06-27T17:48:25+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/elevenguard.com\/blog\/wp-content\/uploads\/2021\/07\/arif-riyanto-vJP-wZ6hGBg-unsplash-scaled.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1704\" \/>\n\t<meta property=\"og:image:height\" content=\"2560\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Jordan Pete\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jordan Pete\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/elevenguard.com\/blog\/certbot-renew\/\",\"url\":\"https:\/\/elevenguard.com\/blog\/certbot-renew\/\",\"name\":\"How To Renew Your Let\u2019s Encrypt SSL Certificate - DevOps Squad\",\"isPartOf\":{\"@id\":\"https:\/\/elevenguard.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/elevenguard.com\/blog\/certbot-renew\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/elevenguard.com\/blog\/certbot-renew\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/elevenguard.com\/blog\/wp-content\/uploads\/2021\/07\/arif-riyanto-vJP-wZ6hGBg-unsplash-scaled.jpg\",\"datePublished\":\"2021-07-22T08:21:36+00:00\",\"dateModified\":\"2022-06-27T17:48:25+00:00\",\"author\":{\"@id\":\"https:\/\/elevenguard.com\/blog\/#\/schema\/person\/7295434649b992cfb0b98b2d5109ebd5\"},\"breadcrumb\":{\"@id\":\"https:\/\/elevenguard.com\/blog\/certbot-renew\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/elevenguard.com\/blog\/certbot-renew\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/elevenguard.com\/blog\/certbot-renew\/#primaryimage\",\"url\":\"https:\/\/elevenguard.com\/blog\/wp-content\/uploads\/2021\/07\/arif-riyanto-vJP-wZ6hGBg-unsplash-scaled.jpg\",\"contentUrl\":\"https:\/\/elevenguard.com\/blog\/wp-content\/uploads\/2021\/07\/arif-riyanto-vJP-wZ6hGBg-unsplash-scaled.jpg\",\"width\":1704,\"height\":2560,\"caption\":\"Photo by Arif Riyanto on Unsplash\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/elevenguard.com\/blog\/certbot-renew\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/elevenguard.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How To Renew Your Let\u2019s Encrypt SSL Certificate\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/elevenguard.com\/blog\/#website\",\"url\":\"https:\/\/elevenguard.com\/blog\/\",\"name\":\"DevOps Squad\",\"description\":\"A community of hand-picked ninjas that share their expertise and  help the DevOps community to grow.\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/elevenguard.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/elevenguard.com\/blog\/#\/schema\/person\/7295434649b992cfb0b98b2d5109ebd5\",\"name\":\"Jordan Pete\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/elevenguard.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/04293c239bda286e18ad4ed849b94df01b3b550e4eaa95db4b86eeace8282e63?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/04293c239bda286e18ad4ed849b94df01b3b550e4eaa95db4b86eeace8282e63?s=96&d=mm&r=g\",\"caption\":\"Jordan Pete\"},\"description\":\"Former startup CTO turned writer. DevOps enthusiast.\",\"url\":\"https:\/\/elevenguard.com\/blog\/author\/jordanpete\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How To Renew Your Let\u2019s Encrypt SSL Certificate - DevOps Squad","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/elevenguard.com\/blog\/certbot-renew\/","og_locale":"en_US","og_type":"article","og_title":"How To Renew Your Let\u2019s Encrypt SSL Certificate - DevOps Squad","og_description":"Let&#8217;s Encrypt, an initiative of the EFF, Mozilla, and many other organizations, offers free certificates through Certbot. Certbot&hellip;","og_url":"https:\/\/elevenguard.com\/blog\/certbot-renew\/","og_site_name":"DevOps Squad","article_published_time":"2021-07-22T08:21:36+00:00","article_modified_time":"2022-06-27T17:48:25+00:00","og_image":[{"width":1704,"height":2560,"url":"https:\/\/elevenguard.com\/blog\/wp-content\/uploads\/2021\/07\/arif-riyanto-vJP-wZ6hGBg-unsplash-scaled.jpg","type":"image\/jpeg"}],"author":"Jordan Pete","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Jordan Pete","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/elevenguard.com\/blog\/certbot-renew\/","url":"https:\/\/elevenguard.com\/blog\/certbot-renew\/","name":"How To Renew Your Let\u2019s Encrypt SSL Certificate - DevOps Squad","isPartOf":{"@id":"https:\/\/elevenguard.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/elevenguard.com\/blog\/certbot-renew\/#primaryimage"},"image":{"@id":"https:\/\/elevenguard.com\/blog\/certbot-renew\/#primaryimage"},"thumbnailUrl":"https:\/\/elevenguard.com\/blog\/wp-content\/uploads\/2021\/07\/arif-riyanto-vJP-wZ6hGBg-unsplash-scaled.jpg","datePublished":"2021-07-22T08:21:36+00:00","dateModified":"2022-06-27T17:48:25+00:00","author":{"@id":"https:\/\/elevenguard.com\/blog\/#\/schema\/person\/7295434649b992cfb0b98b2d5109ebd5"},"breadcrumb":{"@id":"https:\/\/elevenguard.com\/blog\/certbot-renew\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/elevenguard.com\/blog\/certbot-renew\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/elevenguard.com\/blog\/certbot-renew\/#primaryimage","url":"https:\/\/elevenguard.com\/blog\/wp-content\/uploads\/2021\/07\/arif-riyanto-vJP-wZ6hGBg-unsplash-scaled.jpg","contentUrl":"https:\/\/elevenguard.com\/blog\/wp-content\/uploads\/2021\/07\/arif-riyanto-vJP-wZ6hGBg-unsplash-scaled.jpg","width":1704,"height":2560,"caption":"Photo by Arif Riyanto on Unsplash"},{"@type":"BreadcrumbList","@id":"https:\/\/elevenguard.com\/blog\/certbot-renew\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/elevenguard.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How To Renew Your Let\u2019s Encrypt SSL Certificate"}]},{"@type":"WebSite","@id":"https:\/\/elevenguard.com\/blog\/#website","url":"https:\/\/elevenguard.com\/blog\/","name":"DevOps Squad","description":"A community of hand-picked ninjas that share their expertise and  help the DevOps community to grow.","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/elevenguard.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/elevenguard.com\/blog\/#\/schema\/person\/7295434649b992cfb0b98b2d5109ebd5","name":"Jordan Pete","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/elevenguard.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/04293c239bda286e18ad4ed849b94df01b3b550e4eaa95db4b86eeace8282e63?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/04293c239bda286e18ad4ed849b94df01b3b550e4eaa95db4b86eeace8282e63?s=96&d=mm&r=g","caption":"Jordan Pete"},"description":"Former startup CTO turned writer. DevOps enthusiast.","url":"https:\/\/elevenguard.com\/blog\/author\/jordanpete\/"}]}},"_links":{"self":[{"href":"https:\/\/elevenguard.com\/blog\/wp-json\/wp\/v2\/posts\/87","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/elevenguard.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/elevenguard.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/elevenguard.com\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/elevenguard.com\/blog\/wp-json\/wp\/v2\/comments?post=87"}],"version-history":[{"count":4,"href":"https:\/\/elevenguard.com\/blog\/wp-json\/wp\/v2\/posts\/87\/revisions"}],"predecessor-version":[{"id":123,"href":"https:\/\/elevenguard.com\/blog\/wp-json\/wp\/v2\/posts\/87\/revisions\/123"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/elevenguard.com\/blog\/wp-json\/wp\/v2\/media\/235"}],"wp:attachment":[{"href":"https:\/\/elevenguard.com\/blog\/wp-json\/wp\/v2\/media?parent=87"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/elevenguard.com\/blog\/wp-json\/wp\/v2\/categories?post=87"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/elevenguard.com\/blog\/wp-json\/wp\/v2\/tags?post=87"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}