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. you can find a list of releases here:
      2. if you are running Drupal 7 - drupal 8.3, you want to use drush 8
        1. "git checkout 8.x" will get you the latest version, including dev versions
        2. "git checkout tags/8.1.17" will get you the the 8.1.17 release
          1. releases for drush 8 are infrequent
      3. if you are running Drupal 8.4+ , you want to use Drush 9
        1. "git checkout master" will get you the latest version, including dev versions
        2. "git checkout tags/9.5.2" will get you the 9.5.2 release
          1. releases for drush 9 are fairly frequent, so you may wish to check the list
      4. 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 11:20 CSTUpdated:2019-01-14 15:50 CST
Sites:University of Illinois Technology Services
Feedback:  0   0