How to install magento 2 via composer

Unlike Magento 1, Magento 2 can be installed via composer. It’s most faster and stable way to install and further support/upgrade Magento 2. Composer will automatically copy all required files, modules, libraries and prepare all things for setup.

To install Magento 2 via composer, you need to follow these steps:

Creating Composer project

The following command will setup Magento 2 Community Edition 2.2.5 in current directory: