Using a subdomain as a staging site
Set up a private copy of your site on a subdomain to test updates, PHP versions and redesigns without risking the live site.
On this page
A staging site is a copy of your site where you can break things safely.
Note: A copy of a database-driven site (WordPress, a shop, a forum) needs a second database. One database is included with your account, so check how many you have in MySQL Management before you start.
1. Create the subdomain
Create staging.yourdomain.co.uk. How to create a subdomain
2. Copy the site
WordPress: Softaculous can clone an installation to the subdomain, copying files and database and adjusting the URL. Look for the clone option in your installations list in Extra Features › Softaculous Auto Installer.
Other sites:
- Copy the files into the subdomain’s folder.
- Export the database and import it into a new database. How to export a database (backup with phpMyAdmin) How to import a database with phpMyAdmin
- Point the copy’s configuration at the new database.
- Update any hard-coded URLs to the staging address.
3. Keep it private
- Password-protect the folder. How to password-protect a folder
- In WordPress, tick Discourage search engines in Settings → Reading.
4. Test
- Plugin and theme updates
- A new PHP version, set just for the subdomain How to change the PHP version in DirectAdmin
- Design changes
Putting changes live
Staging databases drift from live ones as new orders, comments and posts arrive, so don’t copy the staging database over live on an active site. Repeat the tested changes on live instead, or copy only files.
Disk space
A staging copy doubles the space the site uses. Delete it when you’re not using it.
Prefer to follow along?
- Upgrade your site to a newer PHP version safely
Intermediate · 30 min
If it doesn’t work
These guides cover the most common problems, starting with what you can see. Or browse every fix for a common problem.
- FTP connection failed: how to fix itFix FTP login failures, timeouts and ‘failed to retrieve directory listing’ with the right host, username format, encryption and passive mode.
- SFTP connection failed: how to fix itFix SFTP errors — authentication failure, connection refused, timeouts and host key warnings — including which login SFTP uses.
- “Permission denied” and files that won’t save or uploadFix uploads and saves failing with permission errors in WordPress, apps and FTP, without resorting to unsafe 777 permissions.
- 403 Forbidden: how to fix itWhy the server refuses access with a 403 — missing index file, permissions, .htaccess rules or security blocks — and how to fix each one.
Common questions
How do I create a staging or test copy of my site?
Create a subdomain such as staging.yourdomain.com and install or copy the site there. It is genuinely separate from the live files, costs nothing extra, and is the right place to test updates before they reach visitors.
Password-protect the staging folder so search engines and the public never index a duplicate of your site.
Spotted something out of date or unclear? Tell us and we’ll fix it.