Drupal - Downloading core via command-line

drush dl drupal-8

Since there are no stable releases of Drupal 8, you must use the --all option to see the tagged alpha releases:

drush dl drupal-8 --select --all

This also works.

drush dl drupal --default-major=8 --select --all

Both of these are now working in the current version of Drush, without the --all flag:

  • drush dl drupal-8 --select

  • drush dl --default-major=8 --select

Note that the Drush pm-* commands only work with one major version of Drupal at a time, and that version currently defaults to Drupal 7. Therefore, drush dl drupal only shows the various Drupal 7 releases available, and does not include any versions of Drupal 8. This much has not changed.

drush dl drupal-8 now works fine with the Drupal 8.0.0-rc1 release.


Since drush dl has been deprecated in recent Drush 9, so you need to use Composer in order to download Drupal 8 sources from the command line. E.g.

composer require drupal/drupal

Prefix with sudo to override the permissons (not recommended).

If you're in /var/www/html directory and you want to place your Drupal 8 sources there, you can run the following commands:

cd /var/www/html
sudo composer create-project drupal-composer/drupal-project:8.x-dev --no-interaction .
sudo ln -vs web/.* web/* .

Read about differences between drupal/drupal and drupal-composer/drupal-project here.


Alternatively download Drupal sources and extract them manually via:

curl -s https://ftp.drupal.org/files/projects/drupal-8.2.7.tar.gz | tar --strip-components=1 -zxvf -

Notes: Change the version to the latest one. Prefix tar with sudo if required.

Tags:

Drush

8