{"id":1503,"date":"2021-08-30T11:02:22","date_gmt":"2021-08-30T11:02:22","guid":{"rendered":"https:\/\/ownwebservers.com\/kb\/?p=1503"},"modified":"2021-08-30T13:02:14","modified_gmt":"2021-08-30T13:02:14","slug":"how-to-install-nginx-on-debian-10","status":"publish","type":"post","link":"https:\/\/ownwebservers.com\/kb\/how-to-install-nginx-on-debian-10\/","title":{"rendered":"How to Install Nginx on Debian 10"},"content":{"rendered":"<h3><strong>Introduction<\/strong><\/h3>\n<p>Within the world, Nginx is one of the well known web servers and it is consider for hosting some of the most important and highest-traffic sites on the internet. As compare to Apache, Nginx is more of resource-friendly and might be used as an web server or reverse proxy.<\/p>\n<p>In this guide, we\u2019ll discuss the way to install Nginx on your Debian 10 server.<\/p>\n<h3><strong>Prerequisites<\/strong><\/h3>\n<p>Before you start this guide, you ought to have a regular, non-root user with sudo privileges organized on your server and an active firewall. You&#8217;ll find out how to line these up by following our initial server setup guide for Debian 10.<\/p>\n<p>When you have an account available, log in as your non-root user to start.<\/p>\n<h3>Step 1\u2013 Installing in Nginx<\/h3>\n<p>As a default repositories, Nginx is accessible in Debian\u2019s , it&#8217;s possible to install it from these repositories using the apt packaging system.<\/p>\n<p>During this session, being this can be often our initial interaction with the apt packaging system , let\u2019s first update our local package so as index in order that we&#8217;ve access to the most recent package listings:<\/p>\n<div class=\"code-toolbar\">\n<div class=\"context\">\n<pre class=\"code-pre command prefixed language-bash\"><code class=\"code-highlight language-bash\">$ sudo apt update<\/code><\/pre>\n<\/div>\n<\/div>\n<p>our local package index so that we have access to the most recent package listings:Now we can install nginx:<\/p>\n<div class=\"code-toolbar\">\n<div class=\"context\">\n<pre class=\"code-pre command prefixed language-bash\"><code class=\"code-highlight language-bash\">$ sudo apt install nginx<\/code><\/pre>\n<\/div>\n<\/div>\n<p>Hit Enter to proceed, once prompted to verify the installation. After that, apt can install Nginx and any needed dependencies to your server.<\/p>\n<h2 id=\"step-2-\u2013-adjusting-the-firewall\">Step 2 \u2013 Adjusting the Firewall<\/h2>\n<p>Before testing Nginx, the firewall software needs to be adjusted to allow access to the service.<\/p>\n<p>List the application configurations that\u00a0<code>ufw<\/code>\u00a0knows how to work with by typing:<\/p>\n<div class=\"code-toolbar\">\n<div class=\"context\">\n<pre class=\"code-pre command prefixed language-bash\"><code class=\"code-highlight language-bash\">$ sudo ufw app list<\/code><\/pre>\n<\/div>\n<\/div>\n<p>You should get a listing of the application profiles:<\/p>\n<pre class=\"code-pre \"><code>Available applications:\r\n...\r\n  Nginx Full\r\n  Nginx HTTP\r\n  Nginx HTTPS\r\n...\r\n<\/code><\/pre>\n<p>As you can see, there are three profiles available for Nginx:<\/p>\n<ul>\n<li><strong>Nginx Full<\/strong>: This profile opens both port\u00a0<code>80<\/code>\u00a0(normal, unencrypted web traffic) and port\u00a0<code>443<\/code>\u00a0(TLS\/SSL encrypted traffic)<\/li>\n<li><strong>Nginx HTTP<\/strong>: This profile opens only port\u00a0<code>80<\/code>\u00a0(normal, unencrypted web traffic)<\/li>\n<li><strong>Nginx HTTPS<\/strong>: This profile opens only port\u00a0<code>443<\/code>\u00a0(TLS\/SSL encrypted traffic)<\/li>\n<\/ul>\n<p>It is recommended that you enable the most restrictive profile that will still allow the traffic you\u2019ve configured. Since we haven\u2019t configured SSL for our server yet in this guide, we will only need to allow traffic for HTTP on port\u00a0<code>80<\/code>.<\/p>\n<p>You can enable this by typing:<\/p>\n<div class=\"code-toolbar\">\n<div class=\"context\">\n<pre class=\"code-pre command prefixed language-bash\"><code class=\"code-highlight language-bash\">$ sudo ufw allow 'Nginx HTTP'<\/code><\/pre>\n<\/div>\n<p>You can verify the change by typing:<\/p>\n<div class=\"code-toolbar\">\n<div class=\"context\">\n<pre class=\"code-pre command prefixed language-bash\"><code class=\"code-highlight language-bash\">$ sudo ufw status<\/code><\/pre>\n<\/div>\n<\/div>\n<p>You should see HTTP traffic allowed in the displayed output:<\/p>\n<pre class=\"code-pre \"><code>Status: active\r\n\r\nTo                         Action      From\r\n--                         ------      ----\r\nOpenSSH                    ALLOW       Anywhere                  \r\nNginx HTTP                 ALLOW       Anywhere                  \r\nOpenSSH (v6)               ALLOW       Anywhere (v6)             \r\nNginx HTTP (v6)            ALLOW       Anywhere (v6)\r\n<\/code><\/pre>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Introduction Within the world, Nginx is one of the well known web servers and it is consider for hosting some of the most important and highest-traffic sites on the internet. As compare to Apache, Nginx is more of resource-friendly and might be used as an web server or reverse proxy. In this guide, we\u2019ll discuss [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23],"tags":[],"class_list":["post-1503","post","type-post","status-publish","format-standard","hentry","category-tutorials"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v15.2.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Install Nginx on Debian 10 - OWS KB<\/title>\n<meta name=\"description\" content=\"Nginx known as one amongst the popular web servers within the world and responsible for hosting some of the most important and highest-traffic sites on the internet.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/ownwebservers.com\/kb\/how-to-install-nginx-on-debian-10\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Install Nginx on Debian 10 - OWS KB\" \/>\n<meta property=\"og:description\" content=\"Nginx known as one amongst the popular web servers within the world and responsible for hosting some of the most important and highest-traffic sites on the internet.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ownwebservers.com\/kb\/how-to-install-nginx-on-debian-10\/\" \/>\n<meta property=\"og:site_name\" content=\"OWS KB\" \/>\n<meta property=\"article:published_time\" content=\"2021-08-30T11:02:22+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-08-30T13:02:14+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\">\n\t<meta name=\"twitter:data1\" content=\"admin\">\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\">\n\t<meta name=\"twitter:data2\" content=\"2 minutes\">\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/ownwebservers.com\/kb\/#website\",\"url\":\"https:\/\/ownwebservers.com\/kb\/\",\"name\":\"OWS KB\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":\"https:\/\/ownwebservers.com\/kb\/?s={search_term_string}\",\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/ownwebservers.com\/kb\/how-to-install-nginx-on-debian-10\/#webpage\",\"url\":\"https:\/\/ownwebservers.com\/kb\/how-to-install-nginx-on-debian-10\/\",\"name\":\"How to Install Nginx on Debian 10 - OWS KB\",\"isPartOf\":{\"@id\":\"https:\/\/ownwebservers.com\/kb\/#website\"},\"datePublished\":\"2021-08-30T11:02:22+00:00\",\"dateModified\":\"2021-08-30T13:02:14+00:00\",\"author\":{\"@id\":\"https:\/\/ownwebservers.com\/kb\/#\/schema\/person\/4a40fe3fe17a08ddd1d7c113668e75f2\"},\"description\":\"Nginx known as one amongst the popular web servers within the world and responsible for hosting some of the most important and highest-traffic sites on the internet.\",\"breadcrumb\":{\"@id\":\"https:\/\/ownwebservers.com\/kb\/how-to-install-nginx-on-debian-10\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/ownwebservers.com\/kb\/how-to-install-nginx-on-debian-10\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/ownwebservers.com\/kb\/how-to-install-nginx-on-debian-10\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"item\":{\"@type\":\"WebPage\",\"@id\":\"https:\/\/ownwebservers.com\/kb\/\",\"url\":\"https:\/\/ownwebservers.com\/kb\/\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"position\":2,\"item\":{\"@type\":\"WebPage\",\"@id\":\"https:\/\/ownwebservers.com\/kb\/how-to-install-nginx-on-debian-10\/\",\"url\":\"https:\/\/ownwebservers.com\/kb\/how-to-install-nginx-on-debian-10\/\",\"name\":\"How to Install Nginx on Debian 10\"}}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/ownwebservers.com\/kb\/#\/schema\/person\/4a40fe3fe17a08ddd1d7c113668e75f2\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/ownwebservers.com\/kb\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/ba5db5841d48bd7517bb2583e13983e6d2fa56a4099a0b3c61ad2daefc321303?s=96&d=mm&r=g\",\"caption\":\"admin\"},\"sameAs\":[\"https:\/\/ownwebservers.com\/kb\"]}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","_links":{"self":[{"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/posts\/1503","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/comments?post=1503"}],"version-history":[{"count":9,"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/posts\/1503\/revisions"}],"predecessor-version":[{"id":1523,"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/posts\/1503\/revisions\/1523"}],"wp:attachment":[{"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/media?parent=1503"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/categories?post=1503"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/tags?post=1503"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}