Skip to content


Repository files navigation

Vlad's LEMP install script

This script installs the latest NginX, MySQL and PHP (with APC and Memcache extensions).

*Note APC is not yet available for PHP 5.5+.

Optionally you can install the Memcached Server and Postfix.

You can install your preferred versions for any of the programs. Just edit the OPTIONS file and change them accordingly.

It is highly recommended to run this installer on a fresh installed system.

This is tested automatically on the following distributions (i386 & amd64):

  • Ubuntu Server 12.04 (Precise Pangolin)
  • Ubuntu Server 13.04 (Raring Ringtail)
  • Debian Server 6.0.7 (Squeeze) (amd64 only)
  • Debian Server 7.1 (Wheezy) (amd64 only)


Make sure you have Git installed on your Ubuntu System:

sudo apt-get install git-core screen

Clone this repository, and get the latest stable version of this script:

git clone git://

Start a screen session:


I recommend running everything inside a screen session because in case your connection drops you can easily come back with screen -rad. If you use something else (ex: byobu) you can skip this step.

Take a look at the OPTIONS file. This is were you can choose to install the MySQL Server or modify the versions for any of the programs, as well as the paths.

Run the installer:

sudo bash

After the installer is finished (this will take a long time depending on your server specifications), you MUST set your mysql root password:

sudo mysqladmin -u root password 'MYPASSWORD'

You can go to your server's address and you will see the PHP info page. Also, if you go to:

In order to have immediate access to new paths you should also execute source /etc/environment. This command reloads the new environment variables.


In the "ext" folder you will also find some utilities:

  • nxmksite to generate a basic, but functional, vhost.
  • nxensite and nxdissite commands to enable or disable sites in NginX. (similar to a2ensite and a2dissite in Apache).
  • - upgrades or modifies NginX (sudo ext/ 1.3.2).
  • - upgrades or modifies PHP (sudo ext/ 5.4.4).
  • - upgrades or modifies APC (sudo ext/ 3.1.10).


  • The update_* scripts above can be used to upgrade the software, or change current configure arguments.
  • You can only have one argument in a strict form x.x.x.
  • The CONFIGURE_ARGS variable inside can be modified, but make sure the installation directory (--prefix) is the same.


Please report any bugs to


  1. Open an issue to discuss proposed changes
  2. Fork the repository
  3. Create your feature branch: git checkout -b my-new-feature
  4. Commit your changes: git commit -am 'Add some feature'
  5. Push to the branch: git push origin my-new-feature
  6. Submit a pull request :D


Licensed under the Apache License, Version 2.0.