Manage custom package using composer. | Drupal 8

Manage custom package using composer.

Submitted by editor on Tue, 01/03/2017 - 14:21

How to manage a custom packages using composer.

Composer can hadle CVS (git, svn ...) and ZIP packages.
To install/Update your custom modules, add a custom repository to the composer.json file, following this example.

1. Add package repositories
Here, youtubeapi and sadb

2. Require packages to install
Here, iwsp/youtubeapi and iwsp/sadb

3. Run:  composer update

    "repositories": {
        "youtubeapi": {
            "type": "package",
            "package": {
                "name": "iwsp/youtubeapi",
                "version": "1.0.2",
                "type": "drupal-module",
                "dist": {
                    "url": "",
                    "type": "zip"
        "sadb": {
            "type": "package",
            "package": {
                "name": "iwsp/sadb",
                "type": "drupal-module",
                "version": "1.0.0",
                "source": {
                  "url": "",
                  "type": "git",
                  "reference": "8.x-1.x"
    "require": {
        "composer/installers": "^1.0.21",
        "wikimedia/composer-merge-plugin": "~1.3",
        "drupal/core": "^8.2",
        "iwsp/youtubeapi": "^1.0",
        "iwsp/sadb": "*"


Note : If you are using http:// (not https://) add following config. But its recomended to use SSL.
    "config": {
        "secure-http": false

Install drupal with custom repository (Example)

composer create-project VENDER/DRUPAL --repository-url


Add new comment

This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.
Enter the characters shown in the image.