Basically, your 'developer setup' page (and you DO have one of these, don't you?) goes from some long list of steps (with different sections for different OS's) to:
- Install VirtualBox
- Install Vagrant
- Clone the project repo
- 'vagrant up' from the command-line
Why VirtualBox?
It's free, supports most common platforms, and Vagrant has built in support for it.https://www.virtualbox.org
To install, just download and run the installer. You probably won't be using VirutalBox directly. Vagrant will be creating and starting the VirtualBox hosts. However, you may want to just launch the application once to make sure it's installed properly.
The second step is to install Vagrant.
Why Vagrant?
Lots of reasons!- Share the machine configs with your team, by checking in a Vagrant file into version control.
- By default, the Vagrant machines share a directory with the main host. This is much more convenient than scp-ing files to and from the virtual machine.
- Share the running machine on the internet - Vagrant can expose the virtual machines on the internet for other people to test and such. This is done via Hashicorp' Atlas service.
- Provisioning - Not only does Vagrant start up the hosts, it can configure them. You can use:
- Shell
- Chef
- Puppet
- Docker (new and cool - but probably not quite ready for production use at this point)
- Providers - You can use VirtualBox, AWS, or any number of supported providers. :)
https://www.vagrantup.com
To install, just download and run the installer.
Vagrant IDEA Plugin
IntelliJ IDEA has a Vagrant plugin. At the moment, this seems to mainly just provide a convenient way to do 'vagrant up', but it could come in handy.
What's in the Vagrantfile?
Basically, this file sits at the root of your project and defines the server OS, and provisioning mechanism for installing the required software. Here are the important parts (IMO):- The VM 'box' definition. This is equivalent to the 'AMI' (Amazon Machine Image) in AWS. The Hashicorp Atlas service provides a whole bunch of 'box' definitions for most common Linux distros.
- Port mappings - This allows you to map ports on the outer host to ports on the guest OS. You can use this to forward web server ports and ports for debugging, so you can attach your favorite IDE to the server process in the guest OS.
- Shared folders. By default, the folder that has the Vagrantfile in it is shared under /vagrant. This is a very convenient way to transfer files to and view files on the guest.
- Provisioning - This is how Vagrant will install and configure the required software on the machine. Start with a simple shell provisioner. Basically, it's just a shell script that Vagrant will run after bringing up the machine.