Vagrant setup for Drupal on Ubuntu

‹ Most compact way to store UUIDs in sqlite | 13 tips for working remotely from home ›

Vagrant lets you run a single command, vagrant up which will download an operating system image, install it into Virtualbox, boot a virtual machine, and then run shell scripts or Puppet to install software packages or make other changes to the operating system after it boots up the first time.

Here is a minimal Vagrant and Puppet setup to create a virtual machine development environment for a Drupal 6 or Drupal 7 project, which assumes that your project is named myproject and that Drupal exists inside a directory called pub/ in the top level project directory.

Installation

  • git clone https://github.com/wtanaka/drupal-vagrant-puppet.git
  • cd drupal-vagrant-puppet
  • Run one of these:
    • wget -O - http://ftp.drupal.org/files/projects/drupal-6.31.tar.gz | gzip -dc | tar xf -; mv drupal-6.31 pub
    • wget -O - http://ftp.drupal.org/files/projects/drupal-7.27.tar.gz | gzip -dc | tar xf -; mv drupal-7.27 pub
  • Run one of these:
    • DRUPAL=6 vagrant up lucid
    • DRUPAL=6 vagrant up precise
    • DRUPAL=6 vagrant up trusty
    • DRUPAL=7 vagrant up lucid
    • DRUPAL=7 vagrant up precise
    • DRUPAL=7 vagrant up trusty
  • Visit http://localhost:5432/install.php in a web browser
  • If you're installing Drupal 7, the database name and password are myproject and the password is password

Source code

Available at: https://github.com/wtanaka/drupal-vagrant-puppet
Subscribe to All Posts - Wesley Tanaka