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 AlmaLinux 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.
Did you find this article helpful? Then you'll love our support. Experience the A2 Hosting difference today and get a pre-secured, pre-optimized website. Check out our web hosting plans today.
We use cookies to personalize the website for you and to analyze the use of our website. You consent to this by clicking on "I consent" or by continuing your use of this website. Further information about cookies can be found in our Privacy Policy.