A friend recently pointed me at Vagrant. At first I wasn’t sure but after a play, I’m starting to thing this is a great idea.
Vagrant helps you create VMs for use as development environments. So for example, on my Mac I might run a Linux distro in a VM and use it to run the website + db that I’m developing. What’s more I can share that VM config with other developers working on the same project.
Vagrant works with Oracle’s free (and open source) Virtual Box virtualization software. If you’re a Mac user, you might be familiar with running Windows in VMWare Fusion or Parallels. This is the same sort of thing – though if you’re like me you’re more likely to run a Linux distro with Apache/Nginx, MySQL/Postgres etc..
Vagrant use VirtualBox to create and run virtual machines from your chosen distro and then provisions them with your development environment, webserver, app server, db etc using either Puppet or Chef. All this is done in a portable way and can be shared so that each of the developers on your team develop against exactly the same configuration.
Why is this a good idea? Here’s my top reasons..
- consistent environment across the team – WoMM (“works on my machine”) is no longer an issue
- bring in new developers more quickly with less frustration and teething problems
- “hosed” environments can be dumped and new one created quickly and easily. Now you can ‘fork’ your environment not just your code.
- dev environment can more closely match the server – even if you work on a MacBook. You could potentially use the same chef recipes or puppert scripts too.
- It’s pretty easy to get up and running – why not run through the Getting Started with Vagrant guide and see what you think?
Here’s the Vagrant guys explanation of why this is a great idea.