Magento Tutorials

How to Install Magento 2 Using Composer

Welcome back to another SimiCart’s Magento tutorial. Today, we will guide you how to install Composer and how to install Magento 2 with Composer.

Note: You may want to check Magento 2 System Requirements first.

Step 1: Install Composer

  1. Run the following command to check if Composer has already been installed:
composer --help
composer list --help
  1. If nothing displays or you face any errors, please install Composer:

Create an empty directory on your Magento server and run the following commands:

curl -sS | php
mv composer.phar /usr/local/bin/composer
  1. Run the following command to make your Composer globally available
mv composer.phar /usr/local/bin/composer

Step 2: Download Magento 2

Run the following command in the root directory.

composer create-project --repository-url= magento/project-community-edition .

Step 3: Set Up Permissions

You should set correct permissions for the whole Magento 2 installation directory by running the below command:

find . -type d -exec chmod 700 {} \; && find . -type f -exec chmod 600 {} \;

Step 4: Create The Database

Create an empty database to work with MySQL in case you have already have correct permissions:

echo "CREATE DATABASE magento2" | mysql -u[mysqluser] -p

Step 5: Install Magento 2

Run the following lines in Command Line to install your Magento 2:

php bin/magento setup:install 

The above values are just examples, you definitely should change them according to your own info.

Hope this helps!


How to Setup Magento 2.3 PWA Studio With Custom Theme
How to Install Magento 2 on Ubuntu 16 Using Nginx
How to Install Magento 2 on Localhost
How to Install Magento 2 on WAMP Server Localhost

Is it helpful?


A knowledge craver who always strive to be wiser everyday.

Notify of
Most Voted
Newest Oldest
Inline Feedbacks
View all comments
2 years ago

>> Run the following command in the root directory

that is not the root directory ‘/’ of your linux server, right? If that assupmtion is correct wouldn’t …

“Run the following command in the directorz of your linux server that you want to install Magento in. A common method would be to create a system user for a Magento store and use the /home directory of that user to install Magento”

… be a little bit more precise instrucion?

Parminder singh
Parminder singh
2 years ago

Is this possible to install Magento direct to the hosting via composer? not localhost, I want to install to the dreamhost vps

1 year ago

Thanks for the tutorial, I was at step 5, then there came errors that my php was below the requirements. After reading the docs and installing all the php components i have issues regarding the installation. Currently facing this error using composer at step 2: Your requirements could not be resolved to an installable set of packages. Problem 1 – magento/inventory-composer-installer 1.1.0 requires composer-plugin-api ^1.1 -> no matching package found. – magento/product-community-edition 2.3.2 requires magento/inventory-composer-metapackage 1.1.2 -> satisfiable by magento/inventory-composer-metapackage[1.1.2]. – magento/inventory-composer-metapackage 1.1.2 requires magento/inventory-composer-installer 1.1.0 -> satisfiable by magento/inventory-composer-installer[1.1.0]. – Installation request for magento/product-community-edition 2.3.2 -> satisfiable by magento/product-community-edition[2.3.2].… Read more »


[…] trying to install magento 2.3.2 via composer and have come acrosss this article about how to do […]