Skip to content

ReferenceFor module developers, site buildersDrupal 11

Drush command cheat sheet

Drush is the command-line companion most Drupal work runs through. This is the daily shortlist for Drush 13; every command takes --help, and drush list shows the full set, including commands that installed modules add. Inside DDEV, run them as ddev drush .... Outside DDEV, run vendor/bin/drush from the project root, or put vendor/bin on your PATH.

CommandAliasDoes
drush cache:rebuildcrRebuild all caches. The command you run most.
drush cache:clear <type>ccClear one cache type, e.g. drush cc router.
CommandAliasDoes
drush config:exportcexWrite active configuration to the sync directory.
drush config:importcimImport configuration from the sync directory.
drush config:get <name>cgetPrint a configuration object, e.g. drush cget system.site.
drush config:set <name> <key> <value>csetSet a single configuration value.
drush config:statusShow what differs between active config and the sync directory.
CommandAliasDoes
drush deployRun the standard deploy steps in order: updatedb, config:import, cache:rebuild, then deploy:hook (hook_deploy_NAME() in MODULE.deploy.php), and on Drupal 11.2 and later cache:warm.
drush updatedbupdbApply pending database and module update hooks.
drush updatedb:statusList pending updates without running them.

drush deploy does not run composer install; run that first. See the deployment workflow.

CommandAliasDoes
drush pm:install <module>enInstall one or more modules.
drush pm:uninstall <module>pmuUninstall one or more modules.
drush theme:install <theme>Install a theme.
drush pm:listpmlList modules and themes with their status.
CommandAliasDoes
drush site:install <profile>siInstall a fresh site. Drops the existing database.
drush statusstShow core version, paths, database, and bootstrap state.
drush user:loginuliPrint a one-time login link (defaults to user 1).
drush user:create <name>Create a user account.
drush user:password <name> <pass>Set a user’s password.
CommandAliasDoes
drush watchdog:showwd-show, wsTail recent log messages.
drush php:eval '<code>'evRun a line of PHP with Drupal bootstrapped.
drush php:script <file>scrRun a PHP script with Drupal bootstrapped.
drush core:requirementsrqReport the status checks from the admin status page.
CommandAliasDoes
drush generategenScaffold modules, plugins, services, and more, interactively.
CommandAliasDoes
drush queue:run <name>Process a queue’s items now.
drush queue:listList registered queue workers.
drush cronRun cron.

Was this page helpful?

Drupal is a registered trademark of Dries Buytaert.