Version Identifiers
A Version Identifier is an optional string that appears alongside your environment name (Development, Staging, Production, Localhost, etc.) to show exactly which code or release version is running—whether via Git data, a deployment tag, or the Drupal core version.

Primary Sources
-
Environment Indicator Current Release (default)
-
Reads
environment_indicator.current_releasefrom the state API.
-
-
Deployment Identifier
-
The deployment identifier mechanism is provided by Drupal core and is used by various hosting providers. It is a string that can be used to identify a particular deployment of your site. This is useful for identifying the specific code or configuration version currently deployed. The deployment identifier can be set in the
settings.phpfile or through other mechanisms in your deployment process.
-
-
Drupal Core Version
-
The currently installed version of Drupal. Tagged releases only.
-
-
None
-
Don't display any version identifier.
-
How to Configure via the UI
Go to Administration » Configuration » Development » Environment Indicator Settings
-
Select your primary source from the "Source of version identifier to display" select element.
-
Select your fallback source from the "Fallback source of version identifier" select element.
-
If your primary source is empty or missing, pick one of the same options above as a fallback. Choosing None as your primary source disables fallback behavior.
-
-
Click Save configuration.
How to Configure via Drush
# Set primary source (e.g. deployment_identifier)
drush config:set environment_indicator.settings version_identifier deployment_identifier
# Set fallback source (e.g. environment_indicator_current_release)
drush config:set environment_indicator.settings version_identifier_fallback environment_indicator_current_release
# Rebuild caches
drush crUsing a static message with the "version identifier" feature.
Put a text string into environment_indicator.current_release to be displayed in the version identifier slot.
drush state:set environment_indicator.current_release "Hello World!"Using git information with the "version identifier" feature.
Put a git version string into environment_indicator.current_release to be displayed in the version identifier slot.
Branch + tag + commit:
drush state:set environment_indicator.current_release "$(git describe --contains --all HEAD; echo " "; git describe --always)"
Captures the current branch followed by the latest tag, number of commits since the tag, and the short current commit hash (e.g. dev 0.6.1-8-g629134f).
Tag + commit only:
drush state:set environment_indicator.current_release "$(git describe --always)"
Captures only the latest tag, number of commits since the tag, and the short current commit hash (e.g. 0.6.1-8-g629134f).
Using the Deployment Identifier in settings.php.
Drupal's dependency injection container will be automatically invalidated and rebuilt when the Drupal core version changes. When updating contributed or custom code that changes the container, changing this identifier will also allow the container to be invalidated as soon as code is deployed.
Typically set in the settings.php file or through your deployment process.
Example: $settings['deployment_identifier'] = \Drupal::VERSION;
Help improve this page
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion