Set Up

Step One—Install EPEL

EPEL stands for Extra Packages for Enterprise Linux. Because yum as a package manager does not include the latest version of nginx in its default repository, installing EPEL will make sure that nginx on CentOS stays up to date.

To install EPEL, open terminal and type in:

sudo yum install epel-release

Step Two—Install nginx

To install nginx, open terminal and type in:

sudo yum install nginx

After you answer yes to the prompt twice (the first time relates to importing the EPEL gpg-key), nginx will finish installing on your virtual private server.

Step Three—Start nginx

nginx does not start on its own. To get nginx running, type:

sudo /etc/init.d/nginx start

You can confirm that nginx has installed on your VPS by directing your browser to your IP address.