10

What is the easiest/quickest way to install clean Drupal from scratch on empty folder for testing purposes by using drush (without resorting to shell scripts or aliases).

  • 4
    I feel like a competition could break out here...Drupal up and running in one line anyone? Bonus points for as few && and ; as possible – Clive Oct 23 '14 at 21:06
  • Quickest is rather subjective: If you don't have Drush installed, using it is going not to be the quickest way. In my case, the quickest way would be writing a shell command and give it a short name. – kiamlaluno Oct 24 '14 at 3:35
  • @kernob If you add "without resorting to shell scripts or aliases" I can't see any reason not to open this back up – Clive Oct 24 '14 at 15:40
17
drush qd

Downloads Drupal, runs site install, launches a lightweight webserver, opens a browser and logs you in as 'admin'.

I might have answered drush quick-drupal, but Clive said there might be a contest. :)

  • I think you should also provide a version that installs drush for those who don't have it, not everyone sees drush as a prerequisite like you and me =) - This page could become a very valuable resource. – Darvanen Oct 23 '14 at 23:09
  • 1
    @Darvanen: All questions tagged with drush are required drush to be present. How to install drush, it's another question, so either you can read the instructions at GitHub (using composer it's fairly quick), or check How to install a specific version of Drush? – kenorb Oct 24 '14 at 17:41
  • Oh! I didn't know that (about tags meaning prerequisites). Thanks. – Darvanen Oct 26 '14 at 22:44
4

You may try the following few-line example:

$ drush -y dl && cd drupal-7* # Download Drupal and enter folder.
$ drush -y si --db-url="sqlite://db.sqlite" --account-pass=admin # Install.
$ drush rs # Run HTTP server.

Your site should be accessible under http://127.0.0.1:8888.

Related: Provide a one command to install and run Drupal command.

1

Starting on a new, clean VM is another option with Vagrant. Once you have Vagrant / VirtualBox running, installing Drupal 6 to 7 is a breeze https://www.drupal.org/node/2008792

Update : With the fast development of Drupal 8, VDD mentioned above still works fine with Drupal 7 but does not support Drupal 8 anymore. If you want to quickstart a Drupal 8 website, prefer DrupalVM, it is much more maintained, is easy to configure (via Yaml settings) and covers the latest version of Drush (8) + have support for Apache or Nginx, Varnish, Solr, XDebug, XHProf, ...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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