Magento2: Composer and Installation

Magento now uses Composer to install the Magento software. Composer enables Magento to manage the Magento components and their dependencies.

If You have already installed Composer then go for the Next step, for the installation of Magento2 setup.

Anyone who uses the Magento software must install Composer to update components and Magento Ssoftware. If you install Magento using an archive or setup, you don’t need Composer to install Magento, but for getting updates you do need Composer.

Composer provides following advantages:

  • Enables to reuse third-party libraries without bundling them with source code
  • Component-based architecture with robust dependency management
  • Manages dependencies to reduce extension conflicts and compatibility issues
  • Versioned dependencies
  • Semantic versioning
  • Supports PHP Framework Interoperability standard

Install Composer

First, check if Composer is already installed:

In a command prompt, enter any of the following commands:

  • composer --help
  • composer list --help

If command help displays, Composer is already installed; in that case, you can skip the next section and continue with magento installation.

If an error displays, use the following steps to install Composer.

To install Composer:

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

    For additional installation options, see the Composer installation documentation.