The vv script is no longer maintained, and this page is currently preserved for historical purposes. From the vv GitHub repo:
This project is no longer maintained. Please update your copy of VVV , which has most of the vv features built in.
from bradp/vv: Variable VVV – a VVV Site Creation Wizard.
So many V’s! vv is short for Variable VVV, a VVV site setup wizard command line tool, automating the process of creating a WordPress installation in VVV. If you’re not comfortable working with the command line, this tool probably isn’t for you. But if you want to Use Varying Vagrant Vagrants (VVV) as a WordPress Development Environment, using vv to set up your virtual WordPress websites is incredibly handy and makes it much easier to automate common VVV website creation and maintenance tasks.
The following instructions assume you know how to execute commands on the command line, using your computer’s Terminal or Command application. You also need to install VVV — see Using VVV for details.
To get started, install vv. I prefer the git installation for my Mac development computer, but you can also use Homebrew. Follow the installation instructions for your OS.
Using vv
Once vv is installed, you can list the sites that are currently configured in VVV:
vv list
Create a new VVV WordPress site with vv
To create your new VVV WordPress site, use vv create, like this:
vv create -d example.com -n example
Replace “example.com” with your production server domain for the -d(omain) parameter, and replace “example” with your domain root for the -n(ame) parameter. Or use the more readable version:
vv create --domain example.com --name example
When you run this command, you’ll need to answer a number of questions. If this is your first site you’re setting up with vv, the default options should work just fine.
After vv provisions your new site, you need to complete one more step: Update the vvv-custom.yml configuration file to add the host entry for your new WordPress installation.
First, make a clean exit from VVV:
vagrant halt
Then, open the vvv-custom.yml file in your favorite text editor. On my Mac, this file is located in ~/vagrant-local/vvv-custom.yml.
Scroll down and locate sites: (or use Find) and then add your new site as follows:
sites: example: hosts: - example.com - www.example.com # Tip: add a blank line after your list of hosts
Important: don’t use tabs to indent the entries! You must use spaces only or VVV will cough up an error message when you try to reload it (this is a requirement of the YAML file format).
Save vvv-custom.yml and re-provision vvv:
vagrant reload --provision
Now, open your favorite browser, open an incognito or private window, and enter the domain you just created. Your new website should appear, with a generic WordPress installation. To log in to the WordPress dashboard, browse to:
example.com/wp-admin
and enter the admin account that vv created:
- username: admin
- password: password
Obviously, you’ll want to change this before your site goes live!
Now you have a virtual WordPress server that’s available any time you run VVV on your, and goes away whenever you halt VVV (but is still stored on your local drive).
Delete VVV WordPress sites with vv
VV can also delete sites. Deleting a website with VV is simple:
vv delete site_name
Don’t know the site name? Use:
vv list
If you delete a site using VV, remember that you’ll still need to edit the vvv-custom.yml configuration file manually to remove the host entry for the WordPress installation you just deleted. If you deleted a site so that you can install a new, clean version, just leave the entry in vvv-custom.yml and recreate the site with the vv create command.
Advanced vv features
One of the biggest advantages of using vv is automating common website deployment tasks with VVV. These advanced automation features let you:
- Set up Vagrant deployments, which work with Vagrant Push to copy your code to a deployment server using an FTP connection.
- Use vv in Airplane mode if you don’t have an active Internet connection.
- Use flags to pass arguments to customize your site installation and bypass the interactive prompts when you create a site with vv.
- Use Blueprints to store website setup configurations so you can “set up different plugins, themes, mu-plugins, options, widgets, menus, or constants that will be installed to a new site you create”
Check the list of vv Options and Commands to see a comprehensive listing of everything you can do with vv to automate site maintenance with VVV.