Skip to main content

Install and Configure DDEV for Drupal

Install and configure DDEV for Drupal local development.


This section provides information on how to use DDEV for local development with Drupal sites on Pantheon.

Before You Begin

Be sure that you have:

Download and Install DDEV

  1. Download the appropriate DDEV release for your Operating System.

  2. Open the installer package and allow it to prepare.

  3. Follow the system prompts to install DDEV.

  4. Choose and install a supported Docker provider for use with DDEV, then open the program on your machine before you proceed.

Use DDEV with Pantheon

  1. Navigate to your Pantheon Dashboard and generate a machine token for use with your DDEV site.

  2. Open your global DDEV configuration file at ~/.ddev/global_config.yaml and add your Pantheon machine token to the web_environment section, replace insertyourtoken with your token value:

    web_environment:
        - TERMINUS_MACHINE_TOKEN=insertyourtoken
  3. Clone the site's codebase, and from the site's root directory run:

    ddev config
  4. Start your DDEV project locally by running the following command.

    ddev start

    In addition to starting local Docker containers for the site, this command will also install DDEV provider integration recipes to your site's codebase at .ddev/providers, which we will use in the next step.

  5. Copy your site's .ddev/providers/example.pantheon.yaml provider file to .ddev/providers/pantheon.yaml.

    Info:
    Note

    Do this in your site's .ddev directory, not the global .ddev directory. The .ddev/providers/pantheon.yaml file is a DDEV recipe for integration with Pantheon. For more information on DDEV provider integrations, see DDEV docs.

  6. Update the project name and environment variable in your new .ddev/providers/pantheon.yaml file. In the example below, the Pantheon project name is de8 and the targeted Pantheon environment is dev.

    environment_variables:
      project: de8.dev
  7. Now that you have the provider file created and edited, restart your DDEV containers with the following command:

    ddev restart
  8. If you haven't already, create a backup on the Pantheon environment you configured in step 6 above. You can create a new backup from the site dashboard, or via Terminus:

    terminus backup:create <site>.<env>
  9. Run the following command to pull your site's database and files from Pantheon into your local DDEV environment. You can add the --skip-files parameter if you don't want to sync the content files to your local.

    ddev pull pantheon
  10. Run the following command to open your local development URL in your browser:

    ddev launch

More Resources