Skip to main content

How to install Drush 8 (for Drupal 8) in a shared hosting environment

Since Drush does not run as a daemon, it is very easy to install it in your shared hosting account.

First of all, uninstall Drush 7 if you have it installed. Removing the .drush folder is enough.

Then download latest stable release using the code below:

wget http://files.drush.org/drush.phar;

Test your install:

php drush.phar core-status;

Make it executable.

chmod +x drush.phar;

Rename to 'drush' instead of 'php drush.phar':

mv drush.phar drush;

Since you don’t have root access to your file system, you have to run Drush by providing the full path like this:

/home/your_user/drush do_stuff;

To avoid this, you can store an alias of this command in your .bashrc file:

alias drush='/home/your_user/drush';

Reload your profile:

source ~/.bashrc;

Test again to see if it works:

drush core-status;

Running drush init to enrich the bash startup file with completion and aliases, created problems for me the next time I tried to ssh into my account. If you do that and you have problems, just delete the .drush folder in your home directory.