How to Install Nginx on Different Linux Distributions?
In this section, we will see the installation guide for Nginx on various Linux distributions. Follow the commands of the respective distribution to install Nginx without any issues.
1. Debian/Ubuntu
On Debian-based systems, such as Ubuntu, the apt package manager is used to update package information and install Nginx, a popular and efficient web server.
sudo apt update
sudo apt install nginx
2. Red Hat/CentOS
For Red Hat and CentOS, the yum package manager installs the EPEL repository first, then installs Nginx, a high-performance web server.
sudo yum install epel-release
sudo yum install nginx
3. Fedora
On Fedora, the dnf package manager is used to install Nginx, a versatile and lightweight web server.
sudo dnf install nginx
4. Arch Linux
Arch Linux users can use pacman to install Nginx, a flexible and extensible web server.
sudo pacman -S nginx
5. openSUSE
openSUSE users can use the zypper package manager to install Nginx, a robust and scalable web server.
sudo zypper install nginx
6. FreeBSD
On FreeBSD, the pkg package manager installs Nginx, a high-performance and feature-rich web server.
sudo pkg install nginx
How to run NGINX for root & non-root
In Linux, there are two types of users namely root and non-root users. System privileges are given to the root user to perform more severe configurations as compared to non-root users. Nginx Web Server is one of the most important utilities to host the static contents on the server, running this configuration is the core task. In this article, we will see the entire steps to run Nginx Web Server for root & non-root users.