Install Nginx on CentOS

Nginx is a web server used to run web pages, similar to the Apache HTTP server with high performance. In this tutorial, I will show you how to install Nginx on CentOS!

First, because the CentOS default Repository does not contain Nginx’s installation package, you need to add a new repository named Extra Packages for Enterprise Linux (EPEL repository) to your operating system, by running the following command :

Install Nginx on CentOS

Enter Y to continue!

Result:

Install Nginx on CentOS

Now you can install Nginx.

Please run the following command!

Install Nginx on CentOS

Enter Y to continue.

Installation successful:

Install Nginx on CentOS

Now, let’s start Nginx:

To check the results, you can open your browser and request to the following address:

If you see the browser displays the following, then you have successfully installed Nginx:

Install Nginx on CentOS

If you want Nginx to automatically start when we start the OS, let’s run the following command:

If your server is using a firewall, then enable allow for users to access the port of http and https:

Reload the firewall configuration:

Add Comment