{"id":5925,"date":"2021-06-28T22:16:10","date_gmt":"2021-06-28T22:16:10","guid":{"rendered":"https:\/\/www.geekdecoder.com\/?p=5925"},"modified":"2021-06-28T22:16:10","modified_gmt":"2021-06-28T22:16:10","slug":"set-up-lets-encrypt-on-debian-10","status":"publish","type":"post","link":"https:\/\/www.qbytes.cloud\/index.php\/2021\/06\/28\/set-up-lets-encrypt-on-debian-10\/","title":{"rendered":"Set Up Lets Encrypt on Debian 10 with Nginx"},"content":{"rendered":"<p>Update your package list<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n$ sudo apt update\n<\/pre>\n<p>Install the dependencies for the python3-certbot-nginx package, which include the python3-acme, python3-certbot, python3-mock, python3-openssl, python3-pkg-resources, python3-pyparsing, and python3-zope.interface packages:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n$ sudo apt install python3-acme python3-certbot python3-mock python3-openssl python3-pkg-resources python3-pyparsing python3-zope.interface\n<\/pre>\n<p>Iinstall the python3-certbot-nginx package:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n$ sudo apt install python3-certbot-nginx\n<\/pre>\n<p>Certbot needs to be able to find the correct server block in your Nginx configuration for it to be able to automatically configure SSL. Specifically, it does this by looking for a server_name directive that matches your requested domain.<\/p>\n<p>You should have a server block for your domain at \/etc\/nginx\/sites-available\/default with the server_name directive already set appropriately.<\/p>\n<p>To check, open the server block file for your domain using nano or your favorite text editor:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nsudo nano \/etc\/nginx\/sites-available\/your_domain\n<\/pre>\n<p>Find the existing server_name line. It should look like this:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n\/etc\/nginx\/sites-available\/default\n...\nserver_name your_domain www.your_domain;\n...\n<\/pre>\n<p>If it does, exit your editor and move on to the next step. If it doesn\u2019t, update it to match. Then save the file, quit your editor, and verify the syntax of your configuration edits:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n$ sudo nginx -t\n<\/pre>\n<p>If you get an error, reopen the server block file and check for any typos or missing characters. Once your configuration file syntax is correct, reload Nginx to load the new configuration:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n$ sudo systemctl reload nginx\n<\/pre>\n<p>Certbot can now find the correct server block and update it.<\/p>\n<p>Add a Cert.<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n$ sudo certbot --nginx -d your_domain -d www.your_domain\n<\/pre>\n<p>[\/bash]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Update your package list $ sudo apt update Install the dependencies for the python3-certbot-nginx package, which include the python3-acme, python3-certbot, python3-mock, python3-openssl, python3-pkg-resources, python3-pyparsing, and python3-zope.interface packages: $ sudo apt install python3-acme python3-certbot python3-mock python3-openssl python3-pkg-resources python3-pyparsing python3-zope.interface Iinstall the python3-certbot-nginx package: $ sudo apt install python3-certbot-nginx Certbot needs to be able to find the &#8230; <a title=\"Set Up Lets Encrypt on Debian 10 with Nginx\" class=\"read-more\" href=\"https:\/\/www.qbytes.cloud\/index.php\/2021\/06\/28\/set-up-lets-encrypt-on-debian-10\/\" aria-label=\"Read more about Set Up Lets Encrypt on Debian 10 with Nginx\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[74],"tags":[],"class_list":["post-5925","post","type-post","status-publish","format-standard","hentry","category-nginx"],"_links":{"self":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts\/5925","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/comments?post=5925"}],"version-history":[{"count":0,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts\/5925\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/media?parent=5925"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/categories?post=5925"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/tags?post=5925"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}