NGINX is an open source web server that can handle hundreds of thousands of concurrent connections and powers more than half of the busiest sites on the web. In this post, you will learn how to install NGINX on Ubuntu 16.04.
You might find the following tutorials useful before installing NGINX.
- How to Install Ubuntu Server 16.04 on a Software RAID 1 (Mirror).
- How to Configure Ubuntu Server 16.04 to Use a Static IP Address.
- How to Connect to Ubuntu with SSH.
First of all, update the system by running the following commands:
sudo apt-get update && sudo apt-get upgrade -y
Now install NGINX with the following command:
sudo apt-get install nginx -y
NGINX should now be installed.
Test to see if NGINX was installed by opening a web browser and entering the IP address of the Ubuntu machine.
As you can see from the image above NGINX is now installed and serving a test web page.
The default server configuration file is located at
/etc/nginx/sites-available/default and specifies a document root of
You can modify the default web page by editing the local file at
/var/www/html/index.nginx-debian.html. It’s usually a good idea to modify this page to display information about your company, which is displayed when a visitor types in the IP address or hostname of the web server.
If you are hosting multiple web sites on the server, it’s best practice to leave the default config file as it is and then create virtual host configurations for each site you want to host instead.
You can learn more about virtual hosts in a future post titled: How to Set Up NGINX Virtual Hosts on Ubuntu 16.04. If you have any questions about NGINX, leave them in the comments below.