{"id":516,"date":"2018-10-06T22:51:14","date_gmt":"2018-10-06T22:51:14","guid":{"rendered":"https:\/\/draculaservers.com\/tutorials\/?p=516"},"modified":"2024-01-18T13:56:35","modified_gmt":"2024-01-18T13:56:35","slug":"install-nginx-ubuntu-18-04","status":"publish","type":"post","link":"https:\/\/draculaservers.com\/tutorials\/install-nginx-ubuntu-18-04\/","title":{"rendered":"Install and Configure Nginx on a Server running Ubuntu 18.04"},"content":{"rendered":"<h2 id=\"introduction\">Introduction<\/h2>\n<p><strong>Nginx<\/strong> <em>(pronounced engine-x)<\/em> is an open source high-performance web server that was written to address some of the performance issues associated with Apache. While some may consider it less user friendly than Apache, it is a great alternative to it. It is still one of the most popular web servers and it\u2019s responsible for hosting some of the most popular websites on the internet.<\/p>\n\n<h2 id=\"installation\">Installation<\/h2>\n<p>Log into your server to begin.<\/p>\n<p>Assuming this is the first time logging into our server, we\u2019ll update our local package index to make sure we\u2019ve got the latest package listings, afterwards we\u2019ll install Nginx.<\/p>\n<pre><code>$ sudo apt update\r\n$ sudo apt install nginx<\/code><\/pre>\n<p>Now Nginx should be installed and running.<\/p>\n<p>You can check if everything\u2019s working by typing:<\/p>\n<pre><code>$ systemctl status nginx<\/code><\/pre>\n<div class=\"showyourterms regular nostatusbar\" data-title=\"root@draculaservers\">\n<div class=\"command\" data-action=\"command\" data-delay=\"400\" data-speed=\"50\">systemctl&nbsp;status&nbsp;nginx<\/div><div class=\"line\" data-delay=\"10\" data-speed=\"50\">\u25cf&nbsp;nginx.service&nbsp;--&nbsp;A&nbsp;high&nbsp;performance&nbsp;web&nbsp;server&nbsp;and&nbsp;a&nbsp;reverse&nbsp;proxy&nbsp;server<\/div><div class=\"line\" data-delay=\"10\" data-speed=\"50\">Loaded:&nbsp;loaded&nbsp;(\/lib\/systemd\/system\/nginx.service;&nbsp;enabled;&nbsp;vendor&nbsp;preset:&nbsp;enabled)<\/div><div class=\"line\" data-delay=\"10\" data-speed=\"50\">Active:&nbsp;active&nbsp;(running)&nbsp;since&nbsp;Fri&nbsp;2018-10-05&nbsp;14:59:55&nbsp;PDT;&nbsp;21h&nbsp;ago<\/div><div class=\"line\" data-delay=\"10\" data-speed=\"50\">Docs:&nbsp;man:nginx(8)<\/div><div class=\"line\" data-delay=\"10\" data-speed=\"50\">Main&nbsp;PID:&nbsp;1542&nbsp;(nginx)<\/div><div class=\"line\" data-delay=\"10\" data-speed=\"50\">Tasks:&nbsp;2&nbsp;(limit:&nbsp;2270)<\/div><div class=\"line\" data-delay=\"10\" data-speed=\"50\">CGroup:&nbsp;\/system.slice\/nginx.service<\/div><div class=\"line\" data-delay=\"10\" data-speed=\"50\">\u251c\u25001542&nbsp;nginx:&nbsp;master&nbsp;process&nbsp;\/usr\/sbin\/nginx&nbsp;-g&nbsp;daemon&nbsp;on;&nbsp;master_process&nbsp;on;<\/div><div class=\"line\" data-delay=\"10000\" data-speed=\"50\">\u2514\u25001543&nbsp;nginx:&nbsp;worker&nbsp;process<\/div>   <\/div>\n<p>The output of the command suggests that it\u2019s running.<\/p>\n<p>The best way to check, however, is to make sure that Nginx is serving up pages in the browser. To do this you can just navigate to your server\u2019s IP address in the browser.<\/p>\n<p>Say your server\u2019s IP is <code>87.65.43.21<\/code>, then you\u2019ll visit <code>http:\/\/87.65.43.21<\/code><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-565\" src=\"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2018\/10\/nginx_default_page.png\" alt=\"nginx_default_page\" width=\"963\" height=\"380\" srcset=\"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2018\/10\/nginx_default_page.png 963w, https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2018\/10\/nginx_default_page-300x118.png 300w, https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2018\/10\/nginx_default_page-768x303.png 768w\" sizes=\"auto, (max-width: 963px) 100vw, 963px\" \/><\/p>\n<p>This is the default page included with Nginx so you can check if everything\u2019s working.<\/p>\n<h2 id=\"managing-nginx\">Managing Nginx<\/h2>\n<p>Let\u2019s learn some basic commands before moving forward.<\/p>\n<p>Stop the Nginx<\/p>\n<pre><code>$ sudo systemctl stop nginx.service<\/code><\/pre>\n<p>Start Nginx<\/p>\n<pre><code>$ sudo systemctl start nginx.service<\/code><\/pre>\n<p>Restart Nginx<\/p>\n<pre><code>$ sudo systemctl restart nginx.service<\/code><\/pre>\n<p>Reload ( After you change some configurations, this command reloads Nginx without restarting it )<\/p>\n<pre><code>$ sudo systemctl reload nginx.service<\/code><\/pre>\n<h3 id=\"setting-up-a-server-block-adding-a-basic-site\">Setting up a Server Block &amp; Adding a Basic Site<\/h3>\n<p>Nginx web server uses server blocks to encapsulate configurations that you can use to host one or multiple websites on your server. As an example, we\u2019re setting up a domain called beholdmystuff.com &#8211; you should replace this with your own domain name.<\/p>\n<p>The default server block set up upon Nginx installation is configured to server files out of the <code>\/var\/www\/html<\/code> directory. While this works well for a single site, it could get complicated if you wanted to host multiple sites on the same server.<\/p>\n<p>A good practice is to use a directory structure to server different sites from different directories. So let\u2019s create the following directory <code>\/var\/www\/beholdmystuff.com\/html<\/code> from where to serve our files.<\/p>\n<p>Following this example you could set up directories for other sites you\u2019d want to host alongside this one.<\/p>\n<p>Example:<br \/>\n<code>\/var\/www\/website1.com\/html<\/code> to serve website1.com<br \/>\n<code>\/var\/www\/website2.com\/html<\/code> to server website2.com<\/p>\n<p>Getting back to our live example, let\u2019s create our beholdmystuff.com directory, using the <code>-p<\/code> flag to create any necessary parent directories:<\/p>\n<pre><code>$ sudo mkdir -p \/var\/www\/beholdmystuff.com\/html<\/code><\/pre>\n<p>Now we\u2019ll assign ownership of the directory to the <code>$USER<\/code> environment variable ( in our case it\u2019s <code>root<\/code> ):<\/p>\n<pre><code>$ sudo chown -R $USER:USER \/var\/www\/beholdmystuff.com\/html<\/code><\/pre>\n<p>Next, let\u2019s create a simple <code>index.html<\/code> page using our favoite text editor. I\u2019m a <code>nano<\/code> guy so I\u2019m using nano ( pls don\u2019t judge ):<\/p>\n<pre><code>$ nano \/var\/www\/beholdmystuff.com\/html\/index.html<\/code><\/pre>\n<p>Add the following HTML to it:<\/p>\n<pre>&lt;h1&gt;... My stuff&lt;\/h1&gt;\r\n<\/pre>\n<p>Save and close it when you are finished.<\/p>\n<p>For Nginx to serve the content, it needs a server block with the correct directives. We won\u2019t be modifying the default server block, but we\u2019ll create a new one at <code>\/etc\/nginx\/sites-available\/beholdmystuff.com<\/code><\/p>\n<pre><code>$ sudo nano \/etc\/nginx\/sites-available\/beholdmystuff.com<\/code><\/pre>\n<p>Now paste in the following configuration block. It\u2019s similar to the default one, but modified for our new directory <code>\/var\/www\/beholdmystuff.com\/html<\/code><\/p>\n<pre title=\"\/etc\/nginx\/sites-available\/beholdmystuff.com\"><code>server {\r\n        listen 80;\r\n        listen [::]:80;\r\n\r\n        root \/var\/www\/beholdmystuff.com\/html;\r\n        index index.html index.htm index.nginx-debian.html;\r\n\r\n        server_name beholdmystuff.com www.beholdmystuff.com;\r\n\r\n        location \/ {\r\n                try_files $uri $uri\/ =404;\r\n        }\r\n}<\/code><\/pre>\n<p>NOTE: If you don\u2019t have a domain name ready, and want to just test things out, you can use the server\u2019s IP as the <code>server_name<\/code>. This means you can replace <code>server_name beholdmystuff.com www.beholdmystuff.com;<\/code> with <code>server_name your_server_ip;<\/code><\/p>\n<p>Now we\u2019ll enable the file by linking it to <code>sites-enabled<\/code> , which Nginx reads during startup.<\/p>\n<pre><code>$ sudo ln -s \/etc\/nginx\/sites-available\/beholdmystuff.com \/etc\/nginx\/sites-enabled\/<\/code><\/pre>\n<p>Right now, there are two server blocks enabled to respond to requests. This one that we\u2019ve just created and the default one that Nginx set up.<\/p>\n<p><code>beholdmystuff.com<\/code>: Will respond to requests for <code>beholdmystuff.com<\/code> and <code>www.beholdmystuff.com<\/code>.<\/p>\n<p><code>default<\/code>: Will respond to any requests on port 80 that do not match the other two blocks.<\/p>\n<p>To avoid a possible hash bucket memory problem that can arise from adding additional server names, it is necessary to adjust a single value in the <code>\/etc\/nginx\/nginx.conf<\/code> file. Open the file:<\/p>\n<pre><code>sudo nano \/etc\/nginx\/nginx.conf<\/code><\/pre>\n<p>Find the <code>server_names_hash_bucket_size<\/code> directive and uncomment it by removing the <code>#<\/code> symbol.<\/p>\n<pre title=\"\/etc\/nginx\/nginx.conf\"><code>...\r\nhttp {\r\n    ...\r\n    server_names_hash_bucket_size 64;\r\n    ...\r\n     }\r\n...<\/code><\/pre>\n<p>Save and close the file when you\u2019re finished.<\/p>\n<p>Now we\u2019ll use <code>nginx -t<\/code> to check if there are any syntax errors.<\/p>\n<pre><code>$ sudo nginx -t<\/code><\/pre>\n<p>If there aren\u2019t any issues we can restart Nginx to enable our changes:<\/p>\n<pre><code>$ sudo systemctl restart nginx<\/code><\/pre>\n<p>Nginx should be serving your doman name. Visit your domain in your browser, or your IP (if you used your IP as <code>server_name<\/code> ). You should see something like this:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-567\" src=\"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2018\/10\/beholdmystuff.png\" alt=\"behold_my_stuff\" width=\"382\" height=\"199\" srcset=\"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2018\/10\/beholdmystuff.png 382w, https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2018\/10\/beholdmystuff-300x156.png 300w\" sizes=\"auto, (max-width: 382px) 100vw, 382px\" \/><\/p>\n<p>Awesome!<\/p>\n<p>Now that you\u2019ve successfully set up Nginx you should check out an overview of some of the most important files and directories. You don\u2019t have to memorize them, it\u2019ll just save you a lot of time later on when you\u2019re experimenting yourself and getting into more advanced configurations.<\/p>\n<h2 id=\"nginx-important-configuration-files\">Nginx Important Configuration Files<\/h2>\n<p>We recommend you get familiar with important Nginx files and directories. You can skip if you\u2019d like but it\u2019s good to get at least an overview of these so you can configure things yourself later on.<\/p>\n<h3 id=\"content\">Content<\/h3>\n<p><code>\/var\/www\/html<\/code> &#8211; this is where your web content resides. The default page you saw earlier is called <code>index.nginx-debian.html<\/code> and is the only file there right now. Your content is served from here by default.<\/p>\n<p>Check by typing:<\/p>\n<pre><code>$ ls \/var\/www\/html<\/code><\/pre>\n<div class=\"showyourterms regular nostatusbar\" data-title=\"root@draculaservers\">\n<div class=\"command\" data-action=\"command\" data-delay=\"400\" data-speed=\"50\">ls&nbsp;\/var\/www\/html<\/div><div class=\"line\" data-delay=\"10000\" data-speed=\"50\">index.nginx-debian.html<\/div>   <\/div>\n<p>You can modify the Nginx config files to server pages from a different directory, but this one is the default.<\/p>\n<h3 id=\"server-configuration\">Server Configuration<\/h3>\n<p>The Nginx configuration files are located in <code>\/etc\/nginx<\/code> and the main configuration file is <code>nginx.conf<\/code>, which puts all the pieces together by including all of the configuration files when you start the web server.<\/p>\n<p><code>\/etc\/nginx<\/code>: This is where the configuration files are located.<\/p>\n<p><code>\/etc\/nginx\/nginx.conf<\/code>: The primary configuration file which puts all the pieces together by including all the configuration files when you start the web server. This can be modified to change Nginx global configurations.<\/p>\n<p><code>\/etc\/nginx\/sites-available<\/code>: This directory contains the server blocks for each of your websites. For Nginx to use these configuration files they must be linked in <code>\/etc\/nginx\/sites-enabled<\/code> . Your typical flow will be to create a server block for a website here, and then enable it in <code>sites-enabled<\/code> so that Nginx can serve it.<\/p>\n<p><code>\/etc\/nginx\/sites-enabled<\/code>: The directory where you\u2019ll enabled websites that you want to be served. This is done by linking to the configuration files found in <code>\/etc\/nginx\/sites-available<\/code><\/p>\n<p><code>\/etc\/nginx\/snippets<\/code>: This directory contains configuration snippets that you can reuse and include in the Nginx configuration.<\/p>\n<h3 id=\"logs\">Logs<\/h3>\n<p><code>\/var\/log\/nginx\/access.log<\/code>: Every request to the webserver is recorded here, unless you configure Nginx to do otherwise.<\/p>\n<p><code>\/var\/log\/nginx\/error.log<\/code>: Here\u2019s where Nginx errors are recorded.<\/p>\n<h3 id=\"conclusion\">Conclusion<\/h3>\n<p>Now you should have the basic info on how to set up a basic website using Nginx and be well on your way to setting up fast websites that can handle a good deal of requests.<\/p>\n<p>Should you need an affordable server to set up your websites or just experiment you can check out or <a href=\"https:\/\/draculaservers.com\/kvm.php\" target=\"_blank\" rel=\"noopener\">2GB RAM KVM VPS Plan<\/a> starting at just $9.99.<\/p>\n<p>Don\u2019t hesitate to let us know if this tutorial worked for you or if you need extra clarification, if you get errors etc.<\/p>\n<p>Happy hosting!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction Nginx (pronounced engine-x) is an open source high-performance web server that was written to address some of the performance issues associated with Apache. While some may consider it less user friendly than Apache, it is a great alternative to it. It is still one of the most popular web servers and it\u2019s responsible for [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":570,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,6,22],"tags":[],"class_list":["post-516","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-getting-started","category-hosting","category-ubuntu"],"blocksy_meta":{"styles_descriptor":{"styles":{"desktop":"","tablet":"","mobile":""},"google_fonts":[],"version":6}},"featured_image_urls_v2":{"full":["https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2018\/10\/How-to-install-Nginx-on-Ubuntu-18.04.png",1024,512,false],"thumbnail":["https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2018\/10\/How-to-install-Nginx-on-Ubuntu-18.04-150x150.png",150,150,true],"medium":["https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2018\/10\/How-to-install-Nginx-on-Ubuntu-18.04-300x150.png",300,150,true],"medium_large":["https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2018\/10\/How-to-install-Nginx-on-Ubuntu-18.04-768x384.png",768,384,true],"large":["https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2018\/10\/How-to-install-Nginx-on-Ubuntu-18.04.png",1024,512,false],"1536x1536":["https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2018\/10\/How-to-install-Nginx-on-Ubuntu-18.04.png",1024,512,false],"2048x2048":["https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2018\/10\/How-to-install-Nginx-on-Ubuntu-18.04.png",1024,512,false],"pk-small":["https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2018\/10\/How-to-install-Nginx-on-Ubuntu-18.04-80x80.png",80,80,true],"pk-thumbnail":["https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2018\/10\/How-to-install-Nginx-on-Ubuntu-18.04-300x225.png",300,225,true]},"post_excerpt_stackable_v2":"<p>Introduction Nginx (pronounced engine-x) is an open source high-performance web server that was written to address some of the performance issues associated with Apache. While some may consider it less user friendly than Apache, it is a great alternative to it. It is still one of the most popular web servers and it\u2019s responsible for hosting some of the most popular websites on the internet. Installation Log into your server to begin. Assuming this is the first time logging into our server, we\u2019ll update our local package index to make sure we\u2019ve got the latest package listings, afterwards we\u2019ll install&hellip;<\/p>\n","category_list_v2":"<a href=\"https:\/\/draculaservers.com\/tutorials\/category\/getting-started\/\" rel=\"category tag\">Getting Started<\/a>, <a href=\"https:\/\/draculaservers.com\/tutorials\/category\/hosting\/\" rel=\"category tag\">Hosting<\/a>, <a href=\"https:\/\/draculaservers.com\/tutorials\/category\/ubuntu\/\" rel=\"category tag\">Ubuntu<\/a>","author_info_v2":{"name":"Vlad","url":"https:\/\/draculaservers.com\/tutorials\/author\/vlad\/"},"comments_num_v2":"0 comments","yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Step-by-Step Guide: How to Install Nginx on Ubuntu 18.04<\/title>\n<meta name=\"description\" content=\"Follow this tutorial to install and configure Nginx, the high-performance open-source web server designed to host some of the internet&#039;s most visited websites.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/draculaservers.com\/tutorials\/install-nginx-ubuntu-18-04\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Step-by-Step Guide: How to Install Nginx on Ubuntu 18.04\" \/>\n<meta property=\"og:description\" content=\"Follow this tutorial to install and configure Nginx, the high-performance open-source web server designed to host some of the internet&#039;s most visited websites.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/draculaservers.com\/tutorials\/install-nginx-ubuntu-18-04\/\" \/>\n<meta property=\"og:site_name\" content=\"Dracula Servers Tutorials\" \/>\n<meta property=\"article:published_time\" content=\"2018-10-06T22:51:14+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-01-18T13:56:35+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2018\/10\/How-to-install-Nginx-on-Ubuntu-18.04.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1024\" \/>\n\t<meta property=\"og:image:height\" content=\"512\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Vlad\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Vlad\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/install-nginx-ubuntu-18-04\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/install-nginx-ubuntu-18-04\\\/\"},\"author\":{\"name\":\"Vlad\",\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/931f7fa8b2126ace6edfb82775e0ec0e\"},\"headline\":\"Install and Configure Nginx on a Server running Ubuntu 18.04\",\"datePublished\":\"2018-10-06T22:51:14+00:00\",\"dateModified\":\"2024-01-18T13:56:35+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/install-nginx-ubuntu-18-04\\\/\"},\"wordCount\":1226,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/install-nginx-ubuntu-18-04\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2018\\\/10\\\/How-to-install-Nginx-on-Ubuntu-18.04.png\",\"articleSection\":[\"Getting Started\",\"Hosting\",\"Ubuntu\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/install-nginx-ubuntu-18-04\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/install-nginx-ubuntu-18-04\\\/\",\"url\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/install-nginx-ubuntu-18-04\\\/\",\"name\":\"Step-by-Step Guide: How to Install Nginx on Ubuntu 18.04\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/install-nginx-ubuntu-18-04\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/install-nginx-ubuntu-18-04\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2018\\\/10\\\/How-to-install-Nginx-on-Ubuntu-18.04.png\",\"datePublished\":\"2018-10-06T22:51:14+00:00\",\"dateModified\":\"2024-01-18T13:56:35+00:00\",\"description\":\"Follow this tutorial to install and configure Nginx, the high-performance open-source web server designed to host some of the internet's most visited websites.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/install-nginx-ubuntu-18-04\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/install-nginx-ubuntu-18-04\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/install-nginx-ubuntu-18-04\\\/#primaryimage\",\"url\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2018\\\/10\\\/How-to-install-Nginx-on-Ubuntu-18.04.png\",\"contentUrl\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2018\\\/10\\\/How-to-install-Nginx-on-Ubuntu-18.04.png\",\"width\":1024,\"height\":512,\"caption\":\"install_nginx_ubuntu_cover\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/install-nginx-ubuntu-18-04\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Install and Configure Nginx on a Server running Ubuntu 18.04\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/#website\",\"url\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/\",\"name\":\"Dracula Servers Tutorials\",\"description\":\"Dedicated Servers\",\"publisher\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/#organization\",\"name\":\"Dracula Servers\",\"url\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2016\\\/06\\\/dracula_full_logo_smaller.png\",\"contentUrl\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2016\\\/06\\\/dracula_full_logo_smaller.png\",\"width\":1625,\"height\":200,\"caption\":\"Dracula Servers\"},\"image\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/931f7fa8b2126ace6edfb82775e0ec0e\",\"name\":\"Vlad\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/499c7a24aa9727703300a291f8f69dfd1b01b8d6a19a4ae4fbe669b4b12b8cbe?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/499c7a24aa9727703300a291f8f69dfd1b01b8d6a19a4ae4fbe669b4b12b8cbe?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/499c7a24aa9727703300a291f8f69dfd1b01b8d6a19a4ae4fbe669b4b12b8cbe?s=96&d=mm&r=g\",\"caption\":\"Vlad\"},\"description\":\"Tech Support\",\"sameAs\":[\"https:\\\/\\\/draculaservers.com\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Step-by-Step Guide: How to Install Nginx on Ubuntu 18.04","description":"Follow this tutorial to install and configure Nginx, the high-performance open-source web server designed to host some of the internet's most visited websites.","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:\/\/draculaservers.com\/tutorials\/install-nginx-ubuntu-18-04\/","og_locale":"en_US","og_type":"article","og_title":"Step-by-Step Guide: How to Install Nginx on Ubuntu 18.04","og_description":"Follow this tutorial to install and configure Nginx, the high-performance open-source web server designed to host some of the internet's most visited websites.","og_url":"https:\/\/draculaservers.com\/tutorials\/install-nginx-ubuntu-18-04\/","og_site_name":"Dracula Servers Tutorials","article_published_time":"2018-10-06T22:51:14+00:00","article_modified_time":"2024-01-18T13:56:35+00:00","og_image":[{"width":1024,"height":512,"url":"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2018\/10\/How-to-install-Nginx-on-Ubuntu-18.04.png","type":"image\/png"}],"author":"Vlad","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Vlad","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/draculaservers.com\/tutorials\/install-nginx-ubuntu-18-04\/#article","isPartOf":{"@id":"https:\/\/draculaservers.com\/tutorials\/install-nginx-ubuntu-18-04\/"},"author":{"name":"Vlad","@id":"https:\/\/draculaservers.com\/tutorials\/#\/schema\/person\/931f7fa8b2126ace6edfb82775e0ec0e"},"headline":"Install and Configure Nginx on a Server running Ubuntu 18.04","datePublished":"2018-10-06T22:51:14+00:00","dateModified":"2024-01-18T13:56:35+00:00","mainEntityOfPage":{"@id":"https:\/\/draculaservers.com\/tutorials\/install-nginx-ubuntu-18-04\/"},"wordCount":1226,"commentCount":0,"publisher":{"@id":"https:\/\/draculaservers.com\/tutorials\/#organization"},"image":{"@id":"https:\/\/draculaservers.com\/tutorials\/install-nginx-ubuntu-18-04\/#primaryimage"},"thumbnailUrl":"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2018\/10\/How-to-install-Nginx-on-Ubuntu-18.04.png","articleSection":["Getting Started","Hosting","Ubuntu"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/draculaservers.com\/tutorials\/install-nginx-ubuntu-18-04\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/draculaservers.com\/tutorials\/install-nginx-ubuntu-18-04\/","url":"https:\/\/draculaservers.com\/tutorials\/install-nginx-ubuntu-18-04\/","name":"Step-by-Step Guide: How to Install Nginx on Ubuntu 18.04","isPartOf":{"@id":"https:\/\/draculaservers.com\/tutorials\/#website"},"primaryImageOfPage":{"@id":"https:\/\/draculaservers.com\/tutorials\/install-nginx-ubuntu-18-04\/#primaryimage"},"image":{"@id":"https:\/\/draculaservers.com\/tutorials\/install-nginx-ubuntu-18-04\/#primaryimage"},"thumbnailUrl":"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2018\/10\/How-to-install-Nginx-on-Ubuntu-18.04.png","datePublished":"2018-10-06T22:51:14+00:00","dateModified":"2024-01-18T13:56:35+00:00","description":"Follow this tutorial to install and configure Nginx, the high-performance open-source web server designed to host some of the internet's most visited websites.","breadcrumb":{"@id":"https:\/\/draculaservers.com\/tutorials\/install-nginx-ubuntu-18-04\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/draculaservers.com\/tutorials\/install-nginx-ubuntu-18-04\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/draculaservers.com\/tutorials\/install-nginx-ubuntu-18-04\/#primaryimage","url":"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2018\/10\/How-to-install-Nginx-on-Ubuntu-18.04.png","contentUrl":"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2018\/10\/How-to-install-Nginx-on-Ubuntu-18.04.png","width":1024,"height":512,"caption":"install_nginx_ubuntu_cover"},{"@type":"BreadcrumbList","@id":"https:\/\/draculaservers.com\/tutorials\/install-nginx-ubuntu-18-04\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/draculaservers.com\/tutorials\/"},{"@type":"ListItem","position":2,"name":"Install and Configure Nginx on a Server running Ubuntu 18.04"}]},{"@type":"WebSite","@id":"https:\/\/draculaservers.com\/tutorials\/#website","url":"https:\/\/draculaservers.com\/tutorials\/","name":"Dracula Servers Tutorials","description":"Dedicated Servers","publisher":{"@id":"https:\/\/draculaservers.com\/tutorials\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/draculaservers.com\/tutorials\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/draculaservers.com\/tutorials\/#organization","name":"Dracula Servers","url":"https:\/\/draculaservers.com\/tutorials\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/draculaservers.com\/tutorials\/#\/schema\/logo\/image\/","url":"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2016\/06\/dracula_full_logo_smaller.png","contentUrl":"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2016\/06\/dracula_full_logo_smaller.png","width":1625,"height":200,"caption":"Dracula Servers"},"image":{"@id":"https:\/\/draculaservers.com\/tutorials\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/draculaservers.com\/tutorials\/#\/schema\/person\/931f7fa8b2126ace6edfb82775e0ec0e","name":"Vlad","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/499c7a24aa9727703300a291f8f69dfd1b01b8d6a19a4ae4fbe669b4b12b8cbe?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/499c7a24aa9727703300a291f8f69dfd1b01b8d6a19a4ae4fbe669b4b12b8cbe?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/499c7a24aa9727703300a291f8f69dfd1b01b8d6a19a4ae4fbe669b4b12b8cbe?s=96&d=mm&r=g","caption":"Vlad"},"description":"Tech Support","sameAs":["https:\/\/draculaservers.com"]}]}},"_links":{"self":[{"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/posts\/516","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/comments?post=516"}],"version-history":[{"count":6,"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/posts\/516\/revisions"}],"predecessor-version":[{"id":2704,"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/posts\/516\/revisions\/2704"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/media\/570"}],"wp:attachment":[{"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/media?parent=516"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/categories?post=516"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/tags?post=516"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}