Installing Magento 2

Installing Magento 2 on windows (WAMP/XAMPP) is a terrible idea.

Those servers’ performance is not good enough to handle Magento like giant systems.

I tried and failed several times. Finally moved to Ubuntu (LAMP/LEMP) permanently. and installed the Magento 2 smoothly on my localhost.

Installing Magento 2 requires a good knowledge on Linux server system, specially how user and file permission works.

In this series I will try to make things simpler, so that you don’t feel lost in so many things.

If something seems confusing, please ask me on post comment, I respond with care.

Considering that you are using Ubuntu with LAMP.

Please follow these steps to:

      1. Download latest magento from:
      2. Extract downloaded codes into virtual host directory. Lets assume your virtual host directory is /var/www/
      3. (You may skip this step if it seems complex, but this is best practice) Create a new system user say magento_user and change that user’s primary group to www-data or you may just set your current (non root) user’s default group to www-data
      4. In terminal hit  cd /var/www/
      5. Change folder permissions with this command sudo chown magento_user:www-data . -R
      6. sudo chmod 775 . -R
      7. sudo find var vendor pub/static pub/media app/etc -type f -exec chmod g+w {} \;
      8. sudo find var vendor pub/static pub/media app/etc -type d -exec chmod g+ws {} \;
      9. sudo chmod u+x bin/magento
      10. Make sure following PHP extensions are installed (Package names my vary based on php version / server environment)

sudo apt-get install php-curl php-dom php-iconv php-mcrypt php-xsl php-intl php-mbstring php-ctype php-zip php-simplexml php-xmlwriter php-gd php-soap

  1. sudo service apache2 restart
  2. From browser hit, http://magento.url/setup
  3. sudo chown magento_user:www-data . -R
  4. php bin/magento setup:static-content:deploy
  5. IF admin gets 404 or mod_rewrite does not work:
sudo a2enmod rewrite

add following to
Immediately inside

<Directory /var/www/html>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
  1. sudo service apache2 restart

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s