You are here

How install drush on Cpanel

Log into your cPanel hosting account via SSH. Make sure SSH is enabled for your IP before connecting.
Once logged in, make sure you are in the home directory of your hosting account.

From your home directory, use the wget command to get the newest version of Drush.

wget https://github.com/drush-ops/drush/archive/master.zip

Unzip the drush file archive by using the following command

unzip -q master.zip

Rename this directory to simply be 'drush', by using the following command:

mv drush-master drush

Now we need to update our .bashrc file so that bash executable knows to recognize the alias 'drush.'

You may do so by adding the following line to the .bashrc file in your home directory.

alias drush='~/drush/drush'

or, from the command line by using this line:

echo "alias drush='~/drush/drush'" >> .bashrc

Installing Composer

Navigate to the drush directory by using the cd command.

cd drush

curl -sS https://getcomposer.org/installer | php

Run the command that composer provides to you to properly install Drush.

php composer.phar install

Cleanup

cd ~
source .bashrc

Now, lastly to confirm that drush is running, type the command:

drush help

code type: