How to install Magento 2?

January 2nd, 2020

Magento 2 Installation Process
To install new Magento2 through following these steps –

Firstly you need to verify your prerequisites

  1. Apache 2.2 or 2.4 – to check your Apache version in ubuntu ‘apache2 -v’
  2. PHP 5.6.x or 5.5.x (PHP 5.4 is not supported) – to check php version ‘php -v’
  3. MySQL 5.6.x and upper – to check mysql -u -p

Once you meet the system requirements, install Magento software using command line.

  1. We need to ensure that the Composer is installed globally in your system. To check this type
    composer -help

    if not installed then provide,

    curl -sS | sudo php
    mv composer.phar /usr/local/bin/composer
  2. Clone Magento2 from git
  3. git clone -b master
  4. Setting file system permission
    chown -R :www-data .


  5. sudo find . -type d -exec chmod 770 {} \;
    sudo find . -type f -exec chmod 660 {} \;
    sudo chmod u+x bin/magento
  6. After cloning is complete, move to Magento2 folder cd <web-root>/magento2 then provide ‘composer install’.
  7. Magento 2 Composer_Install

  8. If sample data is not installed you can follow the following steps
    a. Make a copy of composer.json

    cp composer.json composer.json.bak

    b. Open composer.json and add “minimum-stability”: “beta”, before version.

  9. Then provide the following command
    composer config repositories.magento composer
  10. Next provide composer require magento/sample-data:1.0.0-beta
  11. Once above mentioned steps are complete, finally verify the installation by entering the base URL in the browser’s address. Now, you will be directed to the installation setup tool where you will be asked to enter the Database details and magento admin details.
    Magento 2 Installation Steps
    Note : During the Setup wizard if you are installing Magento2 in local system then make sure you provide the ip address instead of ‘localhost’.

Suppose if you install Magento2 with localhost and is not able to login to the admin side then you will have to make the following changes:

  1. Edit values of ‘web/unsecure/base_url’ &’web/secure/base_url’ in the table core_config_data by providing the IP address instead localhost
  2. Then clear cache in var/cache.

After these steps try to login, you will be able to login successfully.

Know More About This Topic from our Techies

Latest Post

Get a free quote