Lightweight scripts to quickly install a LEMP stack with Nginx, PHP5 (PHP-FPM), uWSGI, and MariaDB on Ubuntu and perform initial server configuration. Deploys a sample Flask app.
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

quick-lemp Join the chat at

Scripts to quickly install a LEMP Stack and perform basic configuration of new Ubuntu 12.04, 13.04, 14.04, and 15.04 servers.

Components include a recent stable version of Nginx (1.8.0) using configurations from the HTML 5 Boilerplate team, uWSGI, and MariaDB 10.0 (drop-in replacement for MySQL), PHP5, and Python.

Deploys a sample Flask app and creates a PHP page for testing.


Setup - Basic setup for new Ubuntu server.

  • Intended only for new Ubuntu installations.
  • Adds new user with sudo access and disables remote root logins.
  • Changes sshd settings to enhance security.
  • Uses UFW to apply iptables rules to limit traffic to approved ports.

Stack - Installs and configures LEMP stack with support for PHP and Python applications.

  • Installs and configures Nginx and MariaDB.
  • Installs PHP-FPM for PHP5 and uWSGI in Emperor Mode for Python.
  • Includes virtualenv and pip.
  • MariaDB 10.0 can easily switched to 5.5 or substituted for PostgreSQL.
  • Adds repositories for the latest stable versions of Nginx and MariaDB..
  • Supports IPv6 by default .
  • Optional self-signed SSL cert configuration.

Quick Start

You should read these scripts before running them so you know what they're doing. Changes may be necessary to meet your needs. The generic Ubuntu files are intended to be compatible with Ubuntu 12.04, 13.04, 14.04, and 15.04.

Setup should be run as root on a fresh Ubuntu 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 \ 
apt-get autoclean
apt-get autoremove

Setup - Basic setup for new Ubuntu server:

12.04, 13.04, 14.04, and 15.04

curl -LO
chmod +x

Stack - Installs and configures LEMP stack:

12.04, 13.04, 14.04, and 15.04

curl -LO
chmod +x