How to create a WordPress staging environment
This guide will show you how to create a staging or development environment best used for testing, troubleshooting, and light development. These steps are specific to WordPress, however much of the same process can be followed for other web apps as well.
We’ll refer to it as a staging site in this article, however you could call it dev, development or testing.
These steps use our specialized software configuration which makes use of Plesk control panel and Installatron (1-click web apps) for easy web application management. If you are not hosted with us, but your web host uses these tools as well, then this guide will work great for you too.
Want to make creating a staging environment this easy?
Part 1: Create a subdomain
We’ll start by creating a staging subdomain. If your DNS is not managed within Plesk then you will need to create the subdomain DNS A record wherever your DNS is hosted/managed.
- Login to Plesk and choose the “Add Subdomain” button
- You can enter whatever you like for the name. Some suggestions: dev, new, testing or most commonly staging. We’ll be using staging throughout this guide, so if you choose something different, you’ll need to ensure you swap usage of the word staging with your selection.
- If you have more than one domain hosted under the subscription, be sure to select the correct parent domain — this is the the domain you’re making a staging environment for.
- If you wish to customize the document root folder name, go for it! Plesk will default to ‘staging.<domain>’ which makes it easy to recognize amongst other domain document roots folders.
- Press the OK button to save your changes.
Part 2: Copy the site content to the staging subdomain
Tips:
- If you’re building a new site from scratch that will not be sharing any content (like blog posts) from a currently live site and you’ll be using WordPress or another web app to power the site, follow this guide to install the app of your choice, and select the staging subdomain as the install target.
- If your website is not powered by a web app found in 1-click web apps, see our website cloning guide here. In particular scroll to the section titled “Steps to clone a website not in 1-click web apps.”
In all other cases, follow these steps:
- Login to Plesk and choose the 1-click web apps (or Installatron) button to be taken to your list of installed applications.
- Find your website app in the list. If you do not see it there, learn how to import it into 1-click web apps here.
- Clone your app using the button with the two side-by-side arrows pointing down. More details on this process here. Your destination for the clone will be the new subdomain you created in Part 1. Be sure to check the box that says “Create a staging site” — this allows you to sync data between the live and staging sites with 1-click web apps.
- You should now lock down the staging site so as to prevent indexing by search engines. Here’s how to prevent indexing with WordPress.
And that’s all there is to it! You’ve now got yourself a staging environment located at the subdomain URL you specified in part 1. Do not prepend it with www (that is not used with subdomains). Your login credentials for your app will be identical to the ones you used on the live site.
Considerations for data sync between live and staging
If your goal is to complete a bunch of changes on staging and sync them to live, then to make your life easier at go-live time, the simplest way to ensure this works smoothly is to avoid making changes to the live site content whenever possible.
It’s strongly recommended that you read our follow-up guide to make your staging site changes live before you begin working on the staging site so you have a solid understanding of how data sync considerations will apply to your site.
Want to make creating a staging environment this easy?
Posted in Client Centre & Plesk, Guides
About Websavers
Websavers provides web services like Canadian WordPress Hosting and VPS Hosting to customers all over the globe, from hometown Halifax, CA to Auckland, NZ.
If this article helped you, our web services surely will as well! We might just be the perfect fit for you.
Very good article!
It is good to see best practice (development seperate to prod) encouraged by a hosting company!