Drupal VM makes building Drupal development environments quick and easy, and introduces developers to the wonderful world of Drupal development on virtual machines or Docker containers (instead of crufty old MAMP/WAMP-based development).
It will install the following on an Ubuntu 16.04 (by default) linux VM:
- Drupal 8, with this modules:
- Drush
- Apache 2.4.x (or Nginx)
- PHP 7.1.x (configurable)
- MySQL 5.7.x (or MariaDB, or PostgreSQL)
- Drupal 7 or 8
- Optional:
- Drupal Console
- Drush
- Varnish 4.x (configurable)
- Apache Solr 4.10.x (configurable)
- Elasticsearch
- Node.js 0.12 (configurable)
- Selenium, for testing your sites via Behat
- Ruby
- Memcached
- Redis
- SQLite
- Blackfire, XHProf, or Tideways 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.
- Install Vagrant and VirtualBox.
- Download or clone this project to your workstation.
cd
into this project directory and runvagrant up
.- Extract and Import the database that is inside
db/d8_db.sql.gz
. I suggest to use the 'Adminer' tool, and import the file under: d8_db data base (MySql) - To compile the CSS: install the less-watch-compiler :: https://github.com/jonycheung/deadsimple-less-watch-compiler
- go to: .project/themes/boots_theme and run:
less-watch-compiler less css style.less
Download and install Vagrant and VirtualBox.
You can also use an alternative provider like Parallels or VMware. (Parallels Desktop 11+ requires the "Pro" or "Business" edition and the Parallels Provider, and VMware requires the paid Vagrant VMware integration plugin).
Notes:
- For faster provisioning (macOS/Linux only): Install Ansible on your host machine, so Drupal VM can run the provisioning steps locally instead of inside the VM.
- For stability: Because every version of VirtualBox introduces changes to networking, for the best stability, you should install Vagrant's
vbguest
plugin:vagrant plugin install vagrant-vbguest
. - 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 late 2016, Drupal VM recommends: Vagrant 1.8.4, VirtualBox 5.1.10+, and Ansible 2.2.x
Open your browser and access http://drupalvm.dev/. The default login for the admin account is admin
for both the username and password.
Note: By default Drupal VM is configured to use 192.168.88.99
as its IP, if you're running multiple VM's the auto_network
plugin (vagrant plugin install vagrant-auto_network
) can help with IP address management if you set vagrant_ip
to 0.0.0.0
inside config.yml
.
By default, this VM includes the extras listed in the config.yml
option installed_extras
:
installed_extras:
- adminer
# - blackfire
# - drupalconsole
- drush
# - elasticsearch
# - java
- mailhog
# - memcached
# - newrelic
# - nodejs
- pimpmylog
# - redis
# - ruby
# - selenium
# - solr
# - tideways
# - upload-progress
- 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.
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 halt
in the Terminal in the same folder that has theVagrantfile
. To destroy it completely (if you want to save a little disk space, or want to rebuild it from scratch withvagrant up
again), type invagrant destroy
. - To log into the virtual machine, enter
vagrant ssh
. You can also get the machine's SSH connection details withvagrant ssh-config
. - When you rebuild the VM (e.g.
vagrant destroy
and then anothervagrant up
), make sure you clear out the contents of thedrupal
folder 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
config.yml
. - 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.
Thanks so much to Jeff Geerling the creator of the VM, I just add a Drupal 8 setup, with cool modules to start a project development.
More info from the DrupalVM: http://docs.drupalvm.com/