Project

General

Profile

Install drush » History » Version 1

Jon Goldberg, 11/21/2017 08:24 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
When installing drush on a live site, installing a .phar file is preferred.  For now, let's default to using drush 7 until this issue is fixed, then let's standardize on drush 8.
8
9
## Installing drush 7 on a production site
10
11
* Determine the version number for the most recent stable release of drush 7 from this page.  In this example, 7.4.0 is the latest version.
12
* 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
* Download the .phar file for the most recent stable release of drush 8 from this page.
31
* 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
~~~ shell
40
chmod +x drush.phar
41
mkdir $HOME/bin
42
mv drush.phar $HOME/bin
43
cd $HOME/bin
44
# If shell is bash, distro is NOT Ubuntu.
45
echo PATH=`pwd`:'$PATH' >> "$HOME/.bash_profile"
46
# If shell is bash, distro IS Ubuntu.
47
echo PATH=`pwd`:'$PATH' >> "$HOME/.profile"
48
# If shell is zsh
49
echo PATH=`pwd`:'$PATH' >> "$HOME/.zshrc"
50
~~~