Setting up your machine for WordPress development

In order to get started with any WordPress development on your computer you will need to have a local development environment setup. Here’s a handy guide in getting this done quickly and easily.

There are a number of different ways to get things working: MAMPWAMPXAMPP, etc., but the solution we recommend is VirtualBox and Vagrant as it is the easiest to use and keep updated. This combination allows you to create virtual environment that is similar to a real web server, and have it automatically set up everything, including WordPress, correctly for you. The full solution we recommend is one called Varying Vagrant Vagrants (VVV), originally developed by 10up and transitioned to a community organisation in 2014.

The following instructions, taken from the VVV GitHub page, apply to Windows, Mac, and Linux environments.

What is Vagrant?

Vagrant is a “tool for building and distributing development environments”. It works with virtualisation software such as VirtualBox to provide a virtual machine that is sandboxed away from your local environment.

The First Vagrant Up

  1. Start with any local operating system such as Mac OS X, Linux, or Windows.
  2. Install VirtualBox 4.3.x
  3. 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.
  4. Install the vagrant-hostsupdater plugin with vagrant plugin install vagrant-hostsupdater
  5. Install the vagrant-triggers plugin with vagrant plugin install vagrant-triggers
  6. Clone or extract the Varying Vagrant Vagrants project into a local directory
    • git clone git://github.com/Varying-Vagrant-Vagrants/VVV.git vagrant-local
    • OR download and extract the repository master zip file
    • OR grab a stable release if you’d like some extra comfort.
  7. In a command prompt, change into the new directory with cd vagrant-local
  8. 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 – on a standard ADSL line in South Africa this could take a a couple of hours as there is a lot to download.
    • Watch the script as it ends because an administrator or su password may be required to properly modify the hosts file on your local machine.
  9. Visit any of the following default sites in your browser:
  10. Profit.

Check out the Varying Vagrant Vagrants project on GitHub for more info.