Top 8 Best Ways to Set Up a Testing Environment for WordPress

Testing environments provide an easy and relatively inexpensive way to test themes, plugins and even new releases of WordPress without breaking your live site.

Many site admins take advantage of these environments where they can do thorough testing before committing changes to a site. If you’ve ever activated a new plugin or upgraded to a new version of WordPress only to find errors on your site, you will know the importance of testing first.

There are many ways you can set up a test environment, but the easiest by far are localhost environments or cloning your site on your existing web hosting account.

In this post I’ve put together a collection of some of the best testing environments available for WordPress, including options for both Windows and OS X. Most of the options are for setting up a localhost, but there are also options for duplicating a live site.

P.S. WPMU DEV will soon be announcing a plugin that will join the list below. Stay tuned.

  • MAMP

    mamp

    MAMP (which stands for Macintosh, Apache, MySQL and PHP) lets you set up a localhost environment on OS X. Version 3 of the software has been released and there’s also a beta version available for Windows.

    We recently published a great guide to setting up MAMP on the blog, which walks you through installing the program, basic MAMP configuration, creating a MySQL database, and installing WordPress. The post includes optional steps for setting up Multisite.

    MAMP is free, but there’s also a premium version available multi-PHP, the ability to set up any number of virtual servers, and the option to install WordPress automatically.

  • XAMPP

    xampp

    XAMPP is a popular, free and open source localhost PHP development environment available for Windows, OS X and Linux.

    We also recently published a tutorial on setting up XAMPP, which guides you through set up, using the XAMPP control panel, setting up a MySQL database, installing WordPress and setting up Multisite.

    The Apache Friends website includes a fantastic forum for users who run into trouble and need some help. I ran into a few problems with setting up the software (mostly firewall issues) and was able to quickly search the forums for a solution.

  • DesktopServer

    desktop-server

    Desktop Server is so easy to set up it can take as little as 5 minutes to get WordPress up and running on your local machine. After setting many localhost environments, this software has become part of my regular workflow when testing WordPress plugins and themes.

    I wrote a guide on how to use Desktop Server recently, which walks you through set up and installing the latest version of WordPress.

    Unfortunately, you’ll need to upgrade to the premium version of the software in order to set up Multisite. The limited version of Desktop Server allows you just three WordPress installs.

  • WampServer

    WampServer

    WampServer is a popular Windows web development environment that allows you to create web applications with Apache2, PHP and MyDQL.

    This is another localhost environment I’ve written about on the blog, with a guide on how to set up the software, create a MySQL database, install WordPress and (optionally) set up Multisite.

  • Duplicator

    duplicator

    The free and popular Duplicator plugin lets you clone a WordPress site for use in another location. This is especially help if you want to create an exact copy of your site to use as a testing environment on your local machine or on your hosting account.

    Creating an exact duplicate of your site will allow you to test plugins, themes and even upgrades to WordPress before making changes to your live site.

    Unfortunately, this plugin doesn’t support Multisite.

  • Instant WordPress

    instant-wordpress

    Instant WordPress is a complete standalone, portable WordPress development environment that turns any Windows machine into a development server. It’s so portable it will even run from a USB key.

    The free software comes with its own built in Apache web server, PHP and MySQL installations that are started and stopped automatically.

  • Bitnami WordPres Stack

    bitnami-wordpress

    Bitnami offers a free WordPress stack that is self-contained and will have you up and running with WordPress in minutes. The WordPress stack is available for OS X, Linux, WordPress virtual machines and in the cloud.

    The great thing about Bitnami is that the service tracks every release of WordPress and the stack is updated shortly after new releases, including security releases.

    After installing Bitnami WordPress Stack, I was surprised I was able to login to my new WordPress site so quickly and wondered if I had missed any steps. It really is easy to use this software to quickly set up a test environment.

  • Sandbox

    sandbox

    The Sandbox plugin creates an exact copy of your WordPress site on your existing hosting account, providing A test environment completely independent of your site that’s hidden from visitors and search engines.

    This free plugin is best for small sites as it can take a while to replicate a site. I tested the plugin in a Multisite installation and it worked fine, though it’s confusing to know when you’re using the sandbox version of your site, despite the notice at the top of the page.

Summing Up

Setting up a test environment will save you time, money and potential headaches when a plugin breaks a live site.

Duplicator is by far the most popular cloning plugin and I would recommend it for duplicating a live site on an existing web hosting account.

DesktopServer is a fantastic solution if you want to set up a local server environment on OS X or Windows. It is simple and straightforward to set up and you don’t have to worry about setting up WordPress separately as it’s part of the installation process. I regularly use DesktopServer on my Mac machine for testing plugins, themes and new versions of WordPress.

I was surprised at how easy Bitnami was to set up. While I haven’t tested it extensively, I’ll definitely be making more use of this software in future.

How have you set up your testing environment? Let us know in the comments below.

28 Responses

    Nathan Corbier

    I use Duplicator both to pull copies of a client’s existing website for redevelopment work to my development VM, and then to push a copy of a new or redesigned website to client’s hosting — especially if I don’t have SSH access and the ability to do a git push.

    michael_heple

    I did run into an issue using Duplicator and GoDaddy regular hosting. I eventually switched to their Managed WordPress but I did not try Duplicator after switching.

    ken_moss

    I used to test almost everything on my WAMP server. I feel it works great but if you require to test certain features like mail etc then it becomes a difficult to use. I also tried Duplicator and found it very frustrating to use.

    I had a perfect solution to this problem when I changed my hosting to wp-engine and later to wpoven (because it’s pricing suited me better), both the hostings have the feature to make a staging site real quick. I found it saved a lot of my time this way.

        ken_moss

        Well I used staging at WP Engine just once but used the one at wpoven more often, but both are pretty much the same though. What I found great was the ease with which I could create a staging site (with a single click) and then I could go crazy with the plugins and thoroughly test them.
        What’s also good is that the staging site is created on the same server, so the server config for which you test is exactly the same as the one for the main site, because in the past I have faced issues a couple of times due the different configs of my local wamp and the hosted server.

          steve_vaughan

          Hey

          Thanks Ken, I tried WPOven hosting and loved it’s staging feature. Also the pricing for it seems to good. If they would just offer tele support, it would be awesome.

          Cheers

    nippermh

    Is there an easy way to update a local version of a website from a live version without having to do a reinstall every time someone writes a blog post, installs a plugin etc?

    atouchofsummer

    I’ve been planning to try DesktopServer for a while, but for now, I use WP Migrate DB to make an exact copy of my live database… the plugin takes the URL and paths for my test site and automatically replaces the live site info, then downloads an sql dump file to my computer.

    I import that into my test site, and my up-to-date test site is ready to rock-n-roll. All I have to do is manually copy over the wp-content data I want (themes, plugins, uploads), and it’s ready to go.

      Marc Benzakein

      Thanks for mentioning DesktopServer in your article, Rae! We have found that DesktopServer is gaining a lot of traction thanks to articles such as yours and I’ve found that over the last few months, it’s hard for me to go to a single WordCamp without a few presenters using it or showing it in their presentations. So thanks guys, for the endorsements! And if there is anything we can do for you all, just let us know! We think the WordPress Community totally rocks!

    michael_windham6

    I love using WP Clone for this.

    I personally have a domain, which I only use for dev/staging sites (although you could just as easily set the dev site up on a sub domain or a sub folder). It is on the same hosting service I use to host live sites. So, I know all the server settings are the same. When I am working on a client’s site, I just create a WordPress install, and install the WP Clone plugin on the live and dev sites. It takes one click to clone a site, and one click to restore a copy. So, I can do whatever I want on the dev site, make sure everything is working properly, then copy it over to the live site.

    I have never had a problem using WP Clone for copying sites back and forth, unlike a couple of other plugins I have tried. I have not tried it with Multi-Site.

    luke25

    I’ve tested most of these solutions out at one time or another but there are still a few I am yet to try so thanks for the list. Recently I’ve had great success using the Duplicator plugin and I’d definitely recommend it.

    Dean

    Not a great article as it is hard to achieve using any of those methods, most of them are just server software and include no real method to manage the migration of the system from test to live.

    I have found Migration Magic is perfect for managing a test environment for WordPress or any other PHP site, check it out:

    http://migrationmagic.com

    Steve

    Really Nice Setup – Secure – Development – Debugging – Staging / Versioning – Live Server
    You end up with all that, plus you never have to enter a password, no insecure FTP or SFTP – Deploy to live with Git and SSH, (if your scared of command line they have a GUI too), you get multiple layers of redundancy for backups.

    I recently had to set my whole workflow up for a new hire from scratch on Windows 8.1 because he’s not ready to give it up for Linux, which is far superior but he doesn’t believe me yet. I don’t know why you would want to use something that was fast, free, secure, and actually just worked all the time when you told it to do something….
    Anyways it brought me back to when I did this on Linux the first time and I felt like making a blog post about it, then saw this thread.

    Local –
    Vagrant, Virtualbox, and VVV ( https://github.com/Varying-Vagrant-Vagrants/VVV )

    Staging – (This is your versioning of all your code as well)
    Git & Private Repositories – this will depend on your budget for who you go with
    FREE to Very Cheap – Bitbucket
    Solid & Mid Range $ – GitHub
    Self Hosted & your Network Security – GitLab or similar – (also free option they host)

    Live –
    Whoever you are with now will be fine, unless you still use a lower level shared hosting situation where you can only use FTP/SFTP. If this is you, sorry this won’t work, and even if it did you need to move off it anyways ASAP.

    Way better options for the same or a few dollars more a month are out there. But you need to learn a little SSH / Command Line Unix stuff because the goal is to not have any passwords at all for your live server and only use SSH keys to log in from a safe network/computer. (PS you can still keep SFTP, it won’t make this not work, just not as secure overall. FTP = Stop using it yesterday)

    Which if you set this up with Git and a staging server you would actually never need to log in to your server at all to make updates to any site you have live. And you would only need to SSH in to set up a few things to deploy a new site you are ready to take live. Set up git in it’s new home. So this way you develop all your stuff locally, you can push the stuff your working on into the staging repo, and deploy your changes from there to your live server. You never even had to log in…. Crazy – What else is crazy is you know your code works because your Virtual Box server is an exact clone of your online server.

    Lets review what this setup gets you –
    You can have a highly advanced server setup with server side caching, database caching, or any high traffic setup you need.

    You can launch the exact same thing on your local PC on demand, also anyone else working on something can have your exact setup you have live as well to work on. You can feel safe updating plugins, the core, and making changes you would never dream of trying on a live site because its on a VB locally, and your website is still live on the server, backuped up in a private repo possibly with more than one branch already. Plus you could be using Snapshot Pro to be taking server backups and say, saving them to Google Drive, also your Google Drive could be syncing those backups also back to your PC as well.

    Backup on Drive
    Backup Locally
    All your important code in a private rep0 backed up
    All your changes you ever made fully tracked, by whoever made them
    Then you still have the files you are working on in your VB server locally.

    I mean you would have to have multiple points of failure across 3 completely different platforms to lose your clients website files. First of all Google would have to decide to just shut down drive and close (I think your good on that), your computer would have to have an epic failure, and where your VPS is hosted would have to be destroyed at the same time. Obviously your gonna be fine.

    Sounds too expensive right? I mean you can do everything I just said with a Digital Ocean droplet of any size (depending how many website you have), if you don’t want to manage and set up your server at all or be responsible for updates then just get ServerPilot ( serverpilot.io ) its free if you don’t want them to do a SSL certificate for you if you need it its $10. So your talking $20-$30 a month and you get a VPS that’s managed, we still have them on a few random droplets, even though we could easily sysadmin them I never had a problem with them ever, and the backend panel I personally like. Now if your coming from Cpanel shared you might feel a little nervous, don’t be, speed test your site before and after you will know why you moved. You won’t get all the fancy stuff VVV has but its still got Gzip, Nginx and the ability to customize and add whatever with documentation on it.

    Are you gonna knock this whole setup out from scratch and make it home to dinner with your family (…or maybe just pets if you already spend too much time on the PC)? No way!
    You will need to set aside 1-3 full days depending on how much of this you have ever seen before. Where nobody can talk to you because you may punch them because your frustrated to your wits end because you can’t get XYZ thing to work right for the past hour….. then you realize you were typing “vagrant-hostupdater” instead of “vagrant-hostsupdater” after you already re-installed half of everything you did.
    Is this for everyone? No certainly not, their are other options for sure. Maybe you find one with some of these pieces but you don’t need VVV because it’s too advanced. There are a ton of other options like WAMP – XAMPP, everything everyone else said.

    I don’t agree, it will make you have a better understanding of what is actually going on in WordPress. When you have debugging on with VVV and it’s set to WordPress best coding standards (its set that way automatically if you have debug on) and you finally fire up your site you had live and now it’s showing a ton of PHP errors on the pages. You will be pissed, but then you will make a choice if you want to actually be a developer and make stuff that is worth making for a client, or if your going to choose to ignore those warning because they wouldn’t show up live anyways.

    Ok, done ranting now. =)

    I really just stumbled on this post while doing a little research for a Blog post I was making laying this whole process out step by step with pictures and code, and fixes to all the problems you may have on Linux and for Windows getting set up. I just had to set this all up for someone just getting into the “fun stuff”, I run Linux so the setup for me was easy with SSH and keys and command line because I’m used to it. He’s not quite ready to let go of Windows (even thought once you do you won’t ever look back) and man was it a pain to set it all up on 8.1 after not messing with the actual installing of it for so long and being used to Linux where for the most part stuff works how you would expect it to….

    Moral of the story is comment me back if your interested in seeing the step by step for everything I said on both platforms you can even go dual boot if you want. I looked for hours trying to figure a few things out on windows and I’m sure other people who are trying this for the first time are just giving up completely.