Nginx is known as a web server with high-performance and low resource consumption. It’s popularity is almost similar to Apache as the most popular web server. This post will describes how to install nginx on CentOS 8.
CentOS 8 with root user or sudo user access.
- Run this command to install the nginx
sudo dnf install nginx
- Run this command to start nginx service
sudo systemctl start nginx
- Run this command to check nginx service’s status
sudo systemctl status nginx
You should see output like this
- Run this command to start nginx service on boot
sudo systemctl enable nginx
- Nginx has been running but you need to configure the firewall to allow http connection to the CentOS
sudo firewall-cmd --permanent --add-service=http sudo firewall-cmd --reload
Now you can open your browser and enter the url with the CentOS ip address, then you should see the default page of nginx in your browser.