Development site

The environment where Drupal changes are built, for example a local DDEV copy with its own database and settings.local.php, before they ship to live.

Learn DrupalDrupal glossary

A development site is a private copy of a Drupal site where developers build and try changes before anything reaches visitors. It can run on a developer's own computer. Code, settings and configuration change here first, then move to a staging site and the live site.

How it works in Drupal 11

Drupal.org names DDEV as the recommended local development tool for Drupal. It adds that other Docker-based tools support Drupal too. Whatever the tool, the copy needs its own database and its own settings file.

Core ships a starting point for those settings. Copy sites/example.settings.local.php to sites/default/settings.local.php and uncomment the include block at the bottom of settings.php. The example file then:

  • loads sites/development.services.yml, which adds cacheability debug headers and a null cache backend;
  • sets the error level to verbose and turns off CSS and JavaScript aggregation;
  • lets you switch off the render cache, page cache and dynamic page cache by uncommenting lines;
  • turns on rebuild_access and skips file permission hardening.

The comment in default.settings.php lists the same kind of use for secondary installations: disabling caching and compression, and rerouting outgoing email.

Moving work between sites

Configuration is the set of settings, such as content types, fields and views, as opposed to the content of the site. The Drush workflow on Drupal.org exports it to the sync directory on development with drush config:export, copies the directory to the live site, and runs drush config:import there. Core refuses an import whose system.site UUID differs from the target, so both sites must carry the same UUID.

To bring live data down, drush sql:sync copies a database from a source site to a target site. drush sql:sanitize then removes or obfuscates user data: it replaces email addresses with a test pattern and randomizes passwords by default. Core's example file also shows $settings['config_exclude_modules'], which keeps development modules such as Devel out of the exported configuration.

Example

A developer sets up the site in DDEV from a copy of the live database, runs drush sql:sanitize, builds a new landing page type, and runs drush config:export. The changed YAML files go into Git with composer.lock. The team tests the same commit on staging before it ships.

Common mistakes

  • Keeping caches off for the whole project. The example file itself advises testing with the render cache, page cache and dynamic page cache enabled, to confirm that cacheability metadata is correct.
  • Working on real customer data. A raw live database carries real email addresses. Sanitize it, and reroute outgoing email in the local settings.

For marketing and content teams

A development site is not for editing real content: what you type there does not reach the live site, because only configuration is exported. Use it to review a new template or form with a developer, then enter the real text on the live site once the change is released.

Sources

Questions about Development site

A development site is where changes are made and first tried, for example on one developer's machine. A staging site is a shared copy that mirrors the live site, used for a final check before release. Both are private.

Commit code and the exported configuration, deploy the code, then import the configuration on the live site. Drupal.org's Drush workflow uses drush config:export on development and drush config:import on live. Nodes and users do not travel this way.

Drupal only imports configuration that comes from a copy of the same site. Core compares the system.site UUID of the source and target and rejects the import when they differ. A standard fresh install creates a new UUID. Build the development site from a copy of the live database, or install it from the exported configuration, which keeps the UUID.

Related terms

All Drupal terms from A to Z