Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Drupal 8.x with Composer, example of step commands

Resources

Using Composer in a Drupal project Using Composer to install Drupal packages through Drupal.org

Commands

  1. Using github.com/drupal-composer/drupal-project
composer create-project drupal-composer/drupal-project:8.x-dev some-dir \ 
         --stability dev --no-interaction
  1. Through the official Drupal.org Composer Service
composer config repositories.drupal composer https://packages.drupal.org/8

composer create-project drupal/drupal /var/www/drupal-8.1.2 8.1.2

Install modules/themes etc

// Important: version (eg :8.x) needs to be added if there are multiple versions available on D.O. repos
composer require drupal/devel
composer require drupal/features:8.x
composer require drupal/token:8.0.x-dev
composer require drupal/restui drupal/jsonapi

Do not install the require-dev stuff (production installation)

composer install --no-dev

Update Drupal core

composer update drupal/core
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.