Create a local copy of your WordPress site

Copy and paste a few commands to create a ready to use local clone of your production site in minutes. No Docker knowledge required. No manual editing of Compose files. No manual cleanup. Still fully containerized and Docker compatible.

We love Docker ❤️ but it is not always easy. That is why we created WP Staging CLI.
Built on Docker so it feels native, but you never touch a compose file.

New to Docker?
You only need Docker Desktop, or Docker Engine plus Docker Compose. You do not need to learn any Docker commands.
If Docker is not on your machine yet, install the free Docker Desktop and then come back to this page.

What you’ll get:

  • Isolated local Docker based site with same PHP & WordPress versions
  • Automatic database import and configuration
  • Behind each command is a full Docker setup that you never have to see
  • All docker images can be exported and deployed
  • Automatic SSL handling. No local SSL warnings in your browser
  • Cleans up containers and volumes when you are done
  • Think of it as a shortcut to everything you wish Docker did for WordPress out of the box.

You are ready in sixty seconds

  1. Make sure Docker is installed and running
  2. Have your WP Staging Developer license key ready
  3. Copy the commands below to your terminal or if you want it even easier, use the CLI generator inside the WP Staging plugin for pure copy and paste experience without customizing any arguments:

If you want to create the site completely manually follow the commands below – It’s still easy:

Select your operating system and install WP Staging CLI

macOS, Linux, WSL:

Replace LICENSE_KEY with your WP Staging Pro Developer or Agency License key. If you don’t provide a license key you will be asked for it.

curl -fsSL https://wp-staging.com/install.sh | bash -s -- -l LICENSE_KEY

Windows PowerShell:

& ([scriptblock]::Create((irm https://wp-staging.com/install.ps1))) -l LICENCE_KEY

Windows CMD:

curl -fsSL https://wp-staging.com/install.cmd -o install.cmd && install.cmd -l LICENSE_KEY && del install.cmd

Add and start your local WordPress site

wpstaging add mysite.local

A fresh WordPress site will be ready in a few seconds at https://mysite.local
No compose files, no manual container setup.

You can add as many WordPress sites as you want. Just change the domain name to something else and repeat the command.

Import the source WordPress sites data to your new local site

Next you will need to download a backup from your site – in this example mysite.com – to your local computer and then restore the backup to the newly created local site mysite.local. After that you are done and have a full working clone of your production website on your local system.

curl -fSL \
  https://mysite.com/wp-content/uploads/wp-staging/backups/mysite.com_123456.wpstg \
  -o backup.wpstg
  
SITE=mysite.local && \
source <(grep -E "^(DB_|CONTAINER_IP)" $HOME/wpstaging/sites/$SITE/.env) && \
wpstaging restore \
--path=$HOME/wpstaging/sites/$SITE/www \
--db-host=$CONTAINER_IP:$DB_PORT \
--db-name=$DB_NAME \
--db-user=$DB_USER \
--db-password=$DB_PASSWORD \
--db-prefix=wp_ \
backup.wpstg

Important: Replace the backup link first before running the command. You can get the full path to a WP Staging backup on the page Backup & Migration → Actions → Copy Link to Backup:

Additional Options

Pick the PHP and WordPress versions you need for testing:

wpstaging add mysite.local --php=8.4 --wp=6.2.1 --db-prefix=custom_

Discover everything WP Staging CLI can do – There is so much more:

wpstaging --help

Documentation

You can find the complete WP Staging CLI documentation here.


WP Staging CLI is an independent tool and is not affiliated with, authorized, sponsored, or endorsed by Docker Inc. “Docker” and the Docker logo are trademarks or registered trademarks of Docker Inc.

We love Docker ❤️ but it’s not always easy, that’s why we created WP Staging CLI

Updated on November 27, 2025