{"id":391,"date":"2025-02-02T00:48:27","date_gmt":"2025-02-02T00:48:27","guid":{"rendered":"https:\/\/hiyokotech.com\/?p=391"},"modified":"2025-02-02T01:03:58","modified_gmt":"2025-02-02T01:03:58","slug":"updating-a-lets-encrypt-certificate","status":"publish","type":"post","link":"https:\/\/hiyokotech.com\/?p=391","title":{"rendered":"Updating a Let&#8217;s Encrypt certificate"},"content":{"rendered":"<p>Updating a Let&#8217;s Encrypt certificate depends on how it was originally issued. Here\u2019s a step-by-step guide based on different scenarios:<\/p>\n<h3><strong>1. If You Used Certbot (Recommended)<\/strong><\/h3>\n<p>Certbot is the most common way to obtain and renew Let&#8217;s Encrypt certificates.<\/p>\n<h4><strong>Check Expiry Date<\/strong><\/h4>\n<p>Run:<\/p>\n<div class=\"contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950\">\n<div class=\"flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none\"><code class=\"!whitespace-pre language-sh\">sudo certbot certificates<br \/>\n<\/code><\/div>\n<\/div>\n<p>This shows your existing certificates and their expiration dates.<\/p>\n<h4><strong>Renew Certificates<\/strong><\/h4>\n<p>Run:<\/p>\n<div class=\"contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950\">\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"!whitespace-pre language-sh\">sudo certbot renew<br \/>\n<\/code><\/div>\n<\/div>\n<p>This attempts to renew all certificates that are expiring within 30 days.<\/p>\n<h4><strong>Restart Web Server (If Required)<\/strong><\/h4>\n<p>After renewal, restart your web server (e.g., Apache or Nginx) to apply the new certificate:<\/p>\n<div class=\"contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950\">\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"!whitespace-pre language-sh\">sudo systemctl restart apache2  <span class=\"hljs-comment\"># For Apache<\/span><br \/>\nsudo systemctl restart nginx    <span class=\"hljs-comment\"># For Nginx<\/span><\/code><\/div>\n<\/div>\n<div dir=\"ltr\"><\/div>\n<div dir=\"ltr\">\n<h3><strong>Verify the Renewal<\/strong><\/h3>\n<p>Once done, check if your certificate is updated:<\/p>\n<div class=\"contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950\">\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"!whitespace-pre language-sh\">openssl x509 -noout -dates -<span class=\"hljs-keyword\">in<\/span> \/etc\/letsencrypt\/live\/example.com\/fullchain.pem<br \/>\n<\/code><\/div>\n<\/div>\n<p>If everything is working correctly, your SSL certificate should now be renewed!<\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<h3><strong>Cron renew<\/strong><\/h3>\n<p>$ crontab -u root -e<br \/>\n00 00 25 * * systemctl stop httpd &amp;&amp; certbot renew &amp;&amp; systemctl start httpd<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Updating a Let&#8217;s Encrypt certificate depends on how it was originally issued. Here\u2019s a step-by-step guide based on different scenarios: 1. If You Used Certbot (Recommended) Certbot is the most common way to obtain and renew Let&#8217;s Encrypt certificates. Check Expiry Date Run: sudo certbot certificates This shows your existing certificates and their expiration dates. <br \/><a class=\"read-more-button\" href=\"https:\/\/hiyokotech.com\/?p=391\">Read More &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/hiyokotech.com\/index.php?rest_route=\/wp\/v2\/posts\/391"}],"collection":[{"href":"https:\/\/hiyokotech.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hiyokotech.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hiyokotech.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hiyokotech.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=391"}],"version-history":[{"count":2,"href":"https:\/\/hiyokotech.com\/index.php?rest_route=\/wp\/v2\/posts\/391\/revisions"}],"predecessor-version":[{"id":393,"href":"https:\/\/hiyokotech.com\/index.php?rest_route=\/wp\/v2\/posts\/391\/revisions\/393"}],"wp:attachment":[{"href":"https:\/\/hiyokotech.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=391"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hiyokotech.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=391"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hiyokotech.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=391"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}