Go Home Project Directory View Current Script

[VStacklet] Varnish LEMP Stack Kit

Lightweight script to quickly install a LEMP stack with Nginx, Varnish, PHP5 (PHP-FPM), OPCode Cache, IonCube Loader, MariaDB, Sendmail and more on Ubuntu 14.04, 15.04 and 15.10 as well as perform initial server configuration for website-based server applications.
Fork VStacklet on GitHub

Kit to quickly install a LEMP Stack w/ Varnish and perform basic configurations of new Ubuntu 14.04, 15.04 and 15.10 servers.

Components include a recent mainline version of Nginx (1.10.0 (Xenial)) using configurations from the HTML 5 Boilerplate team (and modified/customized for use with mainline Nginx), Varnish 4.1, and MariaDB 10.1 (drop-in replacement for MySQL), PHP5, Sendmail (PHP mail function), and CSF (Config Server Firewall).

Deploys a proper directory strucutre, optimizes Nginx and Varnish, creates a PHP page for testing and more!


  • Quiet installer - no more long scrolling text vomit, just see what's important; when it's presented.
  • Script writes output to /root/vstacklet.log for additional observations.
  • Color Coding for emphasis on install processes.
  • Defaults are set to (Y) - just hit enter if you accept.
  • Varnish Cache on port 80 with Nginx port 8080 SSL terminiation on 443.
  • No Apache - Full throttle!
  • Fast and Lightweight install.
  • Full Kit functionality - backup scripts included.
  • Actively maintained w/ updates added when stable.
  • HTTP/2 Nginx ready. To view if your webserver is HTTP/2 after installing the script with SSL, check @ HTTP/2 Checker
  • Everything you need to get that Nginx + Varnish server up and running!

Total script install time on a $5 Digital Ocean Droplet sits at 10:12 installing everything. No Sendmail or Cert script installs at 04:22. This time assumes you are sitting attentively with the script running. There are a limited number of interactions to be made with the script and most of the softwares installed I have automated and logged, however, I feel it is important to have some sort of interaction... at the very least so you are familiar with what is being installed along with the options to tell it to go to hell.


VStacklet - (Full Kit) Installs and configures LEMP stack with support for Website-based server environments.


  • Adds repositories for the latest stable versions of MariaDB, mainline (1.10.x) versions of Nginx, and Varnish 4.x
  • Installs and configures Nginx, Varnish and MariaDB.
  • Installs PHP-FPM for PHP5 -or- PHP7.
  • Enables OPCode Cache and fine-tuning
  • Installs and Enables IonCube Loader
  • Installs and Auto-Configures phpMyAdmin - MySQL & phpMyAdmin credentials are stored in /root/.my.cnf
  • MariaDB 10.1 can easily switched to 5.5+ or substituted for PostgreSQL.
  • Installs and Adjusts CSF (Config Server Firewall) - prepares ports used for VStacklet as well as informing your entered email for security alerts.
  • Installs and Enables (PHP) Sendmail
  • Supports IPv6 by default.
  • Optional self-signed SSL cert configuration. [*wip]
  • Easy to configure & run backup executable vs-backup for data-protection.

VS-Backup - Installs scripts to help manage and automate server/site backups
As standalone or just use the full kit - VS-Backup is included.


  • Backup your files in key locations (ex: /srv/www /etc /root)
  • Backup your databases
  • Package files & databases to one archive
  • Cleanup remaining individual archives
  • Simply configure and type 'vs-backup' to backup important directories and databases - cron examples included.

You should read these scripts before running them so you know what they're doing. Changes may be necessary to meet your needs.

Setup should be run as root on a fresh Ubuntu 64-bit installation. Stack should be run on a server without any existing LEMP or LAMP components.

If components are already installed, the core packages can be removed with:

apt-get purge apache mysql apache2-mpm-prefork apache2-utils apache2.2-bin apache2.2-common \
libapache2-mod-php5 libapr1 libaprutil1 libdbd-mysql-perl libdbi-perl libnet-daemon-perl \
libplrpc-perl libpq5 mysql-client-5.5 mysql-common mysql-server mysql-server-5.5 php5-common \
php5-mysql
apt-get autoclean
apt-get autoremove


VStacklet FULL Kit - Installs and configures the VStacklet Varnish LEMP kit stack:
(includes vs-backup and all needed backup scripts)

NOTE: You may need to run first the following, this is especially true if you are using a fresh Ubuntu 15.x install -

apt-get install -y curl

... then run our main installer ...

curl -LO https://raw.github.com/JMSDOnline/vstacklet/master/vstacklet.sh
chmod +x vstacklet.sh
./vstacklet.sh


To compile Nginx with Pagespeed [standalone - or rebuild] (dev branch)

curl -LO https://raw.githubusercontent.com/JMSDOnline/vstacklet/development/nginx-pagespeed.sh
chmod +x nginx-pagespeed.sh
./nginx-pagespeed.sh


VStacklet VS-Backup - Installs needed files for running complete system backups:

curl -LO https://raw.github.com/JMSDOnline/vstacklet/master/vstacklet-backup-standalone.sh
chmod +x vstacklet-backup-standalone.sh
./vstacklet-backup-standalone.sh


This is a modification of it's original branch provided by quick-lemp. The scripts within VStacklet LEMP Kit come with heavy modifications to the origianl quick-lemp script... in this regards, these two scripts are entirely separate and not similar to one another. Quick-LEMP is mentioned as it started the VStacklet Kit Project... what was to be a simply pull request to it's original owner, took on a new scope and thus simply became a new project. The changes include ushering in CSF, Varnish as well as installing and configuring Sendmail and phpMyAdmin for ease of use.

Quick-Lemp is geared towards python based application installs and using default Boilerplate templates on Nginx/stable versions of no higher than 1.8. This limits the use of new functions and features in Nginx, nothing wrong with that, but some of us are sticklers for a recent version.

My focus was and is to provide a modified version for CMS and typical website server i.e;(WordPress, Joomla!, Drupal, Ghost, Magento ... etc ... ) installations, Updated/Modified/Customized Boilerplate templates to be more 'Nginx mainline' friendly; i.e http/2, as well as the ongoing use of static websites (which the original still handles splendidly!)

Again, please be advised that I am building/testing this script on Ubuntu 14.04 (Trusty), 15.04 (Vivid), and 15.10 (Wiley Werewolf) as they support Nginx versions higher than 1.8.

As per any contributions, be it suggestions, critiques, alterations and on and on are all welcome @ VStacklet's Repo on GitHub