Getting Started with Vagrant for Local Development

What is Vagrant?

What is Vagrant?

Vagrant is a Tool that Builds Development Environments

Vagrant is a tool that lets you “Create and configure lightweight, reproducible, and portable development environments.”

In layman's terms, it takes all the headache out of configuring a dev environment and replaces it with a single configuration file where you can pick and choose which features you want your development setup to have.

Okay, so how is this different?

The single greatest benefit is having a single file be your development environment. You get to pick-and-choose which features you want as part of your setup.

Want PHP 7 and MySQL? Great! Just configure your Vagrant file for that. Want a setup with NodeJS, PHP 5, and Curl? Great! Just configure your Vagrant file for that.

Cross Platform

All developers (Mac, Windows, Linux) will have identical dev environments tied to your configuration file. No situations where someone says, "well, it works on my computer". Everyone's dev environment is identical regardless of computer or operating system.

This makes collaborating so much easier.

Identical Environments

You can take this cross platform concept further. Have you ever deployed code live or to production to not have it work? This is because your server configuration was different.

In a perfect world, you'd want your development environment to mirror your production server. Same PHP versions, same database versions, same everything. In a full Vagrant setup, you could do this!

Quick and Easy to Share

Since the "configuration" is tied to a single file, you can git commit it into a git repo or just manually share it with your team so they can get setup on your project without having to configure a local environment. You did all the work for them! No more wasting dev time trying to setup your coding environment.

You have an old project? Just clone it down and Vagrant is already there from back when you worked on this, so you don't need to remember how it is setup again. It's all saved with the project.

Like this article? Follow @whatnicktweets on Twitter