Is it possible to display the site UUID on a Drupal 8 module?

2 Answers 2


"display" is pretty ambiguous, but you can get the site UUID like so:

$uuid = \Drupal::config('system.site')->get('uuid');

(depending on context, injecting the config.factory service would be preferable)

It's a string so rendering it will be easy.


for you Drupal 8 site

drush config-get "system.site" uuid

or if you need to change it

drush config-get "system.site" uuid "number you want"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.