4

Finding hundreds of articles and documents about how to install drush and none of it explains where exactly and how properly I got a bit lost.

I've got a Debian 8 system with a root user, NGinx and a ssh user.
Now I'd like to go with drush 8 to be ready for Drupal 8 soon.
But I don't feel like installing git on my server - is this common practice? I usually think the fewer software the better?

So - any chance of installing drush without having git?

Next thing that all instructions seem to forget: As which user do I need to install drush and composer? (I did it now as the ssh user with the result that root can't use drush).

And eventually: Which directory would be correct to have drush installed? /usr/bin/ ? With a symlink? Or directly there? Does the NGinx user (www-data) need to be able to use drush? (I guess yes for drush pm-update?)

Very lost here - hope someone can shed some light.

2 Answers 2

2

(Updated to fix links and clarify Drush 8 vs 9.)

Debian still (as of February 8th 2018) comes with Drush 5.10 which is completely unacceptable.

There is no reason to use Git to download Drush. Either

5
  • Please comment why you downvote. In this case, I assume it was because the links in my answer was dead - updated now.
    – hansfn
    Feb 8, 2018 at 10:16
  • Voting is anonymous by design, people don't tend to leave comments when they up or down vote as historically people get harassed and abused when they do
    – Clive
    Feb 8, 2018 at 10:25
  • Too bad (about the harassment/abuse). It would be very useful to know - so you can improve the answer.
    – hansfn
    Feb 8, 2018 at 12:30
  • Yeah it's a shame, human nature or something I guess. In an ideal world everyone would be honest, just vote on the content, and not take downvotes personally. Then we could force/encourage people to explain what they objected to. Reality is somewhat different though. FWIW I can't think of a single thing wrong with either version of the answer, except the broken links. If you get the odd random downvote on an answer don't give it too much thought, if you start getting a few on the same one that's the time to think about it
    – Clive
    Feb 8, 2018 at 12:48
  • It's actually pretty nice to use Git to download Drush. You can very easily check out different release tags, composer install, done :)
    – leymannx
    Jun 4, 2018 at 13:35
1

[update] If you are happy with an older version (Drush 5.10) then you could install from Debian repos.

sudo apt-get update && sudo apt-get install drush 

Note that git is a suggested package but it shouldn't auto install by default. Reference: https://packages.debian.org/jessie/drush

If Drush 5 is too old then you can always re-evaluate your options then...

What version control do you use for your server/CMS/etc? If you don't use version control then I would strongly argue that you should just learn how to use git. IMO it is the most awesome vc system that I have ever used... I would say that using git (let alone installing it) is pretty common dev practice!

Regardless there are possibly ways to install drush without installing git but you could just install git then remove it again after if you don't want it!? AFAIK drush now requires composer to complete the installation and I'm pretty sure that needs git too. So perhaps just bite the bullet...

So my suspicion is that even if it's possible then it will be a lot more painful and a lot more mucking around...

For the record this is how I install drush (latest dev version) then use it to install drupal8:

SRC=/usr/local/src
WEBROOT=/var/www/drupal
# install composer
curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer

# install drush dev-master
git clone --depth 1 https://github.com/drush-ops/drush.git $SRC/drush
cd $SRC/drush
composer install
ln -s $SRC/drush/drush /usr/local/bin/drush
ln -s $SRC/drush/drush.complete.sh /etc/bash_completion.d/drush

mkdir -p /etc/drush
cat > /etc/drush/drushrc.php << EOF
<?php
// by default use the drupal root directory
\$options['r'] = '$WEBROOT';
EOF

# download latest drupal8 and install
drush dl drupal-8 --destination=$(dirname $WEBROOT)
mv $(dirname $WEBROOT)/drupal-8* $WEBROOT
2
  • Hmm .. that would work I guess. How ever, since I'm using Debian I kind of got used to the stable but a bit old packages. Throwing git onto a server and getting things from the latest dev .. is this a safe practice?
    – Chris
    Jun 30, 2015 at 8:35
  • TBH I hadn't even considered that. I will update my answer. Debian stable is awesome (I'm still using Wheezy on my main laptop and have been using Jessie server a fair bit lately). But Debian do not (yet?) have a composer package. They do however have a 'drush" package! Getting source from GitHub does not always mean "bleeding edge". E.g. Drush use their master branch for development release but bleeding edge development is not merged unless it passes tests first. Obviously there is still a chance that it might be buggy; but I've seen plenty of buggy packages in Debian stable too! Jul 1, 2015 at 6:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.