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.yaml
and add your Pantheon machine token to theweb_environment
section, replaceinsertyourtoken
with your token value:web_environment: - TERMINUS_MACHINE_TOKEN=insertyourtoken
Clone the site's codebase, and from the site's root directory run:
ddev config
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.Copy your site's
.ddev/providers/example.pantheon.yaml
provider file to.ddev/providers/pantheon.yaml
.Info:NoteDo 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.Update the project name and environment variable in your new
.ddev/providers/pantheon.yaml
file. In the example below, the Pantheon project name isde8
and the targeted Pantheon environment isdev
.environment_variables: project: de8.dev
Now that you have the provider file created and edited, restart your DDEV containers with the following command:
ddev restart
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>
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
Run the following command to open your local development URL in your browser:
ddev launch