using vagrant 
for local 
wordpress 
development
about me
_ Domagoj Gojak (@DomagojGojak) 
_ Lead Developer @ Slicejack 
_ Using PHP for 5+ years 
_ Automation and security freak
what’s wrong 
with the 
‘traditional’ 
development 
environment?
what’s wrong 
with mamp/ 
wamp/xampp 
development 
environment?
1. Too many choices
commonly used 
server stacks
_ Zend Server 
_ WampServer 
_ MAMP 
_ XAMPP 
_ AMPPS 
_ EasyPHP 
_ BitNami Application Stacks 
_ Cherokee
2. Enviroment (re)installation
_ Configuration takes too much time. 
_ VHost, max_upload_size, memory_limit… 
_ Dependency installation takes too much time. 
_ WP-CLI, Node.js, Ruby etc… 
_ Computer died? Start again! 
_ New developer? Start again! 
_ Can’t remember what to install? Too bad!
3. “It works on my machine. #wontfix”
4. Leftovers
what is 
vagrant?
_ Wrapper around virtualization and provisioning 
software. 
_ Setting VM-specific settings (IP address, 
hostnames, port forwarding, memory, etc.) 
_ Running provisioning software like Puppet 
or Chef.
Vagrantfile 
box = ‘precise32’ 
url = ‘http://files.vagrantup.com/precise32.box’ 
hostname = ‘my-enviroment’ 
ip = ‘192.168.19.11’ 
ram = ‘256’ 
Vagrant::Config.run do |config| 
config.vm.box = box 
config.vm.box_url = url 
config.vm.host_name = hostname 
config.vm.network :hostonly, ip 
config.vm.share_folder = ‘data’ 
config.vm.customize [ 
‘modifyvm’, :id, 
‘--name’, hostname, 
‘--memory’, ram 
] 
config.vm.provision :puppet do |puppet| 
puppet.manifests_path = ‘puppet/manifests’ 
puppet.manifest_file = ‘site.pp’ 
puppet.module_path = ‘puppet/modules’ 
end 
end
vagrant up
provisioning
“Server provisioning is a set of actions to prepare 
a server with appropriate systems, data and 
software, and make it ready for network operation.”
provisioning by 
puppet scripts
class wp::cli ( 
$ensure = ‘installed’, 
$install_path = ‘/usr/local/src/wp-cli’, 
$version = ‘dev-master’ 
)
vagrant provision
why should you 
virtualize?
1. Development is production
2. You can now store your environment in a git repo
3. No out of sync environments
4. No additional configuration is needed
5. No leftover services
wordpress?
_ VIP Quickstart (by Automattic) 
_ Varying-Vagrant-Vagrants 
_ Salty WordPress 
_ Vagrant Genesis 
_ VagrantPress 
_ Custom box? Why not! https://puphpet.com/
demo
questions?
thank you!
Domagoj Gojak 
Lead Developer @ Slicejack.com 
2nd WordPress Meetup Split

Using Vagrant for Local WordPress Development