One of the initial hurdles to getting started with Drupal is a local development environment. This recipe will cover how to set up the DrupalVM project by Jeff Geerling. DrupalVM is a VirtualBox virtual machine run through Vagrant, provisioned and configured with Ansible. It will set up all of your services and build a Drupal installation for you.
Luckily you only need to have VirtualBox and Vagrant installed on your machine and DrupalVM works on Windows, Mac OS X, and Linux.
To get started, you will need to install the two dependencies required for DrupalVM:
Let's set up the DrupalVM project by Jeff Geerling. DrupalVM is a VirtualBox virtual machine run through Vagrant, provisioned and configured with Ansible:
example.drupal.make.yml
to drupal.make.yml
.example.config.yml
to config.yml
config.yml
and modify the local_path
setting to be the directory where you've placed the DrupalVM project. This will be synchronized into the virtual machine:vagrant_synced_folders: - local_path: /path/to/drupalvm destination: /var/www type: nfs create: true
vagrant up
to tell Vagrant to build the virtual machine and begin the provisioning process.192.168.88.88 drupalvm.dev
to your hosts file.admin
and password admin
.DrupalVM is a development project that utilizes the Vagrant tool to create a VirtualBox virtual machine. Vagrant is configured through the project's Vagrantfile
. Vagrant then uses Ansible – an open source IT automation platform – to install Apache, PHP, MySQL, and other services on the virtual machine.
The config.yml
file has been set up to provide a simple way to customize variables for the virtual machine and provisioning process. It also uses Drush to create and install a Drupal 8 site, or whatever components are specified in drupal.make.yml
. This file is a Drush make
file, which contains a definition for Drupal core by default and can be modified to include other contributed projects.
The vagrant up
command tells Vagrant to either launch an existing virtual machine or create one anew in a headless manner. When Vagrant creates a new virtual machine it triggers the provisioning process. In this instance Ansible will read the provisioning/playbook.yml
file and follow each step to create the final virtual machine. The only files needing to be modified, however, are the config.yml
and drupal.make.yml
files.
The topic of automating and streamlining a local environment is quite popular right now with quite a few different options. If you are not comfortable with using Vagrant, there are a few other options that provide a server installation and Drupal.
Acquia Dev Desktop is developed by Acquia and can be found at https://docs.acquia.com/dev-desktop2. It is an automated environment installer for Windows and Mac. The Dev Desktop application allows you to create a regular Drupal installation or select from a distribution.
XAMPP – Apache + MySQL + PHP + Perl – is a cross platform environment installation. XAMPP is an open source project from Apache Friends. XAMPP has partnered with Bitnami to provide free all-in-one installations for common applications – including Drupal 8! You can download XAMPP at https://www.apachefriends.org/download.html.
Kalabox is developed by the Kalamuna group and intends to be a robust workflow solution for Drupal development. Kalabox is cross-platform compatible, allowing you to easily work on Windows machines. It is based for the command line and provides application binaries for you to install. You can learn more about Kalabox at http://www.kalamuna.com/products/kalabox/.