Debian LNMP on a Cloud Server

So you have decided to get a Cloud Server and you want to install a LNMP stack on your server. This is a total possibility and all you have to do is enter a few commands.

I am sure that you have heard of a LAMP stack on a Linux Server, but have you heard of a LNMP stack. Well this is how I build a LNMP stack. After you follow this guide, your server will have :

  • L = Linux
  • N = NGINX
  • M = MySQL
  • P = PHP

The first step is to setup and begin using the DotDEB repositories.

# Update your sources list to a third  party source that will provide you with much newer packages
echo 'deb http://packages.dotdeb.org stable all' >> /etc/apt/sources.list.d/DotDeb.list
echo 'deb-src http://packages.dotdeb.org stable all' >> /etc/apt/sources.list.d/DotDeb.list
wget http://www.dotdeb.org/dotdeb.gpg
cat dotdeb.gpg | sudo apt-key add -; rm dotdeb.gpg

Once you have squared away your repositories you have to update the system and then install all of the packages.

# Update and then install LNMP stack on a Debian/Ubuntu Server
apt-get update
apt-get install nginx-extras php5 php5-fpm php5-common php5-curl php5-dev php5-gd php5-imagick php5-mcrypt php5-memcache php5-mysql php5-pspell php5-snmp php5-sqlite php5-xmlrpc php5-xsl php-pear libssh2-php php5-cli apache2-utils ssl-cert mysql-server; reboot;

There are some differences in this stack. This will install NGINX, PHP-FPM, and MySQL. While NGINX and PHP-FPM will be installed with this setup, you will still need to configure them. Here is a link on how to configure them.