How to install nginx web server on CentOS or Debian

→ Are you a new visitor? Please visit the page guidance for new visitors ←

How to install nginx web server on CentOS or Debian

Nginx is one of the best web servers available on the internet, Cloudflare is using it to power up all their CDN servers, caching it, compressing data and speeding your website. For those who do not know, it can be used as a standalone server or together with another web server, like apache, as a reverse proxy configuration. Cloudflare for example is using Nginx as a reverse proxy configuration, with gzip active. In this article I’m going to show you real quick how you can install Nginx web server on CentOS or Debian.

Required repositories

From documentation we know that Nginx is available for CentOS 5 and CentOS 6 by default, as well as for Debian Wheezy or Squeeze, so basically we should be good to go if using the latest or previous version of your distribution.

Else you probably want to use Epel repository or directly from Nginx:

as for Debian, you can use:

 Install nginx on your system

To install nginx is really easy, based on the operating system, you use yum or apt to install the package.

  • CentOS

  •  Debian

After you’ve completed the installation you will have the following file configuration created by default:

The Nginx webserver can be controlled using:

So for now, let’s just start the service using the start command:

Then using your server IP, try loading it in your browser. Make sure port 80 is open and you should see a similar page like below:

Nginx default page

Nginx default page

→ Configuring nginx

Pages: 1 2

Request an article ←