So now that we have a general overview of what the hell Vagrant is and why you should be using it, there are a few bits that need to be explained before we can dive in and start creating local projects.
Boxes are at the core of Vagrant. They are a self contained operating system held within a file. They are not actually part of Vagrant, but VirtualBox, however the team behind Vagrant have been so kind as to make a central repository of Boxes that can be downloaded at vagrantbox.es. While you can download the boxes and store them on your computer, you can also just copy the URL and add it to your configuration file, so Vagrant will download and store it when it is creating your project. There are hundreds of boxes on vagrantbox.es, so incase you're not sure which to pick, the "Ubuntu precise 32 VirtualBox" is a good starting point.
At its core, Vagrant is pretty simple, you have a handful of commands to create (up), restart (reload), access (ssh), suspend (suspend), switch off (halt) and delete (destroy). The rest is done from the configuration file and through the Chef or Puppet provisioning.
So if we have a box ready to be made active with a configuration file in place, all we would do is write the following...
This is the first in a series of articles I intend to write on Vagrant and why its f*cking awesome!
Vagrant is probably the most exciting thing to happen to local development environments since I first installed Xampp on my Windows machine and saw I had a working Apache environment all set up and ready to process pages just like the actual internet. No more FTP'ing files to a remote server before I can see if the two lines of code I changed actually worked!
Mimicking the production environment
So, if we have a working Apache setup, why bother spending time learning how to set...