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_environmentsection in your global DDEV configuration at$HOME/.ddev/global_config.yaml(see global configuration directory).
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.yamlfile 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 pantheonmake 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 cloneto check out the code locally. -
Configure the local checkout for DDEV using
ddev config. -
Add
DDEV_PANTHEON_SITEandDDEV_PANTHEON_ENVIRONMENTvariables to your project.ddev/config.yaml:You can also do this with
ddev config --web-environment-add="DDEV_PANTHEON_SITE=yourprojectname,DDEV_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=DDEV_PANTHEON_SITE=yourprojectname,DDEV_PANTHEON_ENVIRONMENT=devfor example.Legacy Variable Names
The old
PANTHEON_SITEandPANTHEON_ENVIRONMENTvariable names are still supported for backward compatibility but are deprecated. These names conflict with Pantheon’s own environment variables, which can cause applications to misidentify their runtime environment. UsingDDEV_PANTHEON_SITEandDDEV_PANTHEON_ENVIRONMENTis strongly recommended. -
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 pantheonto push local files and database to Pantheon. Theddev pushcommand can potentially damage your production site, so we don’t recommend using it.
Using Existing Backups vs Fresh Database Dumps¶
By default, ddev pull pantheon generates a fresh database dump, which ensures you get the most current data but can take several minutes. For faster pulls, you can use existing Pantheon backups instead.
To use existing backups, set DDEV_USE_PANTHEON_BACKUP=true:
Or use it for a one-time pull:
When to use existing backups
- During development when you need to refresh your local environment frequently
- When the backup is recent enough for your needs
- When you want faster pull times
Backup freshness
Existing backups may not include the very latest data. Check your Pantheon dashboard to see when the last backup was created. Fresh dumps are generated on-demand and reflect the current state of your database.