Hugh Lashbrooke

Product manager by day, tabletop game designer by night.

Setting up my WordPress development environment

, ,

Plenty of posts have been written about setting up a local development environment for WordPress, but when I moved to a new Macbook (running OS X Yosemite) I couldn’t find a post that contained all the instructions I needed. After some searching I got everything up and running and thought it would be worthwhile to share my process and tools here for posterity.

I use my local development environment for:

  • WordPress plugin development
  • Working on WooThemes products (plugins & themes)
  • WordPress core contributions
  • Working on client sites

For this I use the following tools:

  • Vagrant for the general development environment
  • SVN for checking out WordPress trunk and managing my plugins on the WordPress.org repo
  • Git for managing my public plugin repositories as well as all of the WooThemes product repositories
  • Sublime Text for editing code

Vagrant

logo_vagrant-81478652The initial setup of the Vagrant environment was easy using Varying Vagrant Vagrants. They have a complete step-by-step on their GitHub repo, so you shouldn’t struggle getting that up and running. It did take quite a while to set up, but that’s only because it has to download a lot of software in order to work – it’s relatively uncomplicated to get it working though.

VVV comes with some handy features for WordPress development, most notably it includes the WordPress trunk repository checked out from SVN. This enables you to get the latest development version and create patches to submit to Core Trac easily.

One thing that VVV doesn’t include by default is the ability to easily generate new WordPress sites on the fly. If you’re developing sites for clients, or if you often require new sites for testing, then this is pretty much essential. Luckily, there’s a VVV add-on script that handles this for you very easily: Variable VVV by Brad Parbs. The wizard is a single script that is super easy to use and will generate new sites for you with no additional work on your part – simply follow the simple guide in the GitHub repo and you’ll have no problems.

Additionally, Leo Gopal has created a new VVV dashboard that lets you manage your WordPress installs with greater ease – it provides a friendly UI and easy to use tools. You can grab it from GitHub.

SVN

There’s no need to install SVN before setting up VVV, but in order to use the WordPress trunk SVN repo you need to upgrade the default SVN version. If you’re not sure how to do that, then this guide will run you through the (very quick) process.

vsIf you aren’t comfortable using SVN in the command line then I recommend using Versions to manage your SVN repos through a robust GUI.

Git

LSprVcwqYou don’t need to install anything extra to manage your Git repos, but if you would rather not use the command line to manage things then SourceTree is your best bet for a functional GUI for managing both GitHub and Bitbucket repos.

Sublime Text

Sublime_Text_LogoThe code editor you use is entirely based on your own preferences, but I like to use Sublime Text 3 for development. The main reason for this is the plethora of add-ons that are available for it – some of which are hugely helpful for WordPress development.

Before you can install add-ons for Sublime Text, you need to enable Package Control. Once you’ve done that you can install any of the available add-ons. These are the ones that I use:

The colour scheme I use these days is the Material Colour Scheme – based on Google’s Material Design UI. It provides a dark background with bright colours – kind of like the popular Monokai, but brighter.

That’s my setup – what do you use?

27 responses to “Setting up my WordPress development environment”

  1. Leo Gopal Avatar
    Leo Gopal

    Hey Hugh, great post.

    Always wondered if moving to vagrant (from MAMP) is worth it.
    This post was quite easy to follow through, do you ever use WP-CLI?

    Also – You are using sublime, I am using Coda 2.5 and sometimes Atom – mostly for the wordpress/php auto-complete which makes things so much faster when developing, does sublime have similar?

    Thanks again!
    Eternal Smiles, Leo Gopal
    South Africa

    1. Hugh Lashbrooke Avatar
      Hugh Lashbrooke

      Hi Leo,

      I was using MAMP on my previous laptop and, after having made the switch, I find Vagrant to be better in three main ways: It’s easier to setup (using VVV), more flexible and less bloated. It’s also easier to keep up to date with Vagrant, whereas I found MAMP more difficult in that regard.

      I’ve never used WP-CLI, so can’t comment on that side of things.

      Sublime Text has built-in auto-complete for PHP and WordPress core functions, so you’re good to go on that front. I’ve never tried Coda, but Atom seemed to be pretty solid when I first tested it out.

      1. Leo Gopal Avatar
        Leo Gopal

        oh awesome, I didnt know about the auto-complete being default in Sublime – Now even more reason to try it out again (busy installing the packages you mentioned, they are sweet!)

        Thanks for the tips.

  2. Leo Gopal Avatar
    Leo Gopal

    Hey Hugh, great post.

    Always wondered if moving to vagrant (from MAMP) is worth it.
    This post was quite easy to follow through, do you ever use WP-CLI?

    Also – You are using sublime, I am using Coda 2.5 and sometimes Atom – mostly for the wordpress/php auto-complete which makes things so much faster when developing, does sublime have similar?

    Thanks again!
    Eternal Smiles, Leo Gopal
    South Africa

    1. Hugh Lashbrooke Avatar
      Hugh Lashbrooke

      Hi Leo,

      I was using MAMP on my previous laptop and, after having made the switch, I find Vagrant to be better in three main ways: It’s easier to setup (using VVV), more flexible and less bloated. It’s also easier to keep up to date with Vagrant, whereas I found MAMP more difficult in that regard.

      I’ve never used WP-CLI, so can’t comment on that side of things.

      Sublime Text has built-in auto-complete for PHP and WordPress core functions, so you’re good to go on that front. I’ve never tried Coda, but Atom seemed to be pretty solid when I first tested it out.

      1. Leo Gopal Avatar
        Leo Gopal

        oh awesome, I didnt know about the auto-complete being default in Sublime – Now even more reason to try it out again (busy installing the packages you mentioned, they are sweet!)

        Thanks for the tips.

  3. Hans-Helge Avatar
    Hans-Helge

    Hi Hugh,

    great overview! I use VVV as well and like Vagrant for some months now. I also used MAMP previously and switched completely.

    @Leo: VVV has WP-CLI installed. You can ssh on your vagrant and just use wp-cli without any configuration. Great tip 😉

    @Hugh: You mentioned the “VVV Site Wizard” script. I used it couple of times and it definitely works. But do you use one vagrant (VVV) for all your projects (dev, clients, etc.) or do you have multiple vagrants for different projects?

    1. Hugh Lashbrooke Avatar
      Hugh Lashbrooke

      I currently use one vagrant instance for all my projects, but I’ve only recently started using it and depending how many projects I end up having I might start using multiple instances.

    2. Leo Gopal Avatar
      Leo Gopal

      @Hans-Helge, great tip! Definitely going to get VVV installed now – been playing with WP-CLI lately and its definitely worth the move.

  4. Hans-Helge Avatar
    Hans-Helge

    Hi Hugh,

    great overview! I use VVV as well and like Vagrant for some months now. I also used MAMP previously and switched completely.

    @Leo: VVV has WP-CLI installed. You can ssh on your vagrant and just use wp-cli without any configuration. Great tip 😉

    @Hugh: You mentioned the “VVV Site Wizard” script. I used it couple of times and it definitely works. But do you use one vagrant (VVV) for all your projects (dev, clients, etc.) or do you have multiple vagrants for different projects?

    1. Hugh Lashbrooke Avatar
      Hugh Lashbrooke

      I currently use one vagrant instance for all my projects, but I’ve only recently started using it and depending how many projects I end up having I might start using multiple instances.

  5. Leo Gopal Avatar
    Leo Gopal

    Been using Vagrant ever since you posted this article, loving it Hugh.

    I also made a switch to Variable VVV, A Site Creation Wizard. Its a bit more robust with more features (and active development).

    I also created a VVV-Dashboard you may like, take a look, let me know what you think.

    VVV-Dashboard -> https://github.com/leogopal/VVV-Dashboard

    1. Hugh Lashbrooke Avatar
      Hugh Lashbrooke

      I’m going to be trying out Variable VVV soon – it’s a fork of Alison Barrett’s wizard that I mentioned in this post, so it should be an easy move to make.

      Your dashboard looks really cool – nice work! I’ll test it out this week 🙂

    2. Hugh Lashbrooke Avatar
      Hugh Lashbrooke

      Had a look at your VVV dashboard last night and it’s really cool – easy to install and is a huge improvement on the default one. Really awesome work man!

      I’ll update the post to mention it 🙂

      1. Leo Gopal Avatar
        Leo Gopal

        Thanks for the mention Hugh, appreciate it!

        If you have any suggestions for improvements, hit me up. I just released an UI update making the feel a lot cleaner.

        Also, Variable VV is seamless (just one ‘v’ less when working with it) and you may love the Blueprint feature, mine auto installs WooCommerce with Storefront if I choose my ‘woo’ blueprint.

  6. Leo Gopal Avatar
    Leo Gopal

    Been using Vagrant ever since you posted this article, loving it Hugh.

    I also made a switch to Variable VVV, A Site Creation Wizard. Its a bit more robust with more features (and active development).

    I also created a VVV-Dashboard you may like, take a look, let me know what you think.

    VVV-Dashboard -> https://github.com/leogopal/VVV-Dashboard

    1. Hugh Lashbrooke Avatar
      Hugh Lashbrooke

      I’m going to be trying out Variable VVV soon – it’s a fork of Alison Barrett’s wizard that I mentioned in this post, so it should be an easy move to make.

      Your dashboard looks really cool – nice work! I’ll test it out this week 🙂

    2. Hugh Lashbrooke Avatar
      Hugh Lashbrooke

      Had a look at your VVV dashboard last night and it’s really cool – easy to install and is a huge improvement on the default one. Really awesome work man!

      I’ll update the post to mention it 🙂

      1. Leo Gopal Avatar
        Leo Gopal

        Thanks for the mention Hugh, appreciate it!

        If you have any suggestions for improvements, hit me up. I just released an UI update making the feel a lot cleaner.

        Also, Variable VV is seamless (just one ‘v’ less when working with it) and you may love the Blueprint feature, mine auto installs WooCommerce with Storefront if I choose my ‘woo’ blueprint.

  7. codelobster Avatar
    codelobster

    I like to use Codelobster. It has special plug-in for WordPress development: http://www.codelobster.com/wordpress.html

  8. codelobster Avatar
    codelobster

    I like to use Codelobster. It has special plug-in for WordPress development: http://www.codelobster.com/wordpress.html

  9. Harshay Avatar
    Harshay

    Any recommendations for Ubuntu/Linux.
    Has anyone used Local by Flywheel, looks like they don’t have Linux version though.

    1. Hugh Avatar
      Hugh

      I have since moved to Linux (Kubuntu) and I continue to use VVV – it is built for Linux as well. I listed a few options in this thread here as well: https://twitter.com/hlashbrooke/status/912631824077205504

      1. Harshay Avatar
        Harshay

        Thank you, I am going to have to try that to streamline development of WP projects that I work on.

  10. Harshay Avatar
    Harshay

    Any recommendations for Ubuntu/Linux.
    Has anyone used Local by Flywheel, looks like they don’t have Linux version though.

    1. Hugh Avatar
      Hugh

      I have since moved to Linux (Kubuntu) and I continue to use VVV – it is built for Linux as well. I listed a few options in this thread here as well: https://twitter.com/hlashbrooke/status/912631824077205504

      1. Harshay Avatar
        Harshay

        Thank you, I am going to have to try that to streamline development of WP projects that I work on.

Leave a Reply

Your email address will not be published. Required fields are marked *