Recommended VPS Complete list of best VPS hosting providers.

Quickest Easiest Way To Install LNMP Stack on CentOS and Ubuntu

Install Nginx, PHP, MySQL on CentOS and Ubuntu Easier with Auto Installer script – In this page I will tell you how to build Linux, Nginx, MySQL, and PHP on either CentOS or Ubuntu in much easier quicker way with the help of Nginx Auto Installer script by Ruchira. Previously I also posted how to the same thing using Tuxlite, an auto installer script for Ubuntu to get either Apache or Nginx installed easily. What’s the differences? Tuxlite is able to install Apache or Nginx (your choice) along with PHPMyAdmin, Varnish Cache, and WordPress while this new one is Nginx-only auto installer along with PHPMyAdmin, Eaccelerator, PureFTPd, VsFTPd, PHP Suhousin Patch, Memcached and Zend Optimizer. You can use it on debian/ubuntu/centos 32bit or 64bit.

How to Use Nginx Auto Installer?

Step 1 – Login to your server and follow my previous guide about Basic setup for CentOS or Ubuntu before you build a live web server. You may and may not follow that tutorial but if you followed, it will give you some basic security tweak to your server.

Before you proceed to the next steps, it is better to explain that all commands in this tutorial are written without the “sudo” prefix. However if you disabled root login and you logged in using another username with root privilege, you can add the “sudo” prefix all by your self. Alternatively you can simply type su, hit Enter and type in your password twice to switch login as root.


You may also need to type this command to go to the root directory:

cd ~

Step 2 – Now download the NGINX Auto Installer package using the wget command:

wget -c



Step 3 – Now unpack that package with this command:

tar zxvf lnmp0.9-full.tar.gz

Step 4 – Then go to that  folder:

cd lnmp0.9-full


extract script

Step 5 – Finally, issue the magic command syntax to install the script:

For Ubuntu OS


For CentOS:


For Debian:


In this guide I use CentOS 6.4 32-bit.

Step 6 – You’ll be asked some questions during install. Just answer them properly but make sure you know/remember with your answer (e.g: mysql root password, etc).


Upon hitting the last Enter key the installation process will begin. Just wait till it finishes.

install process

Step 7 – Once done you’ll see this:


You can test it on your browser by typing domain name or ip address and you’ll see its test page:

nginx test page


LNMP files will be located on:
– mysql: /usr/local/mysql
– php: /usr/local/php
– nginx: /usr/local/nginx
– Site Directory: /home/wwwroot
– PHPMyAdmin will be located on http://yourip/phpmyadmin

Post Install

1How to install eAccelerator:


2How to install IonCube:


3How to install imageMagick:


4How to install MemCached:


5How to upgrade Nginx to latest version:


6How to upgrade PHP to latest version:


7How to add more domains (virtual hosts):




Add a Comment

Your email address will not be published. Required fields are marked *

Get more stuff like this
in your inbox

Subscribe and get interesting stuff plus faster updates to your email.