View on GitHub


A simple but powerful Vagrant setup for WordPress development

Download this project as a .zip file Download this project as a tar.gz file

Vagrant Box with Ubuntu 14.04, Nginx, MySQL and PHP-FPM

A Vagrant setup to create an Ubuntu 14.04 (Trusty) virtual machine with Nginx, MySQL and PHP for WordPress development.

Intended to be as simple as possible:



This Vagrant box and provisioning is based on this box from Paul Herron and the accompanying blog post.

What's included in the VM?


These instructions are OS X specific, but the overall solution should work on any platform that Vagrant and VirtualBox support.

Before you start

Fresh WP install

Use these instructions if you want to create a new WP site with the default empty database.

  1. Create directory for the site:
    • mkdir testsite
  2. cd to this created directory
  3. Clone the wp-vagrant folder here
    • git clone
  4. Copy the VagrantFile into the site root directory
    • cp wp-vagrant/Vagrantfile .
  5. Fire up Vagrant to create the VM and then run the provisioning scripts
    • vagrant up
    • This may take a little while as the provisioning scripts download and install everything
  6. Browse to your hostname - you should see the default twentyfourteen theme

Existing WP install

Use these intructions if you have an existing WP install

  1. Go to the folder
  2. Clone the wp-vagrant repo
    • git clone
    • This creates a subfolder called wp-vagrant
  3. Copy the VagrantFile into the site root directory
    • cp wp-vagrant/Vagrantfile .
  4. If you want to import a database during the provisioning, then put a SQL dump file into the wp-vagrant folder. This file must have a .sql extension
  5. Using your editor of choice, edit wp-vagrant/
    • install_wordpress=false
      • the default for this is true, so change to false
    • wp_db_name=<db_name>
      • should be the same database name as in wp-config.php
    • wp_db_user and wp_db_password
      • If the wp-config file uses something different than root and the mysql_root_password then change these
      • Otherwise leave blank
    • Leave the WP admin section variables empty
    • import_database=true
      • set to true if you want to import a database ( and have a SQL dump file in the wp-vagrant folder)
    • import_site_domain=''
      • Put the domain that you were using, this should be the same domain as the database dump.
      • We will search for this domain in the database and change it to $hostname
  6. vagrant up
  7. Browse to your hostname - and you should see your site up and running

PHP version

To change the PHP version, edit and set the php_version setting to 5.5, 5.6 or 7.0. Run vagrant provision if you're changing an already created vagrant instance

The full list - more comments and explanation are in the settings.shfile itself.

Basic Settings
WP database credentials
WP admin and site setup details
Database import