This is a fork of the wonderful DrupalVM setup created to test the even more wonderful decoupled_blocks development. Eventually better someone smarter (or more sober) will push actual install instructions.
git clone email@example.com:mark-casias/decoupled-blocks-drupal-vm.git decoupled.dev
sudo ansible-galaxy install -r provisioning/requirements.yml --force
cp example.config.yml config.yml
cp example.drupal.make.yml drupal.make.yml
- Go get coffee. Read a book.
drush @decoupled.dev uli
- Get to work.
- If you change your path from ~/Sites, you'll have to update the config.yml.
- One day I'll add a hook to enable the modules. Till then, do it yourself.
Drupal VM official instructions
Drupal VM is A VM for local Drupal development, built with Vagrant + Ansible.
This project aims to make spinning up a simple local Drupal test/development environment incredibly quick and easy, and to introduce new developers to the wonderful world of Drupal development on local virtual machines (instead of crufty old MAMP/WAMP-based development).
It will install the following on an Ubuntu 14.04 (by default) linux VM:
- Apache 2.4.x (or Nginx 1.x)
- PHP 5.6.x (configurable)
- MySQL 5.5.x
- Drush (configurable)
- Drupal 6.x, 7.x, or 8.x.x (configurable)
- Drupal Console
- Varnish 4.x (configurable)
- Apache Solr 4.10.x (configurable)
- Node.js 0.12 (configurable)
- Selenium, for testing your sites via Behat
- XHProf, for profiling your code
- XDebug, for debugging your code
- Adminer, for accessing databases directly
- Pimp my Log, for easy viewing of log files
- MailHog, for catching and debugging email
It should take 5-10 minutes to build or rebuild the VM from scratch on a decent broadband connection.
Please read through the rest of this README and the Drupal VM documentation for help getting Drupal VM configured and integrated with your development workflow.
Full Drupal VM documentation is available at http://docs.drupalvm.com/
Customizing the VM
There are a couple places where you can customize the VM for your needs:
config.yml: Contains variables like the VM domain name and IP address, PHP and MySQL configuration, etc.
drupal.make.yml: Contains configuration for the Drupal core version, modules, and patches that will be downloaded on Drupal's initial installation (more about Drush make files).
If you want to switch from Drupal 8 (default) to Drupal 7 or 6 on the initial install, do the following:
- Update the Drupal
Quick Start Guide
This Quick Start Guide will help you quickly build a Drupal 8 site on the Drupal VM using the included example Drush make file. You can also use the Drupal VM with a Local Drupal codebase or even a Drupal multisite installation.
1 - Install Vagrant
Download and install Vagrant.
- For faster provisioning (Mac/Linux only): Install Ansible on your host machine, so Drupal VM can run the provisioning steps locally instead of inside the VM.
- NFS on Linux: If NFS is not already installed on your host, you will need to install it to use the default NFS synced folder configuration. See guides for Debian/Ubuntu, Arch, and RHEL/CentOS.
- Versions: Make sure you're running the latest releases of Vagrant, VirtualBox, and Ansible—as of February 2016, Drupal VM recommends: Vagrant 1.8.1, VirtualBox 5.0.14, and Ansible 2.0.0.
2 - Build the Virtual Machine
- Download this project and put it wherever you want.
- Make copies of both of the
example.*files, and modify to your liking: - Copy
drupal.make.yml. - Copy
- Create a local directory where Drupal will be installed and configure the path to that directory in
- Open Terminal,
cdto this directory (containing the
Vagrantfileand this README file).
- (If you have Ansible installed on Mac/Linux) Run
$ sudo ansible-galaxy install -r provisioning/requirements.yml --force.
- Type in
vagrant up, and let Vagrant do its magic.
Note: If there are any errors during the course of running
vagrant up, and it drops you back to your command prompt, just run
vagrant provision to continue building the VM from where you left off. If there are still errors after doing this a few times, post an issue to this project's issue queue on GitHub with the error.
3 - Configure your host machine to access the VM.
- Edit your hosts file, adding the line
192.168.88.88 drupalvm.devso you can connect to the VM. - You can have Vagrant automatically configure your hosts file if you install the
vagrant plugin install vagrant-hostsupdater). All hosts defined in
nginx_hostswill be automatically managed. The
vagrant-hostmanagerplugin is also supported. - You can also have Vagrant automatically assign an available IP address to your VM if you install the
vagrant plugin install vagrant-auto_network), and set
- Open your browser and access http://drupalvm.dev/. The default login for the admin account is
adminfor both the username and password.
By default, this VM includes the extras listed in the
installed_extras: - adminer - drupalconsole - mailhog - memcached # - nodejs - pimpmylog # - redis # - ruby # - selenium # - solr - varnish - xdebug - xhprof
If you don't want or need one or more of these extras, just delete them or comment them from the list. This is helpful if you want to reduce PHP memory usage or otherwise conserve system resources.
Using Drupal VM
Drupal VM is built to integrate with every developer's workflow. Many guides for using Drupal VM for common development tasks are available on the Drupal VM documentation site.
Drupal VM runs on almost any modern computer that can run VirtualBox and Vagrant, however for the best out-of-the-box experience, it's recommended you have a computer with at least:
- Intel Core processor with VT-x enabled
- At least 4 GB RAM (higher is better)
- An SSD (for greater speed with synced folders)
- To shut down the virtual machine, enter
vagrant haltin the Terminal in the same folder that has the
Vagrantfile. To destroy it completely (if you want to save a little disk space, or want to rebuild it from scratch with
vagrant upagain), type in
- When you rebuild the VM (e.g.
vagrant destroyand then another
vagrant up), make sure you clear out the contents of the
drupalfolder on your host machine, or Drupal will return some errors when the VM is rebuilt (it won't reinstall Drupal cleanly).
- You can change the installed version of Drupal or drush, or any other configuration options, by editing the variables within
- Find out more about local development with Vagrant + VirtualBox + Ansible in this presentation: Local Development Environments - Vagrant, VirtualBox and Ansible.
- Learn about how Ansible can accelerate your ability to innovate and manage your infrastructure by reading Ansible for DevOps.
This project is licensed under the MIT open source license.
About the Author
Jeff Geerling, owner of Midwestern Mac, LLC, created this project in 2014 so he could accelerate his Drupal core and contrib development workflow. This project, and others like it, are also featured as examples in Jeff's book, Ansible for DevOps.