Using Vagrant box for WordPress development

Setting up development environment is a tedious processes. Vagrant makes it easier to create and configure lightweight, reproducible, and portable development environments.

vagrant

We can use vagrant box to create our WordPress development environment, where nginx, php, MySQL, WordPress and other necessary softwares were pre-installed.

I wrote a solution for that, named WordPress-Vagrant.

Laravel framework offers a nice vagrant box named Homestead, that already contains almost everything that we need. So, instead of creating a new box from scratch, I did use homestead as base box and added WordPress on it.

Once you clone the repository and setup according to instructions, you shall get a virtual machine with following softwares pre-installed.

  • Ubuntu 14.04
  • PHP 5.6
  • HHVM
  • Nginx
  • MySQL
  • Postgres
  • Node (With PM2, Bower, Grunt, and Gulp)
  • Redis
  • Memcached (PHP 5.x Only)
  • Beanstalkd
  • WP-CLI
  • PHPUnit
  • Composer
  • Running WordPress instance

Newly created WordPress instance can be accessable by visiting http://wordpress.app

All WordPress files serve from a directory named wordpress, inside your project directory on your local machine. So, you can use your favourite IDE for writing your codes.

Initially wordpress directory contains no files. When you run vagrant up, it will dump all WordPress files for you.

Visit WordPress-Vagrant and feel free to fork.