Summary for Setting Up A Local WordPress Dev Environment Using VVV
This is meant to be a high level walk through for setting up a local development environment for WordPress.
Steps
- Install Git
- Install Virtual Machine Software (Virtualbox 4.3.x)
- Install Vagrant
- Install Vagrant Core 1.6.3
- Install Vagrant Plugins
- Hosts Updater Plugin : https://github.com/cogitatio/vagrant-hostsupdater
- Triggers : https://github.com/emyl/vagrant-triggers
- Note: While the above plugins are technically not required to use Vagrant, or even VVV, they do make some Vagrant tasks easier, and enable enhanced functionality within VVV.
- GIT Clone VVV Repo
- Note: the VVV repo has many of the previous steps outlined on their project page: https://github.com/Varying-Vagrant-Vagrants/VVV#the-first-vagrant-up
- Bring up the virtual machine
- cd VVV
- vagrant up
- Note: The first time this command is issued, the setup will take a significant amount of time. Vagrant will be downloading a server image (currently Ubuntu 14.04), turning that server ‘on’, and downloading the various packages needed to create. Be patient. Go get a coffee. For a good summary of what is going on, see VVV’s summary.
- To ‘shutdown’ the server, simply issue vagrant halt
- Subsequent ‘vagrant up‘ commands should bring the machine up quickly, unless provisioning needs to be done. This provisioning can be initialized by executing vagrant up –provision
- You can access your machine via SSH by executing vagrant ssh
- From inside the virtual machine, the web files can be navigated to: cd /srv/www. Otherwise, those same files can be accessed from the host machine under VVV/www
From here, going to http://local.wordpress.dev should take you to a fresh WordPress installation. The default WP username and password areadmin / password. Obviously these need to be changed if the content from this database is used in a production setting. For a full list of the credentials associated with this server, see the VVV documentation.
Scaffolding New Projects
At this point we have a perfectly good place to install plugins, install themes, and do general dev work with http://local.wordpress.dev.
VVV is setup in a way that allows for easily creating new dev sites. There are a number of tools created by the community to help, but my favorite is Alison Barrett’s Site Wizard. This allows you to issue a command in your VVV directory: vvv -a create and be prompted for various things needed to setup a new, local, dev site.