How to Set Up a WordPress Staging Site on DigitalOcean

Updated On:

,By

Want to Set Up a Staging WordPress Site on DigitalOcean (Complete Guide)

A staging site is a clone of your live WordPress site that you can use to safely test changes, updates, new plugins, or themes — without affecting your live site.

In this guide, we’ll walk you through the process of setting up a WordPress staging environment on DigitalOcean, ideal for site owners, developers, and DIYers who want more control over their hosting.


🚀 Why Use a Staging Site?

  • Test plugin/theme updates before applying them live
  • Try design and content changes safely
  • Debug errors without affecting live users
  • Build new features without downtime

📋 Prerequisites

Before you begin, you need:

  • A live WordPress website
  • A DigitalOcean account
  • Basic knowledge of SSH and server management (or use a control panel like RunCloud/ServerPilot/CyberPanel)

Option 1: Manual Setup on a New Droplet (Advanced Users)

Step 1: Create a New Droplet

  1. Log into DigitalOcean
  2. Click Create → Droplet
  3. Choose Ubuntu LTS (e.g., 22.04)
  4. Choose your plan (Basic 1GB RAM is fine for staging)
  5. Select a datacenter near you
  6. Set authentication (SSH key recommended)
  7. Click Create Droplet

Step 2: Set Up the Server Stack (LEMP/LAMP)

You can install WordPress manually or use tools like:

  • EasyEngine (for Nginx + Redis)
  • WordOps (optimized LEMP stack)
  • ServerPilot (commercial)
  • Or manually install Apache/Nginx + PHP + MySQL

For example, to install LAMP manually:


Step 3: Create a Database for Staging


Step 4: Clone Your Live Site

  1. Export your live site database using phpMyAdmin or WP Migrate DB
  2. Copy your WordPress files from the live site using:
  • scp command (for SSH)
  • Or a backup plugin (like UpdraftPlus, Duplicator)
  1. Upload your files to /var/www/staging-site
  2. Update wp-config.php with new DB details
  3. Import database to staging server

Step 5: Update Domain for Staging

Use a subdomain, e.g. staging.yoursite.com

  • Add a new A record in your DNS pointing staging to the new droplet IP
  • Update Apache/Nginx virtual host for staging.yoursite.com
  • Restart server:

Step 6: Block Search Engines and Add Basic Auth

In robots.txt:

Add HTTP Basic Auth:

Then add this to your Apache conf:


Option 2: Use a Droplet Snapshot (Quick & Clean)

  1. Take a snapshot of your live WordPress Droplet
  2. Create a new Droplet from that snapshot
  3. Change the site URL in the database:
  • Use WP-CLI:
  1. Update DNS to point staging.yoursite.com to new droplet IP
  2. Lock it down with robots.txt and basic auth

Bonus: Use Tools Like RunCloud or SpinupWP

If you want to avoid managing the stack yourself:

  • Use RunCloud, ServerPilot, or SpinupWP
  • Connect your DigitalOcean server
  • Create a staging WordPress site from the panel with one click

Maintenance Tips

  • Always update your staging site when you update live
  • Test every update on staging before pushing live
  • Periodically clear cache and backups to save space

Summary

Setting up a staging site on DigitalOcean gives you full control, but also requires some tech know-how. You can either do it manually, from a snapshot, or using control panels like RunCloud. The extra effort is worth it for the peace of mind and professionalism it adds to your workflow.

Crazy about CRO?

Dessert Calories Don’t Count

Our Sales Funnel Strategy does.

We don’t spam! Read more in our privacy policy

Leave a Reply

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