Project template for Drupal 8 projects with composer

dev-playground 2018-09-27 12:55 UTC

This package is not auto-updated.

Last update: 2020-07-24 19:54:12 UTC


A basic Drupal 8 installation. For a docker environment to run it in see:

First you need to install composer.

After that you can create the project:

composer create-project akempler/composerd8:dev-master composer --stability dev --no-interaction

If using the docker environment listed above, the command would be run from directly in the project directory.

You can change "composer" to any directory name you want to use. This will create a directory structure like composer/drupal. Or yourprojectname/drupal.
I've used "composer" because there is a docker environment already configured to use that:


Currently there is no ssh setup so just use docker exec to enter the containers. You can run drush from the sandbox container against the drupal and mysql containers.

With composer require ... you can download new dependencies to your installation.

cd project-dir
composer require drupal/panels:8.*

What does the template do?

Provides some basic organization and setup for a drupal 8 installation.

Additionally it adds some useful modules/themes such as:

When installing the given composer.json some tasks are taken care of:

  • Drupal will be installed in the drupal-directory.
  • Autoloader is implemented to use the generated composer autoloader in vendor/autoload.php, instead of the one provided by Drupal (drupal/vendor/autoload.php).
  • Modules (packages of type drupal-module) will be placed in drupal/modules/contrib/
  • Theme (packages of type drupal-theme) will be placed in drupal/themes/contrib/
  • Profiles (packages of type drupal-profile) will be placed in drupal/profiles/contrib/
  • Creates default writable versions of settings.php and services.yml.
  • Creates sites/default/files-directory.

The following items are excluded from composer.json as they are often installed in a separate Docker container. However you can always add them using composer require or add them to composer.json:

  • "drush/drush" : "~8.1",
    • Latest version of drush is installed locally for use at vendor/bin/drush.
  • "drupal/console" : "~1.0",
    • Latest version of DrupalConsole is installed locally for use at vendor/bin/drupal.