Vagrant, Casked

While following the directions on how to set up 10up’s wonderful dev environment for WordPress, I noticed that Vagrant was using a .pkg installer.

Now there’s nothing wrong with installing software that way. Hell, doing things via a graphical installer is easier for most end users. But Vagrant isn’t really something that was made for “end users”. It’s a command line utility to create and manage development environments.

So I did a quick check to see if I could install Vagrant via my favorite package manager, Homebrew. And while there’s nothing in the vanilla install of Homebrew, I stumbled onto an independently maintained add-on called brew-cask that allows you to install Mac applications on your computer via the command line.

Using it is as easy as loading up your terminal and typing:

brew tap phinze/homebrew-cask && brew install brew-cask

Then, to get Vagrant installed, just run this command:

brew cask install vagrant

Hell, you can even install VirtualBox if you’d like:

brew cask install virtualbox

Pretty nice, right?

Oh, and if you’ve been holding out on using Vagrant in your dev environment, consider giving it a try. It’s way more flexible than MAMP and nowhere near as quirky.

Comments

2 responses to “Vagrant, Casked”

  1. J Marston
    J Marston

    Hi Jason – thanks for the post! I came across another read which recommended using gem to install Vagrant. Do you have any thoughts on whether to use gem or brew cask (or just how the two differ)?

    Thanks!

    1. Jason Cosper

      The official Vagrant documentation only suggests using the gem method if you can’t find a package for your install. Since a brew package exists for OS X, I’ll take that as a sign that it’s the better option. ;)

The ability to comment on posts is available only during business hours, for thirty days from the entry’s publication date.

Business hours: Monday – Friday, 9am – 5pm Pacific Time