Pre Installation Requirements-:
1. LAMP should be installed on the system with mysql-server-5.6 (Updated version).
2. MOD_REWRITE should be enabled on the system.
3. All Files of magento2 should have 600 and directories have 700 permissions.
4. Apache user and the owner of Magento2 directory should be the same. (Magento2 should run with the apache user).
5. If you have apache root directory setup on some different location other than “/var/www” then you have to replace the /var/www with your apache root directory.
Installation Steps -:
1. LAMP installation.
2. Enable mod_rewrite by executing command in terminal
3. Now open the apache2.conf file by
and search for something like given below-:
<Directory /var/www>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
now replace the above as follows (do not use {})-:
<Directory /var/www >
Options Indexes FollowSymLinks
AllowOverride {All}
Require all granted
</Directory>
4. Restart the apache service by
5. Now install composer by executing given below commands in your terminal.
apt-get update
apt-get install git wget
wget -O /usr/local/bin/composer http://getcomposer.org/composer.phar
chmod +x /usr/local/bin/composer
6. Download the magento2 from git by executing given below commands-:
cd /var/www
git clone https://github.com/magento/magento2.git
cd /var/www/magento2
composer install
7. Change the ownership of magento2 by executing given below command for example-:
you have username “magtest” then your command should be
8. Now change the user of apache server for example you have the username “magtest”.
open the envvars file by executing-:
now find
and replace the www-data with “magtest” user
then it should look like
save the file by ctrl+x
9. Restart the apache server by executing
10. Now install the magento2 by accessing the URL-: http://localhost/magento2
Enjoy……………