Learn how Vagrant, a tool for creating portable development environments, can help you:
- Easily setup a local development environment
- Match your local development environment to production and avoid surprises during deployment.
- Share development environments with team members and get new team members up and running in record time.
- Easily deploy code by using providers and provisioners.
Presentation given at WordCamp Asheville 2014:
http://2014.asheville.wordcamp.org/session/getting-started-with-vagrant/
NOTE: This slide deck isn't going to be extremely helpful on its own. Please view the associated blog post for more context:
http://wpscholar.com/presentations/getting-started-with-vagrant/
Environment = Usually a local development environment
Replacement for MAMP/WAMP/XAMPP
Virtual machine = A software based emulation of a computer (server)
Guest = virtual machine
Host = physical machine
Provision = Install the required software and configure the machine for use
Basic - Allow guest and host to communicate
Advanced - Multiple VM network
Recap: Vagrant is a manager of virtual machines
Speed - no waiting on files to upload, edit them locally
Reliability - no server outages
Security - search engines can’t index, mistakes are never seen
Isolated - Guest and host are separate machines. Dependencies must be handled during provisioning.
Control - You can mirror production without having to reconfigure your computer.
Predictable - No odd configurations like MAMP/XAMPP
Cross-platform - compatible with Mac, Windows and Linux
Eliminate “Works on my machine” (it is the same machine)
Faster onboarding
Provisioning / Administrative scripts
Inexpensive - Free local server
Low Risk - Won’t mess up a staging or production server, or your computer
Disposable - Problem? Just start over.
Prerequisites - Install VirtualBox and Vagrant
Common Misconception - Vagrant runs VM in a separate window
Vagrantfile = the file used to manage creation of the Virtual Machine
Box = disk image used for the Virtual Machine
Directory of boxes - http://www.vagrantbox.es/, https://vagrantcloud.com/
Commands: status, suspend/halt, ssh, provision, destroy
Next step: provisioning
Provisioner = A tool that automatically installs software and alters configurations.
What you get with Varying Vagrant Vagrants
If you prefer Apache to Nginx:
VagrantPress (http://vagrantpress.org/)
VVV Apache (https://github.com/ericmann/vvv-apache)
Add domain to hosts file - vvv-hosts
Add database / install WP - vvv-init.sh
Add site to nginx - vvv-nginx.conf
A bash script that makes it easy to spin up a new WordPress site using Varying Vagrant Vagrants.