Varying Vagrant Vagrants is an evolving Vagrant configuration focused on WordPress development.
VVV is a 10up creation and transitioned to a community organization in 2014.
- Version: 1.2-working
- Latest Stable: v1.1
- Contributors: @jeremyfelt, @carldanley, @ericmann, @lkwdwrd, @TheLastCicada, @tddewey, @johnpbloch, @kadamwhite, @scribu, @danielbachhuber, @tollmanz, @mbijon, @markjaquith, @curtismchale, @Mamaduka, @lgedeon, @pmgarman, @westonruter, @petemall, @cmmarslender, @mintindeed, @mboynes, @aaronjorbin, @tobiasbg, @simonwheatley, @ocean90, @lvnilesh, @alexw23, @zamoose, @leewillis77, @imichaeli, @andrezrv, @cadwell, @cfoellmann, @westi, @ryanduff, @selinerdominik, @ericandrewlewis, @vDevices, @sunnyratilal, @enejb, @salcode, @mattbanks, @aaroncampbell, @tnorthcutt, @neilpie, @francescolaffi, @itsananderson, @foolswis
- Contributing: Contributions are more than welcome. Please see our current contributing guidelines. Thanks!
The primary goal of Varying Vagrant Vagrants (VVV) is to provide an approachable development environment that matches a typical production environment.
The default server configuration provisioned by VVV matches a common configuration for working with high traffic WordPress sites.
The default WordPress configurations provided by VVV create an environment ideal for developing themes and plugins as well as for contributing to WordPress core.
VVV requires recent versions of both Vagrant and VirtualBox to be installed.
Vagrant is a "tool for building and distributing development environments". It works with virtualization software such as VirtualBox to provide a virtual machine sandboxed from your local environment.
Once Vagrant and VirtualBox are installed, download or clone VVV and type vagrant up
to automatically build a virtualized Ubuntu server on your computer containing everything needed to develop a WordPress theme or plugin. See our section on The First Vagrant Up for detailed instructions.
Multiple projects can be developed at once in the same environment.
- Use
wp-content/themes
in either thewww/wordpress-default
orwww/wordpress-trunk
directories to develop themes. - Use
wp-content/plugins
in either thewww/wordpress-default
orwww/wordpress-trunk
directories to develop plugins. - Take advantage of VVV's auto site configuration to provision additional instances of WordPress in
www/
. - Use the
www/wordpress-develop
directory to participate in WordPress core development.
VVV's config
, database
, log
and www
directories are shared with the virtualized server.
These shared directories allow you to work, for example, in vagrant-local/www/wordpress-default
in your local file system and have those changes immediately reflected in the virtualized server's file system and https://local.wordpress.dev/. Likewise, if you vagrant ssh
and make modifications to the files in /svr/www/
, you'll immediately see those changes in your local file system.
Entirely different server configurations can be created by modifying the files included with VVV and through the use of additional Auto Site Setup provisioning scripts. Check this project out and use it as a base to learn about server provisioning or change everything to make it your own.
- Start with any local operating system such as Mac OS X, Linux, or Windows.
- Install VirtualBox 4.3.x
- Install Vagrant 1.6.x
vagrant
will now be available as a command in your terminal, try it out.- Note: If Vagrant is already installed, use
vagrant -v
to check the version. You may want to consider upgrading if a much older version is in use.
- Install the vagrant-hostsupdater plugin with
vagrant plugin install vagrant-hostsupdater
- Note: This step is not a requirement, though it does make the process of starting up a virtual machine nicer by automating the entries needed in your local machine's
hosts
file to access the provisioned VVV domains in your browser. - If you choose not to install this plugin, a manual entry should be added to your local
hosts
file that looks like this:192.168.50.4 vvv.dev local.wordpress.dev local.wordpress-trunk.dev src.wordpress-develop.dev build.wordpress-develop.dev
- Note: This step is not a requirement, though it does make the process of starting up a virtual machine nicer by automating the entries needed in your local machine's
- Install the vagrant-triggers plugin with
vagrant plugin install vagrant-triggers
- Note: This step is not a requirement. It does allow for various scripts to fire when issuing commands such as
vagrant halt
andvagrant destroy
. - By default, if vagrant-triggers is installed, a
db_backup
script will run on halt, suspend, and destroy that backs up each database to adbname.sql
file in the{vvv}/database/backups/
directory. These will then be imported automatically if starting from scratch. Custom scripts can be added to override this default behavior.
- Note: This step is not a requirement. It does allow for various scripts to fire when issuing commands such as
- Clone or extract the Varying Vagrant Vagrants project into a local directory
git clone git:https://github.com/Varying-Vagrant-Vagrants/VVV.git vagrant-local
- OR download and extract the repository master zip file to a
vagrant-local
directory on your computer. - OR download and extract a stable release zip file if you'd like some extra comfort.
- In a command prompt, change into the new directory with
cd vagrant-local
- Start the Vagrant environment with
vagrant up
- Be patient as the magic happens. This could take a while on the first run as your local machine downloads the required files.
- Watch as the script ends, as an administrator or
su
password may be required to properly modify the hosts file on your local machine.
- Visit any of the following default sites in your browser:
- https://local.wordpress.dev/ for WordPress stable
- https://local.wordpress-trunk.dev/ for WordPress trunk
- https://src.wordpress-develop.dev/ for trunk WordPress development files
- https://build.wordpress-develop.dev/ for the version of those development files built with Grunt
- https://vvv.dev/ for a default dashboard containing several useful tools
Fancy, yeah?