Nginx is a lightweight HTTP server, reverse proxy and email proxy server.

Pre-requisite

  • Already running Ubuntu platform.

Procedure

  1. Sign-in to your machine with the non-root user but a sudoer.
  2. Install Nginx with the following command using the terminal:
    sudo apt-get install nginx
  3. When you are asked Do you want to continue [Y/n]? press Enter and wait for it complete.

Validation

On the terminal run the following command:

curl http://localhost

If the installation was successful you will see  something similar to the following output:

If the output is not similar to the output above, most probably that the Nginx was not started after the installation. To start it, use the following command and repeat the curl command:

sudo service nginx start