Drupal 8 - Installing with Composer

Submitted by gnikolovski on Sat, 01/07/2017 - 01:36

Drupal 8 - Installing with Composer

Drupal 8 - Installing with Composer

Drupal project is the most popular template for installing Drupal with Composer. But this template brings completely different directory structure, than what we are used to. And that means that we have to change our server configuration because index.php file is now in the new web directory. If you don't want to change serves settings or you can't because your hosting company doesn't allow you, then you can't use Drupal project template.

New directory structure looks like this:

Drupal 8 project dir structure

If you want to keep standard Drupal 8 directory structure (same as in official Drupal 8 zip/tar archive) then keep reading. I forked aforementioned project template and changed directory structure, so now you can install Drupal 8 with Composer and keep the standard directory structure. You can find my project on Github here: gnikolovski/drupal8 and on Packagist: gnikolovski/drupal8

How to install it?

In order to install Drupal 8 with Composer and my project template, execute the following command:

composer create-project gnikolovski/drupal8 . --stability dev --no-interaction

This will download Drupal 8 to the directory you are currently in, and your directories will look like this:

Drupal 8 project my dir structure

To find out more information please visit Github project page.