Post on 19-Feb-2017
WordPress & Vagrant
What is Vagrant?
– docs.vagrantup.com
“Vagrant provides easy to configure, reproducible, and portable work environments built on top of industry-standard technology and controlled by a single consistent workflow to help maximize the productivity and flexibility of you and your team.
Vagrant makes sandboxeswe play in them
What does that mean?+ self-contained, isolated environments
+ reproducible and disposable
+ matches production environment
+ clean
+ fast
+ dependable
basic terminal commands+ cd+ vagrant up+ vagrant destroy
bonus terminal commands+ ls+ mv+ cp+ vagrant halt+ man
Developing WordPress sites with Vagrant
$
WordPress codebaseWordPress codebase
Vagrant Workflow
vagrant virtual machine
$ vagrant up
WordPress codebaseWordPress codebase
Vagrant Workflow
$
WordPress codebase
vagrant destroy
Vagrant Workflow
WordPress Vagrant Projects+ VVV (Varying Vagrant Vagrants)
+ Trellis (a part of the roots.io project)
+ Salty-WordPress
+ VCCW
+ and plenty more
Common pitfalls+ Full provisioning
+ Long wait on vagrant up
+ Precious
+ Lots of idiosyncratic upfront configuration
+ Most can’t run multiple simultaneous VMs
+ Lousy with managed hosting
Managed WordPress Hosting
+ WordPress hosting is a solved problem
+ Small teams can do more
+ peace of mind
Development Environment Design Goals
+ Fast to set up
+ Always install the latest WordPress release
+ Pre-bake common components into a standard base box
+ Apache and mods
+ PHP
+ PHP error reporting
+ MySQL
+ Setup user accounts
+ Configure server
+ define default sites
+ etc.
basic-wordpress-box basic-wordpresss-vagrant
+ Apache and mods
+ PHP
+ PHP error reporting
+ MySQL
+ Setup user accounts
+ Configure server
+ define default sites
+ etc.
+ Install & configure WordPress
+ Load Database
basic-wordpress-box basic-wordpresss-vagrant
Advantages of basic-wordpresss-vagrant
+ Very, very fast to spin up
+ Virtually no configuration
+ Low technical barrier to entry
+ Multiple simultaneous VMs work great
+ Lightweight, VM saves disk space
How fast?
V V V vagrant up
23 minutes 10 seconds
Trellis (Roots.io) vagrant up
10 minutes 40 seconds
Elapsed time from “cold boot”
How fast?
V V V vagrant up
23 minutes 10 seconds
Trellis (Roots.io) vagrant up
10 minutes 40 seconds
basic-wordpress-vagrant vagrant up
51 seconds
Elapsed time from “cold boot”
DEMO
GitHub /ideasonpurpose/basic-wordpress-vagrant
/joemaller
joe@joemaller.com