Magento, Magento 2

How to Install Magento 2 using Composer

How to Install Magento 2 using Composer

Welcome back to Rohan’s magento tutorial blog. Want to install Magento 2 using composer, but little bit confuse from where start steps? Don’t worry, you’re at the right place!

There are official documentation available about how to do it, so this is basic steps describe in this blog if you want to skip read whole documentation. So, Bookmark this page and let’s get start installation steps.

Before installing, please check basic requirements of Magento 2.

Steps : How to Install Magento 2 using Composer

  • Downloading and Installing Composer
  • Magento 2 Download
  • Set Up Permissions
  • Create The Database
  • Install Magento 2

1. Downloading and Installing Composer

If you’ve not install composer, then you can install using below command. Execute this command in your terminal :

curl -sS https://getcomposer.org/installer | php

(For windows user : click here)

If you want to make your composer globally available, then execute this below commad :

mv composer.phar /usr/local/bin/composer

2. Magento 2 Download

Run the below command in the root directory.

composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition .

3. Set Up Permissions

After download magento, you need to set the proper permission for the whole Magento 2 instllation directory by using this below command :

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

4. Create The Database

If you have MySQL user with proper rights, then create an empty database.

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

5. Install Magento 2

To Install Magento 2 using command line, execute this command :

php bin/magento setup:install --base-url="http://yoururl.com/" --db-host="localhost" --db-name="dbname" --db-user="dbuser" --db-password="dbpass" --admin-firstname="admin" --admin-lastname="admin" --admin-email="user@example.com" --admin-user="admin" --admin-password="admin123" --language="en_US" --currency="USD" --timezone="America/Chicago" --use-rewrites="1" --backend-frontname="admin"

You can edit command as per your needs and executed from Magento 2 root directory. If whole steps working and your magento install successfully, then you can give update here that installation process has been completed successfully 🙂

I hope this blog is easy to understand for you about how to install Magento 2 using Composer. In case, I missed anything or need to add some information, always feel free to leave a comment in this blog, I’ll get back with proper solution.

Tagged , ,