Composer Module Installation
Breadcrumb
-
- FlexLab
- 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 updatescomposer.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
- Clone the repo from the Code tab.
- On your laptop, run
composer require drupal/module_machine_name(replace with the real project name from Drupal.org). - Commit both
composer.jsonandcomposer.lock. - Push to the branch tied to your test environment; wait for the pipeline.
- Enable the module after deploy — via Automation (
drush en module_name -y) orflexsite 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-patcheswhen 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.