Quickstart with ddev


  • Drupal 8 system requirements
  • Install Composer.
  • Install ddev.

    Create your Drupal Commerce project.

    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

    Configure ddev for local development.

    Navigate to the project directory (which is 'mystore', unless you changed it in the above command).

    Configure ddev:

    cd mystore
    ddev config

    When prompted:

  • Leave the project name set to the name of your project directory (mystore).
  • Leave the docroot location set to 'web'.
  • Leave the project type set to 'drupal8'.

    At this point, you can start up your project environment. However, you may want to first change the http and https ports for your site, which are set to 80 and 443 by default. If these ports are already in use on your machine, you will get the following error message:

Failed to start commerce-docs: Unable to listen on required ports, localhost port 80 is in use, Troubleshooting suggestions at https://ddev.readthedocs.io/en/latest/users/troubleshooting/#unable-listen

To change the ports used by ddev, open the file .ddev/config.yaml in your project. Edit the router_http_port and router_https_port values and save the file.

Start running your project:

 ddev start

When the project successfully starts, you will be given the address for your new site. For example: http://mystore.ddev.local:8080. Copy and paste your site address into a browser.

Install Drupal 8

The first time you access your site, you will be asked for some basic configuration information. For the database configuration, use ddev describe to view your MySQL Credentials:

 MySQL Credentials
 Username:      db
 Password:      db
 Database name: db
 Host:          db
 Port:          3306

Note that you need to open the 'Advanced options' section of the form to enter the Host value.

Getting started

The very first thing you'll want to do to get started with Drupal Commerce is create a store. Under the Commerce menu in the toolbar, navigate to Configuration > Store > Stores and click the Add store button. Once you've created a store, you'll be able to create products and start developing the rest of your site.


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