Using Drush for your Drupal site
Drush is a command‑line shell and scripting interface for Drupal. It allows administrators and developers to manage Drupal sites more efficiently by automating tasks that would otherwise require multiple clicks in the web interface. On ruachost.com, Drush is supported on Managed VPS accounts. Contact Ruachost support to check availability on shared hosting.
Why Use Drush?
Section titled “Why Use Drush?”- Speeds up routine site administration.
- Automates updates, backups, and cache clearing.
- Provides powerful tools for developers.
- Reduces reliance on the Drupal web interface.
Common Drush Commands
Section titled “Common Drush Commands”| Command | Purpose |
|---|---|
drush status |
Displays site information (Drupal version, database, PHP). |
drush cache-rebuild |
Clears and rebuilds all caches. |
drush up |
Updates Drupal core and contributed modules. |
drush user-password admin --password="newpass" |
Resets the administrator password. |
drush sql-dump |
Exports the database for backup. |
drush cron |
Runs Drupal’s cron routine manually. |
drush en modulename |
Enables a module. |
drush pm-uninstall modulename |
Uninstalls a module. |
Installing Drush
Section titled “Installing Drush”-
Connect to your server via SSH.
-
Navigate to your Drupal installation directory.
-
Install Drush using Composer:
Terminal window composer require drush/drush -
Verify installation:
Terminal window drush --version
Important Notes
Section titled “Important Notes”- Drush requires Composer and SSH access.
- Always back up your site before running update or uninstall commands.
- Use Drush aliases to manage multiple sites more efficiently.