Run production WordPress locally — from a WP STAGING backup, with one command
WP STAGING CLI creates Dockerized WordPress environments and can restore or extract .wpstg backups without needing a working WordPress installation.
Ideal for agencies, plugin authors, and disaster recovery workflows.
Included with Developer and Agency licenses of WP STAGING Pro.
$ wpstaging add https://client.local
$ wpstaging restore https://client.local --from=https://client.com/.../backup.wpstg
$ wpstaging extract --only-plugins backup.wpstg
What WP STAGING CLI is built for
Fast local environments, reliable restore workflows, and backup tooling you can script.
Dockerized WordPress environments
Create clean WordPress installs with the PHP/WP versions you need — and switch either one on an existing site without a reinstall. No WordPress needed? The same command builds a plain PHP or static site. Learn more →
Local copy from .wpstg backup
Turn a production backup into a working local site for debugging, QA, and client work.
Extract only what you need
Pull out plugins, themes, uploads, or a database dump — without a full restore.
Inspect backups before you act
View header, metadata, and index details to confirm what’s inside a backup file.
Container control + shell access
Start/stop sites, check status, open a shell in PHP/DB containers — from the same CLI.
Repeatable across machines
Same commands on macOS/Windows/Linux. Fast mode keeps Windows site files editable from Explorer while they stay in sync.
Multisite networks, not just single sites
Create and restore subdomain multisites locally. Subsite hostnames land in nginx, SSL, and the hosts file in the same run.
Admin, database, and email included
magic-link signs you into wp-admin without a password. Every site comes with the Adminer database UI and a Mailpit inbox that catches outgoing email.
Machine-readable by design
Commands answer in --json for scripts and dashboards, so the CLI slots into CI jobs, GUI wrappers, and AI coding-agent workflows.
Local sites that reach production
Every site joins one Docker network with HTTPS the browser trusts, so WP Staging Remote Sync can pull production data into the local site and push local changes back. magic-link --redirect signs you into that screen without a password. Remote Sync requires Developer or Agency.
Plain PHP and static sites, not only WordPress
wpstaging add app.local --skip-wordpress builds the same environment - PHP, MariaDB or MySQL, trusted HTTPS - without a WordPress install. The document root stays yours: framework, front controller, or static files.
Nginx or Apache, MariaDB or MySQL - per site
Each site picks its own web server and its own database. nginx and MariaDB are the defaults: --use-apache serves the site through Apache, --use-mysql runs MySQL instead of MariaDB, and --db-version sets the release - MySQL 5.7 or 8.4, MariaDB 10.11, 11.4 or 11.8. A legacy project and a current one sit side by side, each matching its host.
Common jobs made simple
From local builds to recovery workflows — the CLI keeps it fast and consistent.
Client debugging
Restore a production backup locally and reproduce issues safely.
QA and regression tests
Test changes against specific PHP/WP versions without setup overhead.
Disaster recovery
Extract or restore .wpstg backups even if the site is down.
Automation & scripting
Use the CLI in scripts for repeatable client workflows and provisioning — or give AI coding agents a sandbox they can rebuild on demand.
Quick command samples
A few examples that show the range: environments + backups + debugging.
Create a fresh site
$ wpstaging add https://mysite.local --php=8.3 --wp=6.6
Create a Dockerized WordPress site with specific PHP/WP versions.
Restore from a .wpstg backup path or URL
$ wpstaging restore https://mysite.local --from=/path/to/backup.wpstg
Turn a WP STAGING backup into a working local site.
Extract only plugins
$ wpstaging extract --only-plugins /path/to/backup.wpstg
Pull specific files/folders without a full restore.
Inspect what’s inside a backup
$ wpstaging dump-header /path/to/backup.wpstg
$ wpstaging dump-metadata /path/to/backup.wpstg
Validate contents and metadata before extracting or restoring.
Switch PHP or WordPress on an existing site
$ wpstaging switch-php mysite.local 8.4
$ wpstaging switch-wp mysite.local 6.8
Change versions in place — no reinstall, the site keeps its files and database.
WP-CLI, without the container typing
$ wpstaging wp mysite.local plugin list --format=json
Runs WP-CLI inside the site’s PHP container and prints the result — from your shell or a script.
Sign into wp-admin without a password
$ wpstaging magic-link mysite.local
$ wpstaging magic-link mysite.local --redirect='admin.php?page=wpstg_backup'
One-time login URLs for local sites. list refreshes a fresh link for every site.
A whole multisite network locally
$ wpstaging add network.local --subdomains
$ wpstaging restore network.local --from=network-backup.wpstg
Subdomain multisites are auto-detected from the backup, and every subsite keeps its own local address.
Create a plain PHP site — no WordPress
$ wpstaging add myapp.local --skip-wordpress
Full web server, PHP, database, and HTTPS with a placeholder index.php — a clean start for PHP apps and static pages.
Open a site’s files in your file manager
$ wpstaging open mysite.local
Jump straight to the site directory — yours or your AI coding agent’s editor starts there.
Show a local site as a public web address
One wpstaging link command puts a running site on its own HTTPS address through WP Staging Link. No port forwarding, no VPN, nothing for the other person to install. Hand the address to a client, or to the agency owner who asked for the changes, and they click through the site on their own connection. A staging review then needs no temporary hosting and no deploy.
Share it, then close it
$ wpstaging start showcase.local
$ wpstaging link showcase.local --region eu
Sharing https://showcase.local on
https://showcase-ww4av7.eu.wp-staging.link
Press Ctrl+C to stop.
^C
The link is closed.
The site has to run, so start it first. The link covers one hostname, so subsites of a multisite network are not shared.
74 seconds, no sound. The site in the film is a demo.
Works like the live site
The address is plain HTTPS. Theme links, wp-login and wp-admin all work on it, so a client can click through the site the way they would on the live one. Anyone with the address can reach wp-admin, so change a default login before you share.
The same address next time
--region eu and --region us pick the endpoint. The region, and any name given with --name, are saved with the site, so the next wpstaging link for it lands on the same address.
Closed when you end it
Ctrl+C ends the link, the CLI prints The link is closed., and the address stops serving your site. Adminer and Mailpit stay off the public address, and a second link for the same site on this computer is refused.
Your site stays on your machine
Nothing is uploaded. wpstaging link opens an outbound connection from your computer and answers requests from it, so your files, your database and wp-config.php stay on your machine. The tunnel carries a request to your computer and the answer back out, nothing of your site is copied to it. No visitor request goes through wp-staging.com, and the tunnel server never sees your licence key.
Pick eu or us
--region decides which tunnel server carries the traffic, and it is part of the address: https://showcase-ww4av7.eu.wp-staging.link or the same site on us.wp-staging.link. There are two so you can choose where the traffic that carries a client site passes through. The eu endpoint is in Frankfurt am Main, the us endpoint near New York. Pick the one nearer the people you share with and the address answers a little faster for them.
Tech notes
Designed for real-world workflows: speed, reliability, and automation.
Under the hood
Runs on Docker Desktop or Docker Engine with consistent containers: PHP-FPM, nginx or Apache, MariaDB or MySQL at the version you pick, and browser-trusted HTTPS out of the box.
Backup tooling
Inspect, extract, and restore .wpstg backups — even when WordPress isn’t running. A 20 GB backup extracts in about 36 seconds on modern SSD hardware.
Cross-platform
macOS, Windows, and Linux supported with the same command set — including a self-update and a one-line installer per platform.
Automation-friendly
--json output, --filter on list and status, and stable exit codes make the CLI a dependable building block in scripts, CI, and agent workflows.
"Restoring a client site locally from a backup used to take ages. Now it’s one command — and I can even extract just the plugin I need."
Sonia R. Web agency owner Freiburg
FAQ
Is WP STAGING CLI included with my license? ⌄
WP STAGING CLI is included with Developer and Agency licenses. The Developer plan is the cheapest option that unlocks the CLI.
Does it work without Docker? ⌄
Docker (or Docker Desktop) is required. The CLI removes the complexity by generating and managing the containers for you.
Can I restore or extract backups if the site is down? ⌄
Yes. You can inspect, extract, and restore .wpstg backups without relying on a running WordPress installation — useful for recovery and debugging.
Can I test an exact PHP, WordPress, or database stack? ⌄
Yes. Pick PHP and WordPress versions when you create a site, and switch either one later without a reinstall. You can also run a site on Apache instead of nginx, or on MySQL instead of MariaDB — at a specific database version. Handy for restoring the same client backup onto several stacks and comparing.
Does it support WordPress multisite networks? ⌄
Yes. Create subdomain multisites locally, and a multisite backup is detected on restore: every subsite gets its own local hostname, with nginx, SSL certificates, and the hosts file updated in the same run. Use --subsite-map to send specific subsites to different local domains.
Where do I find commands and examples? ⌄
The documentation and examples live in the GitHub release repo. You’ll find install steps, command help, and real-world workflows there.
Ready to work faster with real client sites?
Unlock WP STAGING CLI with the Developer plan and restore, extract, and manage local WordPress environments from your terminal.
Already on Developer/Agency? Go straight to docs & download.