The preferred way to install Drush is via our PEAR channel. See instructions at
http://drupal.org/project/drush. If you prefer a more manual install, see
1. Place the uncompressed drush.tar.gz, drush.zip, or cloned git repository in
a directory that is outside of your web root.
2. Make the 'drush' command executable:
$ chmod u+x /path/to/drush/drush
3. Configure your system to recognize where Drush resides. There are 2 options:
a) create a symbolic link to the Drush executable in a directory that is
already in your PATH, e.g.:
$ ln -s /path/to/drush/drush /usr/bin/drush
b) explicitly add the Drush executable to the PATH variable which is defined
in the the shell configuration file called .profile, .bash_profile,
.bash_aliases, or .bashrc that is located in your home folder, i.e.:
Your system will search path options from left to right until it finds a
To apply your changes to your current session, either log out and then log
back in again, or re-load your bash configuration file, i.e.:
$ source .bashrc
NOTE: If you do not follow step 3, you will need to inconveniently run Drush
commands using the full path to the executable "/path/to/drush/drush" or by
navigating to /path/to/drush and running "./drush". The -r or -l options will
be required (see USAGE, below).
4. Test that Drush is found by your system:
$ which drush
5. Optional. Help the Drush development team by sending anonymized usage
statistics. To automatically send usage data, please add the following to a
$options['drush_usage_log'] = TRUE;
$options['drush_usage_send'] = TRUE;
Stats are usually logged locally and sent whenever log file exceeds 50Kb.
Alternatively, one may disable automatic sending and instead use usage-view
and usage-send commands to more carefully send data.
6. Optional. See examples/example.bashrc for instructions on how to add some
useful shell aliases that provides even tighter integration between
drush and bash. You may source this file directly into your shell by adding to
your .bashrc (rr equivalent): source /path/to/drush/examples/example.bashrc
7. Optional. If you didn't source it in Step 6 above, see top of
drush.complete.sh file for instructions adding bash completion for drush
command to your shell. Once configured, completion works for site aliases,
command names, shell aliases, global options, and command-specific options.
8. Optional. If drush.complete.sh is being sourced (ideally in
bash_completion.d), you can use the supplied __drush_ps1() sh function to
add your current drush site (set with `drush use @sitename`) to your PS1
prompt like so:
if [ "\$(type -t __git_ps1)" ] && [ "\$(type -t __drush_ps1)" ]; then
PS1='\u@\h \w$(__git_ps1 " (%s)")$(__drush_ps1 "[%s]")\$ '
Putting this in a .bashrc/.bash_profile/.profile would produce this prompt:
msonnabaum@hostname ~/repos/drush (master)[@sitename]$