Pantheon Integration¶
DDEV provides configurable integration with the Pantheon Website Management Platform, which allows Pantheon users to quickly download and provision a project from Pantheon in a local DDEV-managed environment.
DDEV’s Pantheon integration pulls an existing backup from an existing Pantheon site/environment into your local system. That means you must already have a Pantheon site with a backup in order to use it.
Pantheon Quickstart¶
If you have DDEV installed, and have an active Pantheon account with an active site, you can follow this guide to spin up a Pantheon project locally.
ddev pull pantheon
fails due to Terminus version mismatch
See How to Downgrade Terminus in DDEV’s Web Container and Customize Other Bundled Tools.
-
Get your Pantheon machine token:
- Log in to your Pantheon Dashboard and Generate a Machine Token for DDEV to use.
-
Add the API token to the
web_environment
section in your global DDEV configuration at~/.ddev/global_config.yaml
.
What if I have more than one API token?
To use multiple API tokens for different projects, add them to your per-project configuration using the
.ddev/config.local.yaml
file instead. This file is gitignored by default. -
Choose a Pantheon site and environment you want to use with DDEV. You can usually use the site name, but in some environments you may need the site ID, which is the long third component of your site dashboard URL. So if the site dashboard is at
https://dashboard.pantheon.io/sites/009a2cda-2c22-4eee-8f9d-96f017321555#dev/
, the site ID is009a2cda-2c22-4eee-8f9d-96f017321555
. -
For
ddev push pantheon
make sure your public SSH key is configured in Pantheon under Account → SSH Keys. -
Check out the project codebase from Pantheon. Enable the “Git Connection Mode” and use
git clone
to check out the code locally. -
Configure the local checkout for DDEV using
ddev config
. -
Add
PANTHEON_SITE
andPANTHEON_ENVIRONMENT
variables to your project.ddev/config.yaml
:You can also do this with
ddev config --web-environment-add="PANTHEON_SITE=yourprojectname,PANTHEON_ENVIRONMENT=dev"
.You can usually use the site name, but in some environments you may need the site ID, which is the long third component of your site dashboard URL. So if the site dashboard is at
https://dashboard.pantheon.io/sites/009a2cda-2c22-4eee-8f9d-96f017321555#dev/
, the site ID is009a2cda-2c22-4eee-8f9d-96f017321555
.Instead of setting the environment variables in configuration files, you can use
ddev pull pantheon --environment=PANTHEON_SITE=yourprojectname,PANTHEON_ENVIRONMENT=dev
for example. -
Run
ddev restart
. -
Run
ddev pull pantheon
. DDEV will download the Pantheon database and files and bring them into the local DDEV environment. You should now be able to access the project locally. -
Optionally use
ddev push pantheon
to push local files and database to Pantheon. Theddev push
command can potentially damage your production site, so we don’t recommend using it.