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:
- An existing Drupal site on Pantheon, or create a site.
- Reviewed the Get started with DDEV guide.
- Verified that you meet DDEV's system requirements.
Download and Install DDEV
Download the appropriate DDEV release for your Operating System.
Open the installer package and allow it to prepare.
Follow the system prompts to install DDEV.
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
Navigate to your Pantheon Dashboard and generate a machine token for use with your DDEV site.
Open your global DDEV configuration file at
~/.ddev/global_config.yamland add your Pantheon machine token to theweb_environmentsection, replaceinsertyourtokenwith your token value:web_environment: - TERMINUS_MACHINE_TOKEN=insertyourtokenClone the site's codebase, and from the site's root directory run:
ddev configStart your DDEV project locally by running the following command.
ddev startIn 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.Copy your site's
.ddev/providers/pantheon.yaml.exampleprovider file to.ddev/providers/pantheon.yaml.Information:NoteDo this in your site's
.ddevdirectory, not the global.ddevdirectory. The.ddev/providers/pantheon.yamlfile is a DDEV recipe for integration with Pantheon. For more information on DDEV provider integrations, see DDEV docs.Update the project name and environment variable in your new
.ddev/providers/pantheon.yamlfile. In the example below, the Pantheon project name isde8and the targeted Pantheon environment isdev.environment_variables: project: de8.devNow that you have the provider file created and edited, restart your DDEV containers with the following command:
ddev restartIf 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>Run the following command to pull your site's database and files from Pantheon into your local DDEV environment. You can add the
--skip-filesparameter if you don't want to sync the content files to your local.ddev pull pantheonRun the following command to open your local development URL in your browser:
ddev launch