Magento 2 Composer install command

To install Magento 2 via composer, you run the following shell command in your terminal on your server. Bear in mind I am assuming you have already installed the prerequisites which can be found here:

Don't forget to change the end part of this command - this is the directory where you would like to install Magento 2 ( I.e. /var/www/gurdeep/magento2 should be /your/install/directory)

composer create-project --repository-url= magento/project-community-edition /var/www/gurdeep/magento2

When you run this command for the first time, you will be prompted to enter a username & password to access the composer repository for Magento.

    Authentication required (

You can obtain this by logging into your Magento Marketplace account and then clicking on the link called "My Access Keys" under the section "My Products"

Magento 2 Marketplace Access Keys

Magento 2 Marketplace Access Keys

Once you have entered the username & password, you will be asked if you would like to store these details in your composers auth.json file:

Do you want to store credentials for in /home/gurdeep/.config/composer/auth.json ? [Yn]

My advice is to select Yes if you are installing on to your development environment.

See the following link for more information from Magento:

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.