How to Install Nginx on Ubuntu 16.04

Nginx is one among the foremost fashionable open supply internet server software system. it’s wide used for load equalisation, reverse proxying, media streaming and far a lot of. Nginx is that the solely all-in-one superior protocol server, designed to serve a high volume of simultaneous connections, as another to Apache internet server. nowadays Nginx is put in on quite 450 million servers worldwide and is employed by one among the best traffic websites on the online like Dropbox, Zynga games, Netflix. during this tutorial, we are going to show you the way to put in Nginx on Ubuntu 16.04.

install nginx ubuntu 16.04 There is not any question that Nginx is that the best-in-class internet server and application delivery answer. putting in Nginx on Ubuntu 16.04 is a simple task, simply rigorously follow the steps below and you ought to have Nginx put in on your Ubuntu server in but ten min. Let’s start.

Step 1: Install Nginx on Your Ubuntu Server

Nginx is available in the Ubuntu package repositories simple. First, update the apt cache with the following command:

sudo apt update

and install Nginx by issuing:

sudo apt install nginx

Once the installation is completed Nginx will be automatically started.You can make sure that Nginx service is running with the following command:

You can now open your browser, enter your server IP address into your browser address bar and you should see the default Nginx page.

Step 3: Managing Nginx Service

You can manage the Nginx service same as any other systemd unit.

Start the nginx service with the following command:

sudo systemctl start nginx

Stop the service with:

sudo systemctl stop nginx

Restart the service with:

sudo systemctl restart nginx

Check the status of the service with:

sudo systemctl status nginx

Enable the service on system boot with:

sudo systemctl enable nginx

Disable the service on system boot with:

sudo systemctl disable nginx

Step 4: Create a New Server Block

The default Nginx installation will have one server block enabled with a document root set to /var/www/html.In this guide, we will create a new server block for the domain example.com and set the document root to /var/www/example.com.