If you have already faced the need to install Magento 2, you might have probably heard about 4 major ways of doing it:

  1. Install Magento 2 on its own server
  2. Magento 2 installation on shared hosting
  3. Install Magento 2 via Composer metapackage (Integrator).
  4. Clone Magento 2 from the repository (Contributor).

In this step-by-step Magento 2 installation guide we are going to cover the process of installation via cloning Magento repository.

Step 1. Make sure that your system satisfies the Magento 2.0 Requirements:

  • OS (Linux x86-64) Linux distributions: RedHat Enterprise Linux (RHEL), CentOS, Ubuntu, Debian, etc.
  • Composer (latest stable version)
  • Web servers: Apache 2.2 or 2.4, nginx 1.8
  • Database: MySQL 5.6 (Oracle, Percona or MariaDB 10)
  • PHP: 5.6.x or higher, 7.0.2–7.0.6 except for 7.0.5
  • PHP docs: CentOS, Ubuntu
  • PHP extensions: bc-math, curl, gd, ImageMagick 6.3.7 (or later) or both, intl,mbstring, mcrypt, mhash, openssl, PDO/MySQL, SimpleXML, soap, xml, xsl, zip, for PHP 7 only json and iconv.
  • Mail server: SMTP or MTA

Step 2. Check Magento directory permissions

The recommended settings are:

  • 700 permissions for all directories (drwx——).
  • 600 permissions for all files (-rw——-).

    1 find . -type d -exec chmod 700 {} \;

    2 find . -type f -exec chmod 600 {} \;

Step 3. Install the Composer (Required)

To check if the Composer has been already installed, run the following command:

composer --help or composer list --help

Command help displays - Composer installed. Error displays - install Composer.

Get Composer:

  • Change to or create an empty directory on your Magento server.
  • Enter the following commands: curl -sS https://getcomposer.org/installer | php mv composer.phar /usr/local/bin/composer

Step 4. Clone the Magento repository.

Find Magento 2 code on GitHub, download ZIP or run the following ‘git clone’ command to download this code.

git clone https://github.com/magento/magento2.git

Step 5. Download dependencies.

To make Magento app run properly, you need to download required dependencies via the Composer tool. In the Magento 2 folder run this command: composer install

CentOS: cd /var/www/html/magento2 && composer install

Ubuntu: cd /var/www/magento2 && composer install

After Composer downloads all necessary third-party libraries, your Magento code will be ready for initiating the process of installation.

Step 6. Install Magento 2.

First, create a database for your application.

mysql> create database magento;

mysql> grant all on magento.* to magento@localhost identified by ‘magento’;

Installation can be run using the setup tools that are located in the setup folder.

$ cd setup $ php index.php

The installation command follows the next format:

magento setup:install --<option>=<value> ... --<option>=<value>

The installer help commands can be found in the full table with the meanings of installation option names and values.

An example of an installation command:

magento setup:install --base-url=http://127.0.0.1/magento2/ \

--db-host=localhost --db-name=magento --db-user=magento --db-password=magento \

--admin-firstname=Magento --admin-lastname=User --admin-email=user@example.com \

--admin-user=admin --admin-password=admin123 --language=en_US \

--currency=USD --timezone=America/Chicago --use-rewrites=1

If you`ll see:

Post installation file permissions check...

For security, remove write permissions from these directories: '/var/www/html/magento2/app/etc' `[Progress: 274 / 274]

[SUCCESS]: Magento installation complete.

[SUCCESS]: Admin Panel URI: /admin_puu71q

Congratulations! Magento 2 installation has been successfully finished.

If something goes wrong during the installation process, your website switches to the maintenance mode and in order to restore it back to life you need to fix an error occurred and stop running the maintenance mode.

Now you can enter backend using the previously used login and password.

--admin-user=admin

--admin-password=admin123

Magento 2 Admin interface looks a lot better, it becomes more intuitive and userfriendly.

Enjoy your eCommerce journey!

Magento 2 sample data is available only if you edit composer.json.

Share This
Eltrino Eltrino Eltrino Eltrino
Newsletter
Eltrino - Rock you eCommerce
cancel
ECO Eltrno Eco