Choose Apache or MySQL for Local WordPress Sites

Local debugging gets better the closer it matches production. WP Staging CLI creates sites on nginx and MariaDB 11.8 by default — and every site can opt for Apache and MySQL, at a database version you pick, without a global reconfiguration.

Run a Site on Apache

wpstaging add mysite.local --use-apache

Move an existing site between the two web servers at any time — the site keeps its files and database:

wpstaging reconfigure mysite.local --use-apache
wpstaging reconfigure mysite.local --use-apache=false

Run a Site on MySQL

Switch the database server and pin a version:

wpstaging add mysite.local --use-mysql
wpstaging add mysite.local --use-mysql --db-version=5.7

Available versions: MariaDB 10.11, 11.4, and 11.8 (default), MySQL 5.7 and 8.4 (default when you use --use-mysql).

Change the Database of an Existing Site

Rebuilding on a different database server replaces the database files, so restore the site data from a backup in the same step:

wpstaging reset mysite.local --use-mysql --db-version=8.4 --from=./backup.wpstg

Why Match Production

  • Reproduce issues that only MySQL 5.7 shows — for example, strict-mode and grouping differences.
  • Test a client site that really runs on Apache, including its rewrite rules.
  • Try the stack you plan to migrate to — MariaDB or MySQL, at the target version — before touching production.

Database Tools Either Way

Every site ships with the Adminer database UI at https://mysite.local/adminer/, and you can reach the command line with wpstaging shell-db mysite.local or wpstaging wp db query.

Next Steps

Updated on October 29, 2026

Rene Hermenau

Author: Rene Hermenau

About the author: René Hermenau is the founder of WP STAGING. He works on WordPress backups, staging, migrations, database handling, and safe deployment workflows.