On this page
3rd party modules and themes can be installed and managed using Composer.
All packages on Drupal.org are registered with Drupal’s own Packagist clone.
It should be included in the
composer.json that comes with Drupal,
but in case it isn’t you can add the following block to the file:
(Drupal 8 and 9 share the same package repository.)
Once that’s there, you can install any module or theme with the following command:
composer require drupal/devel
devel with the name of the module or theme you’re installing.
Do not commit the
web/modules/contrib directory to Git.
The build process re-downloads the correct version for you based on the
composer.lock files, which should be committed to Git.
Site-specific custom modules and themes can be written directly in the
They should be committed to Git as normal.
Drupal is fully managed via Composer, which means so are updates to Drupal core itself.
composer update periodically to get new versions of both Drupal core
and any modules or themes you have installed via Composer.
Commit the resulting changes to your
composer.lock file and push again.
The Composer documentation has more information on options to update individual modules or perform other tasks.
Note that updating modules or core through the Drupal UI isn’t possible, as the file system is read-only. All updates should be done through composer to update the lock file, and then pushed to Git.
Drush site aliases help you manage your development websites.
The Platform.sh CLI can generate Drush aliases for you automatically
when you clone a project using the
platform get PROJECT_ID command.
To see the aliases that are created, run the following command:
You get output similar to the following:
Aliases for My Site (tqmd2kvitnoly):
To recreate existing aliases or to create a new alias after pushing a new branch via git, run:
platform drush-aliases -r