How to Set Up a Local WordPress Development Environment

Set up local WordPress development with Local, XAMPP, WordPress Playground or Docker (wp-env): step-by-step setup, version matching and copying a live site.

Local WordPress development means running a full WordPress site on your own computer, so you can build, update and break things without a single visitor noticing.

4 free tools cover almost every case: Local, XAMPP, the WordPress Playground CLI and wp-env on Docker. This guide helps you pick one in two minutes, set it up, match your host’s PHP version and copy a live site down.

⚡ Quick answer

  • Best for most people: Local, a free desktop app that installs WordPress, PHP, a database and SSL in one wizard.
  • Fastest throwaway test: one command, npx @wp-playground/cli@latest start, if Node.js is installed.
  • Plugin and theme developers: wp-env, the official Docker-based tool, with config you can commit to Git.
  • Time needed: 10 to 30 minutes for a blank site, longer to copy a large live site.
  • Our call: match your host’s PHP version whichever tool you pick, or the local copy will hide the bugs you are trying to catch.

What you need before you start

  • A computer with room to spare. Local asks for at least 4 GB of RAM and 1.5 GB of disk for a few sites.
  • Admin rights on that computer. Local edits your hosts file, and XAMPP and Docker need installer permissions.
  • Your live site’s versions, if you plan to copy it: PHP, database, WordPress, theme and plugins. Tools → Site Health → Info lists them all.
  • A code editor such as VS Code, plus a browser with good developer tools. Our list of Chrome extensions for WordPress users adds a few that help while you test.
  • Node.js only for the Playground CLI or wp-env, and Docker only for wp-env or Docker Compose.

You do not need a domain, hosting or a paid licence. All of these tools are free.

Which local WordPress tool should you use?

Pick by how you work, not by which tool is newest. The table sums up the trade-offs, checked against each vendor’s documentation in November 2026.

ToolHow you use itDatabaseNeedsBest for
LocalDesktop app with a wizardMySQLNothing extraSite builders, freelancers, client sites
XAMPPControl panel plus manual WordPress installMariaDBNothing extraPeople who already know Apache and phpMyAdmin
Playground CLIOne terminal commandSQLiteNode.js 20.18+Quick tests, plugin demos, throwaway sites
wp-envTerminal, config in .wp-env.jsonMariaDBDocker and Node.jsPlugin, theme and block development
Docker ComposeTerminal, a compose.yaml you writeMySQL or MariaDBDockerFull control over every container
WordPress StudioDesktop app from AutomatticManaged by the appNothing extraWordPress.com and Pressable users
Local WordPress tools compared from vendor docs, November 2026.

Do this if you are unsure: start with Local. It hides the server plumbing and still gives you WP-CLI, SSL and a PHP switcher when you need them.

Skip the desktop apps if you write plugins for a team. A wp-env config file in the repository gives every developer the same site with one command.

Option 1: Set up WordPress with Local

Local is made by WP Engine and is free. It runs on macOS 12 or later, 64-bit Windows 10 and 11, and Debian- and RPM-based Linux, per its installation docs.

Local by WP Engine features list including automatic WordPress installation, WP-CLI and PHP switching, Live Links, one-click admin and cloud backups
Local’s main features: one-click installs with SSL, WP-CLI, PHP switching and Live Links. Source: localwp.com, captured November 2026.

Step 1: Install Local

Download the installer for your system from localwp.com. On a Mac, drag Local into Applications. On Windows, run the installer and click Allow access on each Windows Defender prompt, or Local’s services cannot talk to each other.

Step 2: Create the site

  1. Click + (or Create a new site) and enter a site name.
  2. Open Advanced options if you want a custom domain. Keep the .local ending; Local adds it to your hosts file.
  3. Choose Preferred for Local’s default PHP, web server and MySQL, or Custom to pick versions that match your host.
  4. Set the admin username, password and email, then click Add site.

When it finishes, the site appears in the sidebar. Click WP Admin to log in, or turn on one-click admin to skip the login screen.

Step 3: Use the extras

  • Open site shell gives you WP-CLI already pointed at the site.
  • Mailpit catches every email the site sends through wp_mail(), so password resets and form notifications never reach a real inbox.
  • Live Links create an HTTPS URL a client can open. You need a free Local account for this.

💡 Tip: test a new plugin stack here before it touches production. A good first project is trying the field plugins from our roundup of custom field plugins for WordPress side by side.

Option 2: Install WordPress on XAMPP

XAMPP bundles Apache, MariaDB, PHP and phpMyAdmin. In November 2026 the Apache Friends download page lists builds with PHP 8.3.37, 8.4.28 and 8.5.13 for Windows, Linux and macOS.

XAMPP for Windows download table listing builds with PHP 8.3.37, 8.4.28 and 8.5.13, each about 190 MB
XAMPP for Windows builds and installer sizes. Source: apachefriends.org, captured November 2026.

Unlike Local, XAMPP does not install WordPress for you. Here is the manual route.

  1. Install the XAMPP build whose PHP version matches your host, then start Apache and MySQL from the XAMPP Control Panel.
  2. Open http://localhost/phpmyadmin, click Databases, and create an empty database such as wp_local.
  3. Download WordPress from wordpress.org and unzip it into the htdocs folder, for example htdocs/mysite.
  4. Visit http://localhost/mysite and run the installer. Use database name wp_local, user root, an empty password and host localhost.
  5. Set the site title and admin account, and you are in.

That empty root password is fine on a laptop and dangerous anywhere else. Apache Friends says it plainly in its Windows FAQ: XAMPP is not meant for production use.

Two XAMPP problems come up again and again. If the database refuses to start, follow our guide to fixing MySQL not starting in XAMPP.

If the Media Library rejects WebP files, our walkthrough on enabling WebP uploads in XAMPP covers the GD and php.ini settings behind it.

The catch: XAMPP runs one PHP version per install. Testing PHP 8.4 and 8.5 side by side means two installs, which Local or wp-env handle with a setting.

Option 3: Run WordPress Playground from the command line

WordPress Playground runs WordPress on PHP compiled to WebAssembly, with SQLite instead of MySQL. The browser version lives at playground.wordpress.net. The CLI version runs the same engine on your computer.

WordPress Playground CLI documentation showing the Node.js 20.18 requirement and the npx @wp-playground/cli start command
The Playground CLI needs Node.js 20.18 or higher. Source: developer.wordpress.org Playground docs, captured November 2026.

With Node.js installed, open a terminal and run:

npx @wp-playground/cli@latest start

The start command logs you in as admin, opens your browser and keeps the site between sessions in ~/.wordpress-playground/sites/.

Run it inside a plugin or theme folder and Playground mounts that folder for you, so edits show up on refresh.

For more control, the Playground CLI docs describe a server command. We ran it on a Linux machine on 24 November 2026, and it printed:

WordPress Playground CLI

PHP 8.3  WordPress latest
Extensions intl, redis, memcached

Ready! WordPress is running on http://127.0.0.1:9400 (6 workers)
WordPress 7.1.5 dashboard with the welcome panel and At a Glance widget, running locally on port 9400 through the Playground CLI
A fresh local WordPress 7.1.5 site started with the Playground CLI on 127.0.0.1:9400, November 2026.

Useful flags:

  • --php=8.4 picks the PHP version. The CLI accepts 7.4 through 8.5 and defaults to 8.3.
  • --wp=7.0 pins a WordPress version instead of the latest.
  • --port=9500 changes the default port of 9400.
  • --blueprint=blueprint.json preinstalls plugins, themes and settings from a JSON file.

The catch: SQLite is not MySQL. A plugin that writes raw MySQL queries can behave differently, so do final testing on a MySQL or MariaDB stack.

Also note that server mode stores the site in a temporary folder, which the CLI cleans up once it is two days old and no longer in use. Mount your wp-content folder if you want to keep the work.

Option 4: Use Docker with wp-env

@wordpress/env, or wp-env, is the official environment tool from the WordPress project, and the Gutenberg repository ships its own config for it. It needs Docker (Docker Desktop, Colima, Rancher Desktop or Docker Engine), Node.js and Git.

  1. Start Docker.
  2. Install the tool with npm -g i @wordpress/env.
  3. Open a terminal in your plugin or theme folder, or in an empty folder.
  4. Run wp-env start and wait for the containers to download the first time.
  5. Visit http://localhost:8888/wp-admin and log in with admin and password.

To pin versions, add a .wp-env.json file to the folder:

{
  "$schema": "https://schemas.wp.org/trunk/wp-env.json",
  "core": null,
  "phpVersion": "8.4",
  "plugins": [ "." ],
  "port": 8888
}

A null core means the latest production WordPress. The wp-env reference also lists mariadbVersion, themes, multisite and phpmyadmin.

WP-CLI runs inside the container, for example wp-env run cli wp plugin list. Stop everything with wp-env stop.

wp-env runtime comparison table showing which features the Docker, Playground and PHP runtimes support, including MySQL, Xdebug and multisite
wp-env can also start without Docker using experimental Playground or PHP runtimes, with fewer features. Source: developer.wordpress.org, captured November 2026.

No Docker? wp-env start --runtime=playground uses Playground instead. Both experimental runtimes swap MySQL for SQLite and drop the run command.

This is the natural home for code-heavy work, like registering post types the way our guide to creating custom post types in WordPress shows, with the plugin folder mounted and reloading as you save.

Plain Docker Compose

If you want every container in view, the official WordPress image on Docker Hub ships a compose.yaml example. Here is a shortened version, with the database moved from the example’s MySQL 8.0 to 8.4:

services:
  wordpress:
    image: wordpress
    ports: ["8080:80"]
    environment:
      WORDPRESS_DB_HOST: db
      WORDPRESS_DB_USER: wp
      WORDPRESS_DB_PASSWORD: wp
      WORDPRESS_DB_NAME: wp
  db:
    image: mysql:8.4
    environment:
      MYSQL_DATABASE: wp
      MYSQL_USER: wp
      MYSQL_PASSWORD: wp
      MYSQL_RANDOM_ROOT_PASSWORD: "1"
    volumes: ["db:/var/lib/mysql"]
volumes:
  db:

Run docker compose up, then open http://localhost:8080.

Docker Hub notes the image adds no extra PHP extensions and cannot send email on its own.

How do you match your live site’s PHP and database?

A local site is only a fair test if it runs what your host runs. WordPress.org’s requirements page recommends PHP 8.3 or greater and MariaDB 10.11+ or MySQL 8.4+.

The current release is WordPress 7.1.5, from 18 November 2026.

ToolWhere you set PHPWhere you set the database
LocalCustom environment when creating the site, or the site’s PHP dropdown laterCustom environment
XAMPPPick the matching installer (8.3, 8.4 or 8.5)Bundled MariaDB
Playground CLI--php=8.4SQLite only
wp-env"phpVersion" in .wp-env.json"mariadbVersion"
Docker ComposeImage tag, such as wordpress:php8.4-apacheDatabase image tag
Where each tool sets PHP and database versions, per vendor docs, November 2026.

Common mistake: leaving the local PHP newer than the host. Everything works on your laptop, then a deprecated function throws errors on the server.

Match first, then test the upgrade on purpose, as in our guide to updating WordPress, plugins and PHP safely.

Copy memory settings too. A local site with a bigger memory limit than the host hides “Allowed memory size exhausted” errors. Our guide to increasing the WordPress memory limit shows where that value lives.

How do you copy a live site to your computer?

A blank site is good for learning. For real work you usually want a copy of the live site: same theme, plugins, content and settings.

  1. Export the live site with a migration plugin. Our comparison of WordPress migration plugins covers which ones handle large sites on free plans.
  2. Create an empty local site in your tool of choice, with the same PHP version as the host.
  3. Install the same plugin locally and import the archive. Good migration plugins rewrite URLs as they import.
  4. Check URLs. If links still point at the live domain, run a search and replace with WP-CLI.
wp search-replace 'https://example.com' 'https://mysite.local' --skip-columns=guid

Swap in your own domains. --skip-columns=guid leaves post GUIDs alone; Local’s own Live Links docs use the same flag.

⚠️ Watch out: a copy of a live store contains real customer emails. Disable email sending, payment gateways and scheduled tasks that call external services before you click around. Local’s Mailpit handles the email part for you.

Cannot install anything on your computer? A cloud sandbox works as a middle ground. Our InstaWP review covers spinning up temporary WordPress sites in the browser.

How do you check the local site works?

  • The front end loads at the local address and shows your theme, not a white screen.
  • You can log in to wp-admin, and Tools → Site Health → Info shows the PHP version you chose.
  • Permalinks work. Open a post; if you get a 404, visit Settings → Permalinks and click Save to rewrite the rules.
  • Uploads work. Add an image to the Media Library, including a WebP file.
  • Emails are caught, not sent. Trigger a password reset and look for it in Mailpit or your tool’s mail log.
  • Debug mode is on, with WP_DEBUG and WP_DEBUG_LOG set to true, so errors land in wp-content/debug.log.

Once those pass, the local site is safe for real work, such as editing theme.json in a block theme. Our theme.json guide is a good first project because every change shows up on refresh.

What breaks and how do you fix it?

What you seeLikely causeFix
Apache will not start in XAMPPAnother program is using port 80Close the other web server or change Apache’s port
MySQL stops right after startingPort 3306 in use or damaged data filesSee our MySQL-not-starting guide linked above
wp-env fails with a Docker errorDocker is not runningStart Docker Desktop or colima start, then wp-env start
Port 8888 already in useAnother wp-env site or appRun WP_ENV_PORT=3333 wp-env start
Local site redirects to the live domainsiteurl and home still hold the live URLRun WP-CLI search-replace, then clear caches
Browser warns about the certificateLocal’s SSL certificate is not trusted yetTrust the certificate from the site’s SSL setting in Local
Memory exhausted errorsPHP memory limit too lowRaise WP_MEMORY_LIMIT in wp-config.php
Common local WordPress errors and fixes, from XAMPP, Local and wp-env documentation, November 2026.

When nothing obvious is wrong, turn plugins off one at a time. Adding temporary debug snippets with one of the WordPress code snippet plugins is easier than editing functions.php on a site you are still learning.

Last resort for wp-env: wp-env destroy removes the containers and data so you can start clean. It deletes local content, so export anything you need first.

Frequently Asked Questions

What is the best local WordPress development tool for beginners?

Local is the easiest start for most beginners. It is a free desktop app that installs WordPress, PHP, MySQL and SSL through a short wizard, and it adds WP-CLI, email catching and shareable Live Links. You never touch a terminal unless you want to.

Is LocalWP free?

Yes. Local by WP Engine is free to download for macOS, Windows and Linux, and the vendor says it always will be. Some extras, such as Live Links and cloud backups, ask you to sign in with a free Local account first.

Is XAMPP still good for WordPress development?

XAMPP still works and ships current PHP 8.3, 8.4 and 8.5 builds. It is more manual than Local, because you create the database and install WordPress yourself, and it runs one PHP version per install. Apache Friends says it is not meant for production use.

Can I use WordPress Playground for real development?

Yes, for plugin and theme work and quick tests. The Playground CLI runs a persistent local site with one command and mounts your project folder. It uses SQLite instead of MySQL, so do final testing on a MySQL or MariaDB stack before release.

Do I need Docker for local WordPress development?

No. Local, XAMPP and the Playground CLI all run without Docker. You need Docker for wp-env and for Docker Compose setups. wp-env also has experimental Playground and PHP runtimes that skip Docker but drop some features, such as the run command.

How do I move a local WordPress site to a live server?

Use a migration plugin to export the local site, install WordPress on the host, and import the archive there. Most migration plugins replace the local URL with the live one during import. If any links still point to your local address, run a WP-CLI search-replace on the server.

Can I run several local WordPress sites at once?

Yes. Local manages many sites from one sidebar. With wp-env, give each project its own port using WP_ENV_PORT or a separate config file. The Playground CLI accepts a port flag, and each XAMPP site can live in its own htdocs folder.

Why does my local site redirect to the live URL?

The site still stores the live address in its siteurl and home settings, usually after importing a database. Run wp search-replace with the old and new URLs, skipping the guid column, then clear any cache. Good migration plugins do this replacement during import.

Which local setup should you pick?

  • Pick Local if: you build or maintain client sites and want a point-and-click setup with SSL, email catching and Live Links.
  • Pick the Playground CLI if: you want a disposable site in seconds to test a plugin, a theme or a WordPress version.
  • Pick wp-env if: you write plugins or themes, already run Docker, and want the setup stored in Git.
  • Keep XAMPP if: it already works for you and you only need one PHP version at a time.

Our pick for most StyleMyWP readers: install Local, create one site that mirrors your live PHP version, and make it the first stop for every plugin, theme and core update before it reaches production.

Last updated November 2026.

Lokesh Kapoor
Lokesh Kapoor

Lokesh Kapoor is a web developer, blogger, and digital creator passionate about WordPress, SaaS, automation, and modern web technologies. He shares practical tutorials, honest insights, and useful resources to help creators, entrepreneurs, and website owners build faster, smarter, and more effective online experiences with confidence, clarity, and consistency.

Articles: 33

Leave a Reply

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