{"id":9454,"date":"2020-05-15T06:58:23","date_gmt":"2020-05-15T06:58:23","guid":{"rendered":"https:\/\/www.milesweb.in\/hosting-faqs\/?p=9454"},"modified":"2022-02-17T17:11:52","modified_gmt":"2022-02-17T11:41:52","slug":"how-to-install-nginx-on-ubuntu-16-04","status":"publish","type":"post","link":"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-install-nginx-on-ubuntu-16-04\/","title":{"rendered":"How to install Nginx on Ubuntu 16.04?"},"content":{"rendered":"<p>Nginx is a Linux web server that can be used as a reverse proxy, load balancer, mail proxy, and HTTP cache. It accelerates the content by utilizing very low resources and thus is known as a competitor to Apache. To install Nginx on Ubuntu 16.04 follow the steps mentioned in the tutorial.<\/p>\n<h2>Prerequisite :<\/h2>\n<p>To explain this tutorial we are working on Ubuntu 16.04 LTS server and also logged in as root.<\/p>\n<h3>#Steps to install Nginx<\/h3>\n<p><strong>1) Update Apt-Get<\/strong><\/p>\n<p>First, we will update and upgrade our packet manager using the following command.<\/p>\n<pre class=\"trim-whitespace:false lang:default decode:true \">apt-get update &amp;&amp; apt-get upgrade<\/pre>\n<p><strong>2) Install Nginx<\/strong><\/p>\n<p>Below command will install Nginx<\/p>\n<pre class=\"trim-whitespace:false lang:default decode:true \">apt-get -y install nginx<\/pre>\n<p><strong>3) Verify the installation of Nginx<\/strong><\/p>\n<p>If the Nginx is installed correctly, then an Nginx\u2019s default file will get appear in \/var\/www\/html as index.nginx-debian.html . In case you see the Apache default page then rename it as index.html file. Just like Apache, the port for Nginx is also port 80, which indicates that if you already have set your record A for your server\u2019s hostname, then you can visit the IP and verify if the installation of Nginx is completed. By the following command if you can get the IP of your server, in case if you don\u2019t have :<\/p>\n<pre class=\"trim-whitespace:false lang:default decode:true \">ip addr show eth0 | grep inet | awk '{ print $2; }' | sed 's\/\\\/.*$\/\/'<\/pre>\n<p>Now, use this IP command and visit via HTTP (http:\/\/xxx.xxx.xxx.xxx).<\/p>\n<p>Now you can see a similar screen as below, to verify the installation of Nginx.<\/p>\n<p><a href=\"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2020\/05\/Nginx-welcome.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-16083 size-full\" src=\"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2020\/05\/Nginx-welcome.png\" alt=\"Nginx welcome\" width=\"679\" height=\"414\" srcset=\"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2020\/05\/Nginx-welcome.png 679w, https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2020\/05\/Nginx-welcome-300x183.png 300w\" sizes=\"auto, (max-width: 679px) 100vw, 679px\" \/><\/a><\/p>\n<h3>How to change ports for Apache?<\/h3>\n<p>In case if you already have Apache established to port 80, then you may find the Apache default page when you visit your host IP. So, you can change this port, in order to make a place for Nginx to take over port 80. To change the Apache port, you will have to visit the Apache port configuration file :<\/p>\n<pre class=\"trim-whitespace:false lang:default decode:true \">vim \/etc\/apache2\/ports.conf<\/pre>\n<p>Here, change \u201cListen 80\u201d to any other port number, for example, we can use port 8080 :<\/p>\n<pre class=\"trim-whitespace:false lang:default decode:true \">Listen 8080<\/pre>\n<p>Now, to notice the changes, restart Apache,<\/p>\n<pre class=\"trim-whitespace:false lang:default decode:true \">service apache2 restart<\/pre>\n<p>All the things that Apache has can now be seen using your IP by replacing the x\u2019s.<\/p>\n<p>For example http:\/\/xxx.xxx.xxx.xxx:8080.<\/p>\n<p><strong>Also Read :<\/strong><\/p>\n<p><strong>1)\u00a0<a href=\"https:\/\/www.milesweb.in\/hosting-faqs\/block-ips-with-nginx\/\" target=\"_blank\" rel=\"noopener\">How to Block IPs with Nginx?<\/a><\/strong><\/p>\n<p><strong>2)\u00a0<a href=\"https:\/\/www.milesweb.in\/hosting-faqs\/steps-to-redirect-urls-using-nginx\/\" target=\"_blank\" rel=\"noopener\">Steps to Redirect URLs Using Nginx<\/a><\/strong><\/p>\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Nginx is a Linux web server that can be used as a reverse proxy, load balancer, mail proxy, and HTTP cache. It accelerates the content by utilizing very low resources and thus is known as a competitor to Apache. To install Nginx on Ubuntu 16.04 follow the steps mentioned in the tutorial. Prerequisite : To [&hellip;]<\/p>\n","protected":false},"author":18,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[41],"tags":[13,1449,647,872,1450,1451,1452,678],"class_list":["post-9454","post","type-post","status-publish","format-standard","placeholder-for-hentry","category-howtos","tag-apache","tag-apache2","tag-linux","tag-nginx","tag-optimization","tag-port","tag-ports","tag-ubuntu-16-04"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to install Nginx on Ubuntu 16.04? - Web Hosting FAQs by MilesWeb<\/title>\n<meta name=\"description\" content=\"A step by step process to install Nginx on Ubuntu 16.04.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-install-nginx-on-ubuntu-16-04\/\" \/>\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 Ubuntu 16.04? - Web Hosting FAQs by MilesWeb\" \/>\n<meta property=\"og:description\" content=\"A step by step process to install Nginx on Ubuntu 16.04.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-install-nginx-on-ubuntu-16-04\/\" \/>\n<meta property=\"og:site_name\" content=\"Web Hosting FAQs by MilesWeb\" \/>\n<meta property=\"article:published_time\" content=\"2020-05-15T06:58:23+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-02-17T11:41:52+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2020\/05\/Nginx-welcome.png\" \/>\n<meta name=\"author\" content=\"Sonam Wagh\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Sonam Wagh\" \/>\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\":\"Article\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-install-nginx-on-ubuntu-16-04\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-install-nginx-on-ubuntu-16-04\/\"},\"author\":{\"name\":\"Sonam Wagh\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/dc645d02823c86e07e53798ebe02c6f4\"},\"headline\":\"How to install Nginx on Ubuntu 16.04?\",\"datePublished\":\"2020-05-15T06:58:23+00:00\",\"dateModified\":\"2022-02-17T11:41:52+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-install-nginx-on-ubuntu-16-04\/\"},\"wordCount\":357,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-install-nginx-on-ubuntu-16-04\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2020\/05\/Nginx-welcome.png\",\"keywords\":[\"Apache\",\"Apache2\",\"Linux\",\"Nginx\",\"optimization\",\"Port\",\"Ports\",\"Ubuntu 16.04\"],\"articleSection\":[\"How-Tos\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-install-nginx-on-ubuntu-16-04\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-install-nginx-on-ubuntu-16-04\/\",\"url\":\"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-install-nginx-on-ubuntu-16-04\/\",\"name\":\"How to install Nginx on Ubuntu 16.04? - Web Hosting FAQs by MilesWeb\",\"isPartOf\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-install-nginx-on-ubuntu-16-04\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-install-nginx-on-ubuntu-16-04\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2020\/05\/Nginx-welcome.png\",\"datePublished\":\"2020-05-15T06:58:23+00:00\",\"dateModified\":\"2022-02-17T11:41:52+00:00\",\"author\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/dc645d02823c86e07e53798ebe02c6f4\"},\"description\":\"A step by step process to install Nginx on Ubuntu 16.04.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-install-nginx-on-ubuntu-16-04\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-install-nginx-on-ubuntu-16-04\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-install-nginx-on-ubuntu-16-04\/#primaryimage\",\"url\":\"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2020\/05\/Nginx-welcome.png\",\"contentUrl\":\"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2020\/05\/Nginx-welcome.png\",\"width\":679,\"height\":414,\"caption\":\"Nginx welcome\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-install-nginx-on-ubuntu-16-04\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.milesweb.in\/hosting-faqs\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to install Nginx on Ubuntu 16.04?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#website\",\"url\":\"https:\/\/www.milesweb.in\/hosting-faqs\/\",\"name\":\"Web Hosting FAQs by MilesWeb\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.milesweb.in\/hosting-faqs\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/dc645d02823c86e07e53798ebe02c6f4\",\"name\":\"Sonam Wagh\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2019\/12\/Sonam-Wagh-150x150.jpg\",\"contentUrl\":\"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2019\/12\/Sonam-Wagh-150x150.jpg\",\"caption\":\"Sonam Wagh\"},\"description\":\"With an interest in doing something creative daily, Sonam works as a Digital Marketing Executive. She likes to write technical blogs related to web hosting, digital marketing, and other IT topics. She also likes to spend her leisure time on social media to find different strategies for client engagement.\",\"url\":\"https:\/\/www.milesweb.in\/hosting-faqs\/author\/sonam\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to install Nginx on Ubuntu 16.04? - Web Hosting FAQs by MilesWeb","description":"A step by step process to install Nginx on Ubuntu 16.04.","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:\/\/www.milesweb.in\/hosting-faqs\/how-to-install-nginx-on-ubuntu-16-04\/","og_locale":"en_US","og_type":"article","og_title":"How to install Nginx on Ubuntu 16.04? - Web Hosting FAQs by MilesWeb","og_description":"A step by step process to install Nginx on Ubuntu 16.04.","og_url":"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-install-nginx-on-ubuntu-16-04\/","og_site_name":"Web Hosting FAQs by MilesWeb","article_published_time":"2020-05-15T06:58:23+00:00","article_modified_time":"2022-02-17T11:41:52+00:00","og_image":[{"url":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2020\/05\/Nginx-welcome.png","type":"","width":"","height":""}],"author":"Sonam Wagh","twitter_misc":{"Written by":"Sonam Wagh","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-install-nginx-on-ubuntu-16-04\/#article","isPartOf":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-install-nginx-on-ubuntu-16-04\/"},"author":{"name":"Sonam Wagh","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/dc645d02823c86e07e53798ebe02c6f4"},"headline":"How to install Nginx on Ubuntu 16.04?","datePublished":"2020-05-15T06:58:23+00:00","dateModified":"2022-02-17T11:41:52+00:00","mainEntityOfPage":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-install-nginx-on-ubuntu-16-04\/"},"wordCount":357,"commentCount":0,"image":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-install-nginx-on-ubuntu-16-04\/#primaryimage"},"thumbnailUrl":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2020\/05\/Nginx-welcome.png","keywords":["Apache","Apache2","Linux","Nginx","optimization","Port","Ports","Ubuntu 16.04"],"articleSection":["How-Tos"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.milesweb.in\/hosting-faqs\/how-to-install-nginx-on-ubuntu-16-04\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-install-nginx-on-ubuntu-16-04\/","url":"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-install-nginx-on-ubuntu-16-04\/","name":"How to install Nginx on Ubuntu 16.04? - Web Hosting FAQs by MilesWeb","isPartOf":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-install-nginx-on-ubuntu-16-04\/#primaryimage"},"image":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-install-nginx-on-ubuntu-16-04\/#primaryimage"},"thumbnailUrl":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2020\/05\/Nginx-welcome.png","datePublished":"2020-05-15T06:58:23+00:00","dateModified":"2022-02-17T11:41:52+00:00","author":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/dc645d02823c86e07e53798ebe02c6f4"},"description":"A step by step process to install Nginx on Ubuntu 16.04.","breadcrumb":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-install-nginx-on-ubuntu-16-04\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.milesweb.in\/hosting-faqs\/how-to-install-nginx-on-ubuntu-16-04\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-install-nginx-on-ubuntu-16-04\/#primaryimage","url":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2020\/05\/Nginx-welcome.png","contentUrl":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2020\/05\/Nginx-welcome.png","width":679,"height":414,"caption":"Nginx welcome"},{"@type":"BreadcrumbList","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/how-to-install-nginx-on-ubuntu-16-04\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.milesweb.in\/hosting-faqs\/"},{"@type":"ListItem","position":2,"name":"How to install Nginx on Ubuntu 16.04?"}]},{"@type":"WebSite","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#website","url":"https:\/\/www.milesweb.in\/hosting-faqs\/","name":"Web Hosting FAQs by MilesWeb","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.milesweb.in\/hosting-faqs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/dc645d02823c86e07e53798ebe02c6f4","name":"Sonam Wagh","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/image\/","url":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2019\/12\/Sonam-Wagh-150x150.jpg","contentUrl":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2019\/12\/Sonam-Wagh-150x150.jpg","caption":"Sonam Wagh"},"description":"With an interest in doing something creative daily, Sonam works as a Digital Marketing Executive. She likes to write technical blogs related to web hosting, digital marketing, and other IT topics. She also likes to spend her leisure time on social media to find different strategies for client engagement.","url":"https:\/\/www.milesweb.in\/hosting-faqs\/author\/sonam\/"}]}},"_links":{"self":[{"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/posts\/9454","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/users\/18"}],"replies":[{"embeddable":true,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/comments?post=9454"}],"version-history":[{"count":4,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/posts\/9454\/revisions"}],"predecessor-version":[{"id":16085,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/posts\/9454\/revisions\/16085"}],"wp:attachment":[{"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/media?parent=9454"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/categories?post=9454"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/tags?post=9454"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}