Dealerk Varying Vagrant Vagrants is an open source Vagrant configuration focused on WordPress development. VVV is MIT Licensed.
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.
- 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. When installed, it allows 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. - If vagrant-triggers is not installed, VVV will not provide automated database backups.
- Note: This step is not a requirement. When installed, it allows for various scripts to fire when issuing commands such as
- Clone or extract the Varying Vagrant Vagrants project into a local directory
git clone [email protected]:drivek/dkvagrant.git
- In a command prompt, change into the new directory with
cd dkvagrant
- 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:
- http://autoviemme.dev/ Autoviemme
- http://gruppobossoni.dev/ Gruppo Bossoni
- http://leonori.dev/ Leonori
- http://malvestitigroup.dev/ Malvestiti
- http://vvv.dev/ for a default dashboard containing several useful tools
Fancy, yeah?
The first time you run vagrant up
, a packaged box containing a basic virtual machine is downloaded to your local machine and cached for future use. The file used by Varying Vagrant Vagrants contains an installation of Ubuntu 14.04 and is about 332MB.
After this box is downloaded, it begins to boot as a sandboxed virtual machine using VirtualBox. Once booted, it runs the provisioning script included with VVV. This initiates the download and installation of around 100MB of packages on the new virtual machine.
The time for all of this to happen depends a lot on the speed of your Internet connection. If you are on a fast cable connection, it will likely only take several minutes.
On future runs of vagrant up
, the packaged box will be cached on your local machine and Vagrant will only need to apply the requested provisioning.
- Preferred: If the virtual machine has been powered off with
vagrant halt
,vagrant up
will quickly power on the machine without provisioning. - Rare: If you would like to reapply the provisioning scripts with
vagrant up --provision
orvagrant provision
, some time will be taken to check for updates and packages that have not been installed. - Very Rare: If the virtual machine has been destroyed with
vagrant destroy
, it will need to download the full 100MB of package data on the nextvagrant up
.
Now that you're up and running, start poking around and modifying things.
- Access the server via the command line with
vagrant ssh
from yourdkvagrant
directory. You can do almost anything you would do with a standard Ubuntu installation on a full server.- MS Windows users: An SSH client is generally not distributed with Windows PCs by default. However, a terminal emulator such as PuTTY will provide access immediately.
- Power off the box with
vagrant halt
and turn it back on withvagrant up
. - Suspend the box's state in memory with
vagrant suspend
and bring it right back withvagrant resume
. - Reapply provisioning to a running box with
vagrant provision
. - Destroy the box with
vagrant destroy
. Files added in thewww
directory will persist on the nextvagrant up
.
VVV relies on the stability of both Vagrant and Virtualbox. These caveats are common to Vagrant environments and are worth noting:
- If the directory VVV is inside of is moved once provisioned (
vagrant-local
), it may break.- If
vagrant destroy
is used before moving, this should be fine.
- If
- If Virtualbox is uninstalled, VVV will break.
- If Vagrant is uninstalled, VVV will break.
The default memory allotment for the VVV virtual machine is 1024MB.
All database usernames and passwords for WordPress installations included by default are wp
and wp
.
- User:
root
- Pass:
root
- See: Connecting to MySQL from your local machine
A bunch of stuff!
- Ubuntu 14.04 LTS (Trusty Tahr)
- WordPress Develop
- WordPress Stable
- WordPress Trunk
- WP-CLI
- nginx 1.6.x
- mysql 5.5.x
- php-fpm 5.5.x
- memcached 1.4.13
- PHP memcache extension 3.0.8
- PHP xdebug extension 2.2.5
- PHP imagick extension 3.1.2
- PHPUnit 4.0.x
- ack-grep 2.04
- git 1.9.x
- subversion 1.8.x
- ngrep
- dos2unix
- Composer
- phpMemcachedAdmin
- phpMyAdmin 4.1.14 (multi-language)
- Opcache Status
- Webgrind
- NodeJs Current Stable Version
- grunt-cli Current Stable Version