admin/ May 11, 2016/ Linux, Magento2/ 1 comments

Magento2 (M2) installation on Ubuntu LTS 16.04 with Nginx, Varnish, MySql Server.


Nginx has grown in popularity since its release due to its light-weight resource utilization and its ability to scale easily on minimal hardware. Nginx excels at serving static content quickly and is designed to pass dynamic requests off to other software that is better suited for those purposes.

Nginx is often selected by administrators for its resource efficiency and responsiveness under load. Advocates welcome Nginx’s focus on core web server and proxy features.


Varnish is an HTTP accelerator and a useful tool for speeding up a server, especially during a times when there is high traffic to a site. It works by redirecting visitors to static pages whenever possible and only drawing on the virtual private server itself if there is a need for an active process.

Lets Start Magento2 Setup.

Step 1-: Installation of required Packages.

Note-: The above installation commands will install Php-7.0, MySql-5.7, Varnish-4.1, Nginx-1.10 (all required repository already in Ubuntu-16.04).

Step 2-: Create Database, Configure php, Configure Nginx and Varnish Server.

a)  We need to create a database for Magento2 installation.

For Example-:

b) The Nginx webserver execute the php with php-fpm module and Magento2 requires 1024 MB memory limit.

Open the of php-fpm module using below commands.

Update the  memory_limit = 128M to  memory_limit = 1024M

c) Make Backup of the default file of nginx configuration and use the below configuration.

Make a backup of existing file.

Create a new default file and paste the below content.

d) Configure the Varnish Cache Server For Magento2.

Open the varnish.service file and make the below configuration.

Modify the line as below

Update  -a :6081 to -a 80 and 256m to 1024m

Open the default.vcl file and update the port as below-:

Restart the Nginx, Varnish, php-fpm service using below commands.

Step 3-: Magento2 (M2) download and installations.

If you found prompt authentication like below-:

Login here

Click on “My Account” on right top.


Magento Securekey

Use the Public key as UserName and Private Key as Password.

Step 4-:After install all dependencies by composer install command.
Change the required permission

Open the Web Browser ( Chrome, Firefox etc)

Follow the Magento2 installation Steps.


Schedule Magento2 Cronjobs
Finally schedule the backgound cronjobs for your magento2 installation. These cronjobs does some activities like, re-indexing, Newsletters, Update of currency rates, sending automatic emails and generating sitemaps etc. To schedule these jobs edit crontab file

and add below cronjobs at the end of file and save it.


Gotechnies Magento 2 Blog

Rating: 4.7
Votes: 370
Reviews: 340
Share this Post

1 Comment

  1. This guide is for the older version of Magento platform. We recommend you to use the latest version of Magento. Also, if you are looking for the upgrade guide,

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.