Introduction to Composer for Drupal Users

Composer is the recommended way to download Drupal core, contributes modules and themes, and any other 3rd party PHP libraries. While it's not strictly speaking required, we highly recommend taking the time to learn Composer and then using it to manage your projects.

Composer is also the preferred dependency management solution for PHP. List your project's dependencies in a composer.json file and, after issuing a few commands at the command line, Composer will download your project's dependencies for you. Use a couple more commands and you can update projects to their latest versions. Composer is analogous to NPM in the node.js world, or Bundler in the Ruby world.

Drupal core uses Composer to manage non-Drupal dependencies like Guzzle, and PHPUnit to name a few. Some (and more all the time) contributed modules also use Composer to integrate 3rd party PHP libraries into Drupal.

This series provides guidance for Drupal developers and site builders who would like to learn to use Composer to build and maintain a Drupal 8 application. It covers high-level concepts about Composer and walks you step-by-step through creating a new application, downloading PHP libraries, and implementing them using Composer. The tutorials within this series also cover Drupal-specific Composer configuration and provides guidance for accomplishing common Drupal tasks like updating core and installing a new module.

Composer is a command line application. Before diving in you'll want to make sure you're comfortable with Command Line Basics.

Author, Matthew Grasmick

Matthew, known as grasmash on Drupal.org, has been a member of the Drupal community since 2009. He maintains dozens of Drupal modules and the official Drupal Composer documentation. He is also the maintainer of Acquia's Build and Launch Tools, which automate Drupal 8 development, testing, and deployment processes.