Project template for Drupal projects with CiviCRM
This project template provides a starter kit for managing your Drupal 8 and CiviCRM site with Composer.
It's based on drupal/recommended-project, so please see that documentation for general information on managing Drupal via composer.
The documentation here is going to be focused on CiviCRM!
You need a couple of dependencies first:
Make sure that you have a recent version of Composer! A couple of people have tried to use this project with older versions and have experienced issues.
After that you can create your new project via:
composer create-project roundearth/drupal-civicrm-project:8.x-dev some-dir --no-interaction
Drupal will be installed under the
web directory, with the
outside of the webroot. This follows current best practices, but it means two
- You'll need to point your webserver at the
webdirectory, not the top-level directory like you might be used to with Drupal 7, or non-composer Drupal 8 sites.
- The CiviCRM web assets are synced to the
web/libraries/civicrmdirectory, so you'll need to configure CiviCRM's "Resource URL" to point to the URL that will reach that directory.
After getting the code using the command-line above, and doing the normal Drupal 8 installation, perform the following steps to install CiviCRM:
web/sites/defaultdirectory is writeable. On the command-line:
chmod +w web/sites/default
Enable the CiviCRM module. On the command-line:
drush en -y civicrm
If you were already logged into the Drupal site, then logout and log back in again. This is to work around bug CRM-19878.
How does it work?
It's basically 'drupal/recommended-project' with a special Composer plugin added, which does all the additional steps for CiviCRM. So, if you want to understand its behavior or contribute, see the Composer plugin: