This article discusses how to install Drush on InMotion Hosting servers. You will need to have SSH access and root access on your account in order to install Drush. If you do not yet have root access, please see our article on obtaining root access for your account. The steps below assume you have the ability to connect to your server via SSH. If you do not have the ability to do so, you will need to enable SSH on your server and then add your IP to the firewall so it can connect.
How to install Drush
- Connect to your server via SSH.
- Once connected, confirm that PEAR is on the server. You can do this by typing the command “pear version” in your command line. You should have no issue with this as all our servers have PEAR on them by default. The command should produce results similar to the example below.
$ pear version
PEAR Version: 1.9.4
PHP Version: 5.4.20
Zend Engine Version: 2.4.0
- Once confirmed, simply type in the command “pear channel-discover pear.drush.org” on your console. This will initialize the channel and add it to your PEAR channel list.
$ pear channel-discover pear.drush.org
Adding Channel “pear.drush.org” succeeded
- After adding the channel, we now need to install Drush. This is done by typing “pear install drush/drush” in the command line. You should see the install succeed as the code below demonstrates.
$ pear install drush/drush
downloading drush-184.108.40.206.tgz …
Starting to download drush-220.127.116.11.tgz (505,989 bytes)
…………………………..done: 505,989 bytes
install ok: channel://pear.drush.org/drush-18.104.22.168
Installing a specific version of Drush
The steps above will install the most current stable version of Drush onto your server. You may, however, need a specific version of Drush installed. For example, if you are using php version 5.2, you cannot use Drush version 6. You will need to install version 5.9. To do this, simply enter the install command as shown below.
Should things go wrong, or you simply decide that you no longer wish to use Drush, you can uninstall it from your server with the “pear uninstall” command. Below is an example of how to uninstall drush.
uninstall ok: channel://pear.drush.org/drush-22.214.171.124
You now know how to install and even uninstall Drush from your server here at InMotion Hosting. Should you have any further questions, be sure to take a search through our Community Support Center. If you cannot find your topic there, be sure to ask the team a question and we will get back with you as soon as possible.