Project

General

Profile

Install drush » History » Version 3

Jon Goldberg, 11/21/2017 08:47 PM

1 1 Jon Goldberg
{{last_updated_at}} by {{last_updated_by}}
2
# Install drush
3
4
{{>toc}}
5
6
You can install drush via Composer, a .phar, or from git.  Your local machine may need multiple versions of drush to match the versions available on live sites.  In that instance, let's consider using the methods described on this page.
7 2 Jon Goldberg
When installing drush on a live site, installing a .phar file is preferred.  For now, let's default to using drush 7 until [issue 1581](https://github.com/drush-ops/drush/issues/1581) is fixed, then let's standardize on drush 8.
8 1 Jon Goldberg
9
## Installing drush 7 on a production site
10
11 2 Jon Goldberg
* Determine the version number for the most recent stable release of drush 7 from [this page](https://github.com/drush-ops/drush/releases).  In this example, 7.4.0 is the latest version.
12 1 Jon Goldberg
* Run the following as root:
13
14
~~~ shell
15
cd /usr/local/bin
16
wget https://github.com/drush-ops/drush/archive/7.4.0.tar.gz
17
tar xzvf 7.4.0.tar.gz
18
cd drush-7.4.0
19
# If necessary, run: apt install composer (or yum install composer)
20
composer install 
21
cd ..
22
ln -s drush-7.4.0/drush drush
23
# test That it's accessible from anywhere
24
cd ~
25
drush --version
26
~~~
27
28
## Installing drush 8 on a production site
29
30 2 Jon Goldberg
* Download the .phar file for the most recent stable release of drush 8 from [this page](https://github.com/drush-ops/drush/releases).
31 1 Jon Goldberg
* If you have root access, install drush for all users:
32
33
~~~ shell
34
chmod +x drush.phar
35
sudo mv drush.phar /usr/local/bin/drush
36
~~~
37
38
* If root access is unavailable, make it available to the logged-in user's path.
39 3 Jon Goldberg
40 1 Jon Goldberg
~~~ shell
41
chmod +x drush.phar
42
mkdir $HOME/bin
43
mv drush.phar $HOME/bin
44
cd $HOME/bin
45
# If shell is bash, distro is NOT Ubuntu.
46
echo PATH=`pwd`:'$PATH' >> "$HOME/.bash_profile"
47
# If shell is bash, distro IS Ubuntu.
48
echo PATH=`pwd`:'$PATH' >> "$HOME/.profile"
49
# If shell is zsh
50
echo PATH=`pwd`:'$PATH' >> "$HOME/.zshrc"
51
~~~