Using Composer with CiviCRM + Drupal
At CiviCon, Skvare’s Mark Hanna shared practical tips for managing CiviCRM and Drupal with Composer. Composer is a dependency management tool that simplifies the process of fetching, updating, and organizing the many packages that make up a Drupal + CiviCRM site. Instead of downloading and placing files manually, Composer keeps everything aligned across development, staging, and production environments.
Highlights from the Talk
- Why Composer matters: Drupal and CiviCRM rely on many packages, often sharing dependencies like Symfony. Composer ensures compatible versions are installed and reduces duplication.
- Getting started: Define package versions in
composer.json
, then lock them incomposer.lock
so environments stay consistent. - Composer template: Mark shared a prototype template for Drupal 11, kept up to date and including useful modules such as CiviCRM Entity, CiviCRM Drush, Form Builder, and patched Webform CiviCRM.
- Plugins that help: The CiviCRM Asset Plugin places CSS/JS files where Drupal expects them, while the Extensions Plugin can fetch and install CiviCRM extensions.
- Upgrade support: Tools like Drupal Lenient allow developers to test modules on newer versions of Drupal even if official support is not declared.
Watch the Presentation
At Skvare, we help organizations make the most of open-source tools like Drupal and CiviCRM. If you’d like to explore how Composer can simplify your project workflows, contact us today.