Composer Module Installation

Applies to: FlexLab

Overview

On FlexLab, Drupal modules (feature plugins) are installed with Composer — PHP’s package manager — inside your Git repository. This is different from Codeless, where the dashboard offers one-click updates.

Key concepts

  • Composer — tool that downloads Drupal modules and libraries into vendor/ and updates composer.lock (exact versions).
  • contrib module — community extension from Drupal.org (e.g. webforms, search API).
  • composer require — command developers run locally to add a package before committing.

Steps — add a module

  1. Clone the repo from the Code tab.
  2. On your laptop, run composer require drupal/module_machine_name (replace with the real project name from Drupal.org).
  3. Commit both composer.json and composer.lock.
  4. Push to the branch tied to your test environment; wait for the pipeline.
  5. Enable the module after deploy — via Automation (drush en module_name -y) or flexsite drush -- en module_name -y.

Custom or private packages

  • Configure authentication for private Composer repositories in GitLab CI variables and FlexSite Environment Variables.
  • Apply patches with cweagans/composer-patches when upstream modules need hotfixes.

vs Codeless

Codeless editors use One-Click Module Updates in the dashboard. FlexLab teams own dependency changes through merge requests so code review catches breaking updates early.