Create a Drupal 8 Project using composer

Question

How to Create a Drupal 8 Project using composer.

Get drupal8 using default Packagist.org (The composer packages repository) drupal repository.
composer create-project drupal/drupal drupal8

Few other repositorys.
composer create-project drupal/drupal drupal8 --stability dev
composer create-project drupalcommerce/project-base drupal8 --stability dev

If you gave a private repository, You can use a package.json like:

{
    "package": {
        "name": "yourname/your-drupal-project",
        "version": "1.0.0",
        "dist": {
            "url": "https://your.domain/url-to/your-drupal-project.zip",
            "type": "zip"
        }
    }
}

Then:

composer create-project yourname/your-drupal-project drupal8 --stability dev --repository=packages.json

 

 

Tips:

Clear composer cache

composer clear-cache

 

Big thanks to this blog author

Latest blog

Web Analytics