How I install Magento on LEMP?

Posted December 12, 2012 13.2k views
I want know, how I install magento on my Ubuntu with Nginx. Thanks.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
10 answers
After dealing for a while with Magento a Nginx, i find out that the key for rewrite is to include the following in the location block inside the desire virtual host config file.

For example inside the file "sudo nano /etc/nginx/sites-available/"

Include this in the location block:

location / {
try_files $uri $uri/ /index.php?q=$uri&$args;

You would first need to get your LEMP stack setup which can be done using our tutorial:

Then you would need to setup your specific nginx configuration for Magento which can be done following their wiki:
by Etel Sverdlov
LEMP stack is a group of open source software to get web servers up and running. The acronym stands for Linux, nginx (pronounced Engine x), MySQL, and PHP. This tutorial explains how to install the required repos to download nginx and php-fpm, how to install MySQL, how to install nginx, how to install php-fpm, how to configure php and nginx, and how to create a php info page. This tutorial is written for Ubuntu 12.04.
Thanks. I will try this configuration
Hi Raiyu,
Do u know any company that is able to set this up for me?
I need a cloud hosting and nginx to install Magento and transfer my store to your hosting service.
You can contact good peeps at
I did all that, but LEMP is not able to do the category rewrite. see this url:
Tsengtan are you sure about this?
A supplementary question is which droplet size to use? Will a 512MB cope well? If not how high will I need to go? Currently trying to install Magento on a droplet running Debian Wheezy.
Advise 1GB minimum for magento. More if you intend to install a control panel or ispconfig etc. Would be cool if magento lamp/lemp was an application/image option