I’ve been playing around with Vagrant recently. It really is a great tool for setting up development environments quickly and cleanly – no more local MySQL databases with 100 separate databases!
There are a few ways to solve this problem that many WordPress developers have:
- Use WordPress Multisite mode.
- Regularly clean your databases up and delete old ones.
- Use a common WordPress install, switching themes.
- Use Vagrant.
I’m going to be talking about the last option, Vagrant, in this blog post. I’ll list out a few reasons why Vagrant was attractive to me in the first place:
- Isolation – this was appealing not only to reduce my database clutter, but also to be sure that the development and production environments were as similar as possible (within reason – of course).
- Portability – another killer feature of Vagrant. Check out the repository,
vagrant up, and you’re ready to go.
- Coolness – don’t you love the idea of having contained, automatically managed environments for your projects? No? Well, I do.
Here’s what I came up with: vagrant-wp-theme-template.
I’ve made the template compatible with
_s, so just follow the instructions for
_s regarding naming your theme, then the directions for getting your development environment set up. If you want to use an existing theme, just drop it inside the
theme folder (and don’t forget to update the name in the
I’m always open to new ideas and pull requests – please don’t hesitate to contribute!
Finally, this wouldn’t have been possible without the help of @miya0001‘s vagrant-chef-centos-wordpress, which this template is built off of. Thanks!