Install drupal 8, modules and themes from Drush. | Drupal 8

Install drupal 8, modules and themes from Drush.

Submitted by editor on Fri, 01/26/2018 - 09:31

How to install  drupal 8 site (instance), drupal modules and drupal themes from Drush ?

Drush allow to download and install drupal core, drupal modules and drupal themes.
Note : It is recommended to use composer to manage drupal 8, modules and themes.

Download drupal core

- Download the recomended version.
drush dl drupal
- Select the version to download.
drush dl drupal --select

Note : The option --select allow to select the version of the drupal core, drupal module and themes.

Install drupal from drush

drush dl drupal --drupal-project-rename=example
cd example
drush site-install standard --db-url='mysql://[db_user]:[db_pass]@localhost/[db_name]'
--site-name=Example --account-name=admin --account-pass=adminpassword --notify=1
Example : Install a new drupal site.
drush site-install standard --db-url='mysql://drupal:drupal@database/drupal' --site-name=D8 --account-name=admin --account-pass=admin --notify=0

Example : Re-Install a new drupal site in an existence database/settings.
drush site-install standard --site-name=D8 --account-name=admin --account-pass=admin --notify=0

Example : Install drupal 8 using sqlite database
drush site-install standard --db-url='sqlite://sites/default/files/.ht.db.sqlite' --site-name=D8 --account-name=admin --account-pass=admin --notify=0

Enable few useful contrib modules.

drush en honeypot securelogin pathauto -y
drush en workbench workbench_moderation captcha -y
drush en youtube imce linkit -y
drush en admin_toolbar admin_toolbar_tools -y
drush en coffee -y
drush en workbench workbench_moderation youtube imce linkit captcha honeypot securelogin pathauto -y

Enable drupal development modules.

drush en devel kint simpletest -y
drush en honeypot securelogin pathauto youtube imce linkit admin_toolbar admin_toolbar_tools devel kint simpletest -y


Add new comment

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.