Using VV to Quickly Scaffold New Local Sites
Why Use a Scaffolding Script
I mentioned in the post on installing VVV that there are tools that are useful for scaffolding new, local sites. To summarize the steps involved in doing this by hand, you would need to:
- Create a folder inside
wwwto hold the files for the new site
- Edit the nginx configuration inside VVV to point to these files
- With VVV running:
- Create the MySQL database
- Install WordPress
- Install any plugins or themes that are to be used
- Import existing or dummy content
Not a lot to do, but using a tool to automate things is helpful and less error prone. Out of the box, VVV has a good system for rolling your own site scaffolding scripts. See the Auto Site Setup section of the VVV wiki.
However, part of the beauty of open source things, is that someone has already experienced this pain point, and has tried to address it. See Examples of VVV auto site setups for more inspiration on how you can make your own setup scripts, or how to use and improve an existing solution.
Using a terminal, I can quickly scaffold out a new local site by executing:
vv create --domain theme-testing.dev --name theme-testing --sample-content
and answering a few additional questions like “Should this be a multisite install?” or “Is there a GIT repo to be used for the
Using the above command as an example, VV will take the script arguments and the answers you provide to:
- Halt VVV if it is running
- Create Nginx entries so the server responds to
- Create a folder for files which is located at
- Create a scaffolding script called
vvv-init.shwhich does things like create the MySQL database, and download the specified version of WordPress. Specifically with the above command,
--sample-contentwill download and import a number of posts and comments that can help identify edge cases of content in your WordPress themes.
- Re-provision VVV by executing
vagrant up --provision. Part of this process involves actually executing the above
Depending on when you last provisioned VVV, this last step might take a while as various pieces of VVV, such as node, or WordPress Core are updated for the default sites.
Once provisioning is done and if you used the above example, you should be able to access your new site at theme-testing.dev, complete with multiple taxonomies and edge-case posts designed to break your theme!
VV is just a simple bash script, so installation is as simple as adding the script to your
For me (on Linux), I have
vv included in my dotfile’s
Installing for a Mac is simple and covered in the installation section of the Repo’s readme.
For Windows users it depends on how your terminal is setup.