What is Drush?
Drupal is a tool for building websites. Drush is a helper for Drupal. It lets you type short commands to do jobs like clearing the cache (saved copies of pages), updating modules, or running database updates. Drush is called a command-line tool, because you use it by typing, not clicking.
You need SSH access (a safe way to type commands on a server). You also need Composer, which is a tool that downloads PHP programs. If you are not sure your plan has SSH, ask Hostvento support.
Steps
- Connect to your hosting with SSH. Your details are in your welcome email.
- Check that PHP works:
php -v
This shows your PHP version.
- Check that Composer works:
composer --version
If it says "command not found", install Composer first by following its official instructions.
- Go to your Drupal project folder. This is the folder that holds the file
composer.json:
cd ~/my-drupal-site
Change the folder name to match your own.
- Add Drush to the project:
composer require drush/drush
This downloads Drush into the vendor folder of your project.
- Run Drush to test it:
./vendor/bin/drush --version
You should see a version number.
- Run a real command from inside your site folder:
./vendor/bin/drush status
This shows your Drupal version, database state and paths.
Make typing easier
Typing the long path each time is tiring. Create a shortcut (an alias) for your session:
alias drush='./vendor/bin/drush'
To keep the shortcut, add that line to the end of the .bashrc file in your home folder.
Common problems
- Not enough memory: Composer may stop. Try again with
php -d memory_limit=-1 $(which composer) require drush/drush. - PHP version too old: new Drush needs a newer PHP. Pick a newer PHP version in your control panel, or ask support.
Quick recap
- Drush runs Drupal jobs from the command line.
- You need SSH, PHP and Composer.
- Run
composer require drush/drushin the project folder. - Start it with
./vendor/bin/drush. - Back up before big changes.