Installing

Installing Commerce to contribute back? Check out our Getting ready for development guide.

Be sure to review requirements before starting the installation process.

New site

The following command will download Drupal 8 + Commerce 2.x with all dependencies to the mystore folder:

 composer create-project drupalcommerce/project-base mystore --stability dev

Install it just like a regular Drupal site. Commerce will be automatically enabled for you.

Tips:

  • The bin folder contains any library binaries, such as Drupal Console, PHPUnit, Behat, etc.
  • The web folder represents the document root.
    • If you host your site on Acquia Cloud or another service that requires Drupal in a subdirectory other than web, these instructions describe how you can relocate the docroot.
  • Composer commands are always run from the site root (mystore in this case).
  • See the Composer template for Drupal projects README for more details.

Existing site

Run these commands in the root of your website:

Download Commerce

This will also download the required libraries and modules (Address, Entity, State Machine, Inline Entity Form, Profile).

 cd /path/to/drupal8
 composer require "drupal/commerce"

Enable Commerce

The instructions below use Drupal Console

 drupal module:install commerce_product commerce_checkout commerce_cart

Alternative installation instructions for Ludwig users

Composer is the recommended way to install and maintain a site. Site administrators using Ludwig need to be careful when combining modules that depend on external libraries, since there are no safeguards against incompatible library versions or overlapping requirements.

These instructions assume you are working with an existing site. See the Drupal.org documentation on Installing Drupal 8 if you do not have an existing site.

  1. Download and install the Ludwig module.

  2. Download Commerce and the following 6 required modules. Do not install the modules yet.

  3. Ludwig generates a listing of libraries required by those modules. The Packages page at admin/reports/packages provides a download link for each missing library along with the paths where they should be placed.

Ludwig user interface

  1. Download the libraries, then clear the cache to make them available. For example, download commerceguys/addressing and place it in modules/contrib/address/lib/commerceguys-addressing/v1.0.0. You should see the STATUS for each required package change from "Missing" to "Installed". Alternatively, if you are comfortable with the command line, you can use Drupal Console or Drush commands.

    Drupal Console

    • ludwig:list: List all managed packages.
    • ludwig:download: Download missing packages.

    Drush

    • ludwig-download: Download missing packages.
  2. Install Commerce and the 6 required modules.

Whenever Commerce needs to be updated, all 7 modules need to be downloaded again, and then all of their libraries need to be downloaded again as well.


In subsequent sections of the Installation and updates documentation, it is assumed that you are using Composer to manage your site.

Found errors? Think you can improve this documentation? edit this page