Using Composer to manage Drupal site dependencies | Drupal.org

Composer can be used to download Drupal, Drupal contributed projects (modules, themes, etc.) and all of their respective dependencies. These instructions vary based on your approach to managing your Drupal installation. Installing Composer You need Composer to be installed on your local machine before executing any Composer commands. Please see Getting Started on getcomposer.org to install Composer itself.

Source: Using Composer to manage Drupal site dependencies | Drupal.org