cPanel, Advanced Drupal topics

How to install the drush command line interface for Drupal on

Installing Drush in your cPanel Account

Drush is a command line-based tool for managing Drupal without needing to click through the web interface.

  1. SSH into your cPanel account.
  2. Start from your home directory (i.e. /home/cpanelaccountname ) or another suitable directory.
    1. Note: You should not install Drush inside public_html.
  3. Use Git to download the appropriate version of Drush for your version of Drupal:
    1.  git clone
    2. cd drush
    3. git checkout <desired branch>
      1. if you are running Drupal 7 - drupal 8.3, you probably want to use git checkout 8.x to checkout drush8
      2. if you are running Drupal 8.4+ , you probably want to use git checkout master to checkout drush9
      3. you can visit the install instructions here to view version compatibility between drush and drupal versions:
  4. Use composer to complete the Drush installation:
    1. composer install
    2. When this command is complete, Drush will be available on your cPanel system.
    3. Note: To view all of the packages that are installed with composer, use composer show 
  5. Optional steps
    1. edit ~/.bashrc to add alias for drush 
      1. Add alias drush="~/drush/drush" to the file.

    2. After saving the .bashrc edits, use source ~/.bashrc to reload the bashrc file.

    3. Type drush status to confirm which version of Drush you have installed.

    4. Type drush to see the list of commands available.

Keywords:cPanel, web hosting, Drupal, drush, command line, CLI   Doc ID:84966
Owner:Web H.Group:University of Illinois Technology Services
Created:2018-08-17 12:20 CDTUpdated:2018-08-24 15:58 CDT
Sites:University of Illinois Technology Services
Feedback:  0   0