Installing drush, the Drupal command line shell, on a GoDaddy Linux Shared Server Hosting Setup can be a hassle to say the least, especially getting past the drush is designed to be run from the command line error. I am going to make the process simple for you. When I began my journey with drush there wasn’t a whole lot of information on this specific subject, so this tutorial was born.
When I first came across drush, I knew right away that it was an awesome tool for installing and maintaining the Drupal Content Management System, and I was able to get it running on my windows machine rather easily. However, when I went to make the move, and install drush to my production hosting environment, which is on a Shared Linux Server through GoDaddy.Com, I ran into a few configuration and server feature problems that would not allow drush to operate successfully. These are the steps I took to install drush and have it running properly.
Installation Tutorial Video
First of all, in order to use drush and complete this drush tutorial you’re going to need to complete three simple pre-requisites. They are:
Enable SSH (Secure Shell) on your GoDaddy.Com Hosting Account.

You can enable SSH (Secure Shell) through the Settings Tab of your GoDaddy.Com Hosting Account’s Hosting Control Panel. After selecting SSH from the panel, just press the enable button on the screen, follow the simple instructions, and wait patiently as GoDaddy.Com moves your hosted files and databases to new servers that are accessible via SSH. This process takes around 24 hours, your content and DB’s will not be available during this time. However, the benefits of enabling SSH are great and the 24 hour down time is nothing like the days or even weeks it took GoDaddy.Com to enable SSH in the past.Create a database for the Drupal Installation performed towards the end of this tutorial.

After SSH has been enabled for your hosting account you need to create a database for the installing Drupal with drush portion of the tutorial. If you already have a DB available for this purpose then you’re already ready to rock.Get yourself a SSH terminal client for accessing your server via SSH.
A terminal client is a small program that allows you to access the command line of your Linux server. I use Putty (for windows), a simple single file freeware terminal client that can be downloaded from putty.com. You can use any SSH client you feel comfortable with. On a Mac you can find Apple’s SSH client under applications / utilities.
If you have got those first three things completed you’re ready to Install drush and use drush to install and maintain the Drupal Content Management System. Let’s begin our journey into the world of Shared Linux Servers. Hang on tight this is going to get exciting.
1. Log in to your server via SSH and Putty (or your terminal software of choice) by entering your server name and port 22 in your clients configuration and authenticating yourself with your GoDaddy hosting account username / password (hint: this is normally your ftp username/password)
2. Change the active directory to our HTML (web root) directory using the command
CD HTML
after successfully completing these steps you should see the Linux Bash Shell prompt shown above.
3. Use the ‘wget’ command to download the latest drush scripts directly from the repository to your server
wget follows the syntax wget http://url-to-download.com /file.zip (where the URL to download is the HTTP address of the file to download).
Notice how by using SSH we have eliminated the need to download / upload to and from our home PC’s and can manage our server directly from the server. You get the URL for the drush project from http://drupal.org/project/drush. Copy the link location from the latest stable releases download link about halfway down the page. I used:
wget http://ftp.drupal.org/files/projects/drush-6.x-3.3.tar.gz
4. Run the ‘tar’ command with the –xf switch on the downloaded drush-6.x-3.3.tar.gz file
This will unpack the file to the ~/html/drush/ directory. If you downloaded a newer or different version of drush, replace the filename above with the version you downloaded to your server. I used:
tar –xf drush-6.x-3.3.tar.gz
After completing steps 1-4 you will have the latest version of drush downloaded and unpacked to the ~/html/drush/ directory of your GoDaddy.Com Shared Linux Hosting Server.
5. As an exercise in futility let’s change the active directory to our drush installation and try to execute the drush script
cd drush
then
php drush.php
This results in the error message:
drush.php is designed to be ran from the command line
This is where I got stuck the first time I tried to install drush on my GoDaddy.Com Shared Linux Hosting Account. The problem rests in GoDaddy.Com eliminating access for their Shared Hosting accounts to the php-cli executable. The drush.php script tries to find php-cli and fails. This produces the above error
6. Next were going to change the active directory back to our user root directory (~) and list all files found in our user root (including hidden files)
cd ~/
then
ls -a
7. We remedy the php-cli problem by adding a couple of commands to the hidden .bashrc file using Vim, a Linux / UNIX text editor
If you have never used Vim you’re probably going to feel a little uncomfortable with its differences, but don’t fret you’ll figure it out. There are a lot of great resources on Vim around the Net.
vi .bashrc
We are going to add our commands and aliases under the commented out line that reads.
#User specific aliases and functions
Position your cursor under that line and hit the ‘I’ key on your keyboard. This places Vim into insert mode. Now we can add our commands to the file. Notice the word insert at the bottom left of your terminal screen.
First were going to add:
Export COLUMNS
This command instructs our bash shell on how to process variables passed between our script processes. It allows the momma drush.php process to receive variables from any children processes she creates. Next add our drush alias:
alias drush=’/usr/local/php5/bin/php ~/html/drush/drush.php’
Then we will add an alias to our php executable:
alias php=’/usr/local/php5/bin/php’
Your .bashrc file should look something similar to the image above. The drush alias will allow us to run drush from anywhere within our shell and the php alias will ensure that drush is using the proper php interpreter.
8. Hit ‘esc’ on your keyboard to leave insert mode
9. Hit shift + colon ‘:’ and type a ‘w’ at the newly created prompt in the bottom left corner of your terminal
10. Press enter to write the edited .bashrc file to your server
11. Hit shift + colon ‘:’ and type a ‘q’ and press enter at the prompt to exit Vim and return to the bash shell
12. The only thing left to do after editing our .bashrc file is to logout of the server and log back in again.This will initialize the newly created aliases
After doing so you should be able to use the drush command from your terminals command prompt.
drush
If you successfully completed all of the above steps you will be presented with the drush help file, which lists all the available commands to use with drush. This signifies your success in getting drush installed and configured on your GoDaddy.Com Linux Shared Hosting Account!
We will be introducing you to some of the cooler functions and uses of drush in several tutorials coming soon to JoshRiddle.Com. Feel free to leave me a comment or ask any questions below. Also for information on the bash shell, Vim, SSH, Goddady, drush or Drupal, check out the following links. For a step by step demonstration of this tutorial check out the video at the top of this page!
Drupal and Drush Links:
BASH shell and Vim links:
GoDaddy.Com Hosting:
The SSH (Secure Shell) Wiki







Thanks, this a pretty good job.
Awsome. Thanks.
Thanks for the tutorial. I did have a little trouble with entering the new commands into the bashrc file. I copied and pasted from this page, but there is a ‘:’ after alias that is not required in bashrc.
You are absolutely right about the “:”. Thanks I fixed that.
Got another question for you:
I’ve run drush on the godaddy site. It updates the module code just fine, but it will not update the core. I get these errors:
Do you really want to continue? (y/n): y
WD php: [error]
rename(/home/content/t/v/v/tvvv1/html/stats,/home/content/t/v/v/tvvv1/html/drupa l-6.19/stats):
Permission denied in
/home/content/t/v/v/tvvv1/html/drush/commands/pm/updatecode.pm.inc on
line 217.
Unable to include the version_control engine backup from [error]
/home/content/t/v/v/tvvv1/html/drush/commands/pm/version_control.
rename(/home/content/t/v/v/tvvv1/html/stats,/home/content/t/v/v/tvvv1/html/drupa l-6.19/stats):[warning]
Permission denied in
/home/content/t/v/v/tvvv1/html/drush/commands/pm/updatecode.pm.inc on
line 217.
An error occurred at function : drush_pm_updatecode [error]
It looks like some kind of linux permission problem, but I’m not knowledgeable enough to know for sure.
What do you think?
Thanks
It probably has something to do with a file permission within the drupal installation you are trying to update
[...] a few tutorials on fixing it. The best amongst them which worked 90 percent for me was this one by Joshua Riddle again as I figured out it was basically a Godaddy problem which was not allowing Drush to run [...]
Really awesome. There were always a few small details that I didn’t get that prevented me from installing Drush but you took care of them with the three lines of bash edits. Thanks a lot
Thanks for this resource. In case someone else runs into the same problem I did, I just went through this with a newly configured godaddy hosting account and found that I had to use .bash_profile rather than .bashrc in order to get the aliases working and drush up and running.
Interesting, I used .bashrc on my godaddy hosting account. Thanks for the info.
I need to use .bash_login since .bashrc isn’t executing when I login via SSH.
great post, thanks for sharing
thanks for post!
I did everything as you described, but i still have problem:
drush: command not found
I can’t understand that there is no correctly …
Have you tried using .bash_profile instead of .bashrc as stated by BBC above?
Yes. I have already changed the file name to .bash_profile.
And there was another error:
“/usr/local/php5/bin/php: Symbol `client_errors’ has different size in shared object, consider re-linking”
But Drush help is show.
Now seeking a solution to the problem …
About “…Symbol `client_errors’ …”:
http://community.godaddy.com/groups/web-hosting/forum/topic/joomla-cgi-binphp5-symbol-client-errors/
@Paul – Great Link..I know a few people who have run into this .. like GoDaddy States…It is not a problem
Hi Joshua !
I have tried to install “drush” via “WinSCP” and “Putty”. When i test drush, i have an message :
# -bash: drush: comman not found
Did you add the following to your bashrc. or .bash_profile files and then logout and back in via ssh?
Also did you follow my tutorial, i didn’t say anything about winSCP.
Export COLUMNS
alias drush=’/usr/local/php5/bin/php ~/html/drush/drush.php’
This is what allows you to call drush by just drush otherwise you have to call php “path to drush.php”
Nice tutorial, I’ll try this on my website and let you know. Thank you.
Drush is working, mostly. I get the following error when running drush updatedb.
The command could not be executed successfully (returned: Content-type: text/html drush is designed to run via the command line., code: 0)@Brian, You can use drush in other fashions, but it wont perform the updatedb command? That is a strange one. I will have to get back to you on that. What does your .bashrc or aliases file look like?
You the man! Thanks for typing this out.
just a note that on a new GoDaddy shared host site, i had to actually create a .profile with the following inside to get it to work. there was nothing in my root like .bashrc or .bash_profile and the server was not recognizing them. maybe something changed at GoDaddy but just for anyone still having issues, after placing drush folder in your root, create a new file in your root called .profile and put the following inside:
export COLUMNS
alias drush=’/usr/local/php5/bin/php ~/drush/drush.php’
Thanks for the great info!
That’s is write:
You can create either or these files to put your aliases:
.bash_profile
.profile
.bashrc
1. Then Insert:
export COLUMNS
alias drush=’/usr/local/php5/bin/php ~/html/drush/drush.php’
Then worked for me:
2. Omitting ~/html directory did not work which is in this:
export COLUMNS
alias drush=’/usr/local/php5/bin/php ~/drush/drush.php’
If 2nd is not working for you 1st should work;
Thank you for the great post:
Looks like Godaddy closed this hole as well. Just as Will said, I also couldn’t find a .bashrc or .bash_profile file. After following his instructions, I still get the header output.
Have you tried creating the .bashrc or .bash_profile. If it doesn’t exists create a new file with Vi and enter the above information. I will do a little more research and post what I find. My hosting still works great with drush, I used the original method I posted with the .bashrc file.
Thank you very much. .bash_profile was needed in my case, without the Export COLUMNS statement.
I got it working via the .profile file. I get a strange message :
/usr/local/php5/bin/php: /usr/local/lib/libpng12.so.0: no version information available (required by /usr/local/php5/bin/php)
..but then it executes drush as it normally would. I seem to get this message with about anything I do using php.
Anyway thrilled that I got it to work. It wasn’t clear to me that I could access a php v5 this way.
thanks for the write up and comments!
I think it is crazy how we all have had different experiences with the same hosting provider. I am sure it has something to do with the way their services have changed over the years. My hosting plan was purchasec and paid for four years ago.
Great! Many thanks.
In your wonderful video everything is correct; however, I think two things need to be corrected in the instructions in this page:
1. The command:
Export COLUMNS
results in the following error:
-bash: Export: command not found
The “export” command needs to be in lowercase:
export COLUMNS
2. In the following commands:
alias drush=’/usr/local/php5/bin/php ~/html/drush/drush.php’
alias php=’/usr/local/php5/bin/php’
The ’ character needs to be replaced by ‘
alias drush=’/usr/local/php5/bin/php ~/html/drush/drush.php’
alias php=’/usr/local/php5/bin/php’
Hi again! It seems that the simple quotation mark in the page and also in my comment turns to the opening or closing quotation mark. Simple single quotation marks are needed for the alias to work.
Thank you for the tutorial. I am new to drush and Drupal. I followed your tutorial, but when i log in to my godaddy linux server via Putty I do not have all the files as you have .
Once i log in i have at the cmd -bash-3.2
when i type ls -a
i do not see the .bashrc I only have the following
. .. .bash_history .cgi_auth .disk_usage .viminfo data html tmp
please help.
Thanks
Farhad
Thanks all for your posts. I got it to work. As Will said you need to create .profile in your root directory. Use the vi to edit .profile , copy the following :
export COLUMNS
alias drush=’/usr/local/php5/bin/php ~/html/drush/drush.php’
this works if you had drush extracted to the html directory as Joshua’s instructions indicate.
THanks
Great Job. Best tutorial I’ve seen
Great post and follow-on comments.
Is there any difference b/t keeping drush in ~/drush vs ~/html/drush?
Thanks!
No ..you can keep it anywhere you like within your user directories on the server.
Great tutorial. Thanks a lot for your help and for opening new possibilities!
Best summary of this EVER!!!!!!
this is not working … I followed everything to a t… copy and pasted everything. I even called godaddy to see if they placed their php into different server locations… What am I doing wrong… I need drush on the server.
oops… the .profile worked
Hello Joshua Riddle,
I use the godaddy shared server hosting.But I can’t find the hidden .bash file anywhere.” .bash_history” is what I can only find related to bash.But it can not be the .bash file as you have mentiond.It is all about my bash log.If u got free time,please help me by email.Thanks a lot!
you should be able to find the .bashrc or .bash_profile or .profile (depending on which version of shared hosting) in your user directory. you get there with a “cd /~” command and the “ls -a” will show you all the files in the directory. if you still cannot find them, try to create a .profile file with the command “vi .profile”.
Thank YOU. I am glad I ran across this info, I was thinking it would be a long night installing and configuring modules!
Your Welcome…I am about to rewrite this and redo the video for the site revamp i am about to unleash on the world~
Thank you so much. This was a great time saver. For mac users, be careful when copying the lines for .bashrc. I got some odd characters that threw me for awhile. Delete them and make sure you have:
alias drush=’/usr/local/php5/bin/php ~/path_to_drush.php’
I had odd characters after the = sign and at the end of the line and the single quotes were not there.
Thanks again.
excellent tutorial
Greate tutorial for a greate tool, Thanks!
Thanks for the effort you put into this tutorial. It is still helping.