How to Install Nginx Stack on Centos Complete Guide - MakeSureHow
Edit Article

  • 1 Editor

This article is all about setting up your VPS so that you can too host your very own websites. In this article we will set up and build a working CentOS VPS so that it may host websites by using Nginx. In addition to that this will also contain the steps to install full LNMP stack in less than 15 minutes. Along with the LNMP stack it will include installation of MariaDB MySQL, CSF Firewall and PHP5. This article that I am writing here for you is just a very short method guide for CentOS. Though it is short it is not incomplete in any way. If there are still doubts in your head about following this article then you may refer to my other article on How to install Nginx on Centos 7.

So now that we have talked a bit about what this article is, let me tell you that we will use Centmin Mod as a part of this whole process. Centmin Mod is nothing but a LEMP (Linux, Nginx, MariaDB MySQL and PHP-fpm) web stack installer that is designed for CentOS Linux.

Let us talk a bit about Nginx. Nginx is RAM friendly and free so people prefer it over Apache. Some even say that it is a much better Alternative to Apache. The second reason people prefer to use Nginx is that because of Lightweight. The size and CPU usage that Nginx shows after installation is amazingly low if compared to Apache. Performance wise Nginx is better than Apache too. When the number of concurrent visitors on your site increases, Nginx shows better performance when compared with Apache. Due to its structural difference with Apache Nginx lacks the number of users that familiarize it. The one and only downside of Nginx is that not many people can familiarize themselves with this software because it differs from Apache where the anatomic and structural point of view. Because of this, Nginx does not support Apache’s .htaccess. Due to these incompatibility users covert their htaccess contents to Nginx configurations and vice versa.

Now that we have cleared out and established some key points about Nginx, let’s come over to the other vital factor of our article. We are talking about Centmin Mod. Centmin is a very handy nice little software that is basically a Linux shell script used to build a working web server. As a result of this you can host all your websites on CentOS VPS or Dedi server. This script will help you install LEMP / LNMP stack which includes; PHP, MYSQL, LINUX and NGINX on your web server. Along with all of these Centmin will also install some additional but necessary software like CSF and Postfix so that your VPS can now behave as a web hosting server. According to my knowledge Centmin supported CentOS 6.5 but its recent updates suggest that it now also supports CentOS 7 which was previously a work in progress. If you want to read more about Centmin Mod you can click the link here.


  1. The first thing that you will need is a VPS or a dedicated Server that has a minimum of 512 MB RAM.
  2. You will need freshly installed CentOS 6.x or CentOS 7.x. Support for CentOS 7.x was not there but the developers made it clear that Centmin does support it now.
  3. You will need Centmin Mod installer package.
  4. A basic knowledge about SSH commands.
  5. A basic knowledge and understanding of using Putty for Windows. If you are using a Mac Or Linux then you should have a basic knowledge and understanding of using Terminal.
  6. A hot cup of coffee.
  7. 15 minutes of your time.

This article will feature screenshots and pics along with every step and wherever necessary. This needs to be mentioned that I am using CentOS 6.5 VPS along with 768 MB of RAM. For best cloud computing experience and faster speeds you can always refer to Vultr.



The first step as always will be logging in as root into your server. To login as root you need to use the details which will include SSH port, IP Address and the Root Password that will be provided to you by your service provider.



Now you need to check whether Apache is already installed and running. If it is, the you need to stop and or remove it.



Now you need to navigate to this directory:



It is now time to download and install Centmin installer. Issue this one line command to download and execute it.


Here is a reference picture of the screen that you will see after you execute the command:


This process will be a bit long so you need not worry about anything. Grab that cup of coffee and enjoy it while paying close attention to what is happening on the screen. The screen of yours will be displaying all the installed packages like:



Once you are done with the whole installation process, you will see something like this:


If you want to see the details of the installation, you can scroll up a little and see something like this:


You have not completely installed the LNMP stack and are ready to host high traffic websites. That was it for the installation.


  1. You should now try and access your server by typing the Ip address of your server on the browser. You should see the default Nginx test page:
  2. You can also see which version of MariaDB, PHP and Nginx you have installed. If you want a newer version of ay of these then you can just use ./ menu to upgrade:
  3. You can also add the new websites to your newly built Nginx server. You can install new scripts if you want. To do so, refer to my tutorial on how to add websites to Nginx.
  4. If you are using a reverse proxy or any sort of proxy service like Google Page Speed Service, Varnish Cache, Incapsula or Cloudflare in front of your Nginx web server then you may need to configure and setup you Nginx web server properly. To find out how to do so you can refer to this link here.


  1. In addition to above given method there are two more methods by which one can install Centmin Mod, The first one is by using Traditional SSH shell based menu and the other one is by using CLI Command Line Installs. If the method that is shown in the tutorial does not work then you can use any of these. To see how they work, refer to this link here.
  2. For those of you who are using Xen 32bit Paravirtualized OSon 64 bit host nodes, before continuing to the installation process if you are on a Xen VPS then you need to enable and uncomment a single variable (you need to remove hash ‘#’ in front of the variable) ARCH_OVERRIDE=’36’. This can be found inside the sh file. Then simply install by and you Centmin Mod should work.

That is it. You are now all set and ready to host websites on your VPS. Thank you for going through the tutorial.

Article Tools

Did this article help you?


an Author!

Write an Article