This article describes how to install Nginx, a popular web server noted for its high performance. Nginx was originally designed as an alternative to the Apache web server, with an emphasis on speed.
To install Nginx, follow the appropriate procedure below for the Linux distribution installed on your server. If your server does not use any of the following Linux distributions, see the documentation for your distribution for information about how to install Nginx.
To install Nginx on Debian and Ubuntu, follow these steps:
apt update apt install nginx
To install Nginx on CentOS and Fedora, follow these steps:
yum -y update yum -y install epel-release yum -y install nginx systemctl enable nginx
The default document root directory location varies depending on the Linux distribution you are using:
To publish content, place your files in the document root directory so site visitors can access them.
To view the official online documentation for Nginx, please visit http://nginx.org/en/docs.