Greg Anderson, Open Source Contributor Reading estimate: 1 minutes
Easily Install Drush with a Phar
Composer has helped quite a lot in the area of installation and dependency management for Drupal and Drush; however, users who want to get a quick start with Drush are sometimes put off by the Composer-based install. As of the Drush 8.0.0-rc3 release, it is now possible to install Drush using a phar. This requires fewer steps than the previous method.
[Related] Applying Updates to Drupal Core on Patheon with Drush
First, navigate to the Drush project page at https://github.com/drush-ops/drush
Image
Click on the “releases” link shown above, and take a look at the most recent release. It should look something like the diagram below:
Image
Click on the “drush.phar” link to download it. Once the download is complete, rename the file to drush, and move it to a folder that is in your PATH. If you are not sure which folders are in your PATH, you can find out from the shell:
echo $PATH
On most systems, you will see that there is a bin directory in your home directory available for this purpose. This folder might be named something like /Users/yourname/bin (MacOS) or /home/yourname/bin (Linux). If your web browser is set up to download files to the Downloads directory, then you can move and rename your Drush phar as follows:
mv ~/Downloads/drush.phar ~/bin/drush
chmod +x ~/bin/drush
If you are unsure about the location of your Downloads folder, and the above command does not work for you, you can tell your web browser to reveal the Download file in the Finder. You can then rename it to drush using the GUI, and drag it to the bin directory in your home folder.
That’s all there is to it--drush is now installed! To test and see if it worked, type:
drush version
You should see “Drush version: 8.0.0-rc3”, or something similar. You are now ready to use Drush for all sorts of things!
Topics
Discover More
Safely Publish to Web from Google Docs with Pantheon Content Publisher
Roland Benedetti (Senior Director, Product) and Zack Rosen (Co-Founder)
Reading estimate: 7 minutes
Unifying Content and Code: Inside Pantheon’s Vision for Content Operations
Chris Yates
Reading estimate: 5 minutes
Where Did All the Drupal 7 Sites Go? They Moved to WordPress
Josh Koenig
Reading estimate: 6 minutes