How to Install WordPress on Localhost
Install WordPress on localhost with WordPress Studio, Local, XAMPP, wp-env, DDEV or Playground. Versions and commands checked on 18 November 2026.

The easiest way to install WordPress on localhost today is a one-click desktop app: WordPress Studio or Local. Download one, click “add site”, and you get a working WordPress install on your own computer in a couple of minutes, with no web server or database to set up by hand. Developers who want a reproducible, scriptable setup usually pick wp-env or DDEV, and anyone who only wants to try something for ten minutes can use WordPress Playground without installing anything at all. The classic XAMPP route still works too, and we cover it step by step below for Windows users who want to see every moving part.
Our team checked every tool, version and command in this guide on 18 November 2026. The current WordPress release is 7.1.4, and WordPress.org recommends PHP 8.3 or newer with MariaDB 10.11 or MySQL 8.4 or newer. Local tools change fast, so each section says which version we looked at.
This page has no recorded Search Console queries yet, so the headings follow the questions people ask when they set up a local WordPress site for the first time.
What does installing WordPress on localhost mean?
“Localhost” is your own computer acting as a web server. A WordPress site needs three things to run: a web server that answers browser requests, PHP to run the WordPress code, and a database to store posts, users and settings. On a hosting account those live on a server somewhere else. On localhost they all run on your laptop, and only you can see the site, usually at an address like http://localhost:8888 or https://mysite.local.
The tools differ in how they provide those three pieces:
- Classic stacks such as XAMPP install Apache, PHP and MariaDB as programs on your machine.
- Desktop apps such as Local bundle and manage the same kind of stack for you, one site at a time.
- Container tools such as wp-env and DDEV run each piece in Docker containers, so every developer on a team gets the same versions.
- Playground-based tools run PHP compiled to WebAssembly and store data in SQLite, so there is no separate database server. WordPress Studio uses a bundled PHP runtime with SQLite in the same spirit.
Why bother? A local site is private, free, works offline, and is the safest place to test a theme, a plugin update or a code change before it touches a live site. It is also where you should try risky things like a PHP upgrade or a big plugin swap.
Which local WordPress tool should I use?
Pick by who you are and what you need to repeat. This table sums up what we found on 18 November 2026.
Tool | Runs on | Needs Docker | Database | Best for |
|---|---|---|---|---|
WordPress Studio 2.2.0 | macOS, Windows, Debian-based Linux | No | SQLite | Beginners and theme or plugin work, free |
Local by WP Engine | macOS 12+, Windows 10/11 64-bit, Debian-based Linux | No | MySQL or MariaDB | A full classic stack with one-click setup, free |
XAMPP | Windows installers listed on the download page | No | MariaDB | Learning how the stack fits together |
wp-env 12.1.0 | Anywhere with Node.js 22.13+ | Yes by default, two experimental runtimes without it | MariaDB (SQLite in the PHP runtime) | Plugin and block developers, CI |
DDEV 1.25.5 | macOS, Windows, Linux | Yes | MariaDB, MySQL or PostgreSQL | Agencies and teams sharing one config |
WordPress Playground | Any modern browser, or Node.js 20.18+ for the CLI | No | SQLite | Quick tests and demos |
Our short version: if you have never set up a local site, start with Studio or Local. If you build plugins, use wp-env or the Playground CLI. If you run client projects with a team, DDEV is worth the Docker setup.
How do I install WordPress locally with WordPress Studio?
WordPress Studio is a free, open source app from Automattic. Its official site and GitHub README describe it as a local environment with “no Docker, external web server, or database setup required”. The latest release on GitHub when we checked was 2.2.0, published 11 November 2026, with downloads for macOS (Apple Silicon and Intel), Windows (x64 and ARM64) and Debian-based Linux.
- Download Studio for your platform from wordpress.studio and install it like any other app.
- Open it and choose to add a site. You can start blank, from a Blueprint (a saved recipe of themes, plugins and settings), or by importing a backup of an existing site.
- Give the site a name and, if you want, pick the PHP and WordPress versions for that site.
- Click to create it. Studio starts the site and gives you buttons to open the front end and wp-admin.
Per its README, Studio lets you set PHP and WordPress versions per site, use custom domains and HTTPS, open the site files, inspect the database and run WP-CLI. A WordPress.com account is only needed for the optional cloud preview and sync features. Because it uses SQLite rather than MySQL, a small number of plugins that send MySQL-specific SQL may behave differently; test those on a MySQL-based setup before you rely on the result.
How do I install WordPress with Local?
Local, made by WP Engine, is a free desktop app that runs a real web server, PHP and MySQL or MariaDB for each site. Its installation guide listed macOS Monterey (12) or newer, Windows 10 or 11 (64-bit), and Debian-based Linux when we checked on 18 November 2026. Windows 7, 8 and 8.1 are no longer supported.
- Download Local from localwp.com and run the installer. It will ask for permission to edit your hosts file, which is how it maps a name like
mysite.localto your computer. - Click the plus button to create a new site and give it a name.
- Choose the “Preferred” environment, or “Custom” to pick the PHP version, web server and database version yourself. Match your live host where you can.
- Set an admin username, password and email for WordPress.
- Wait for Local to finish, then use the “WP Admin” and “Open site” buttons.
Local adds extras that help later: one-click admin login, the Mailpit mail catcher so you can see emails WordPress tries to send, and Live Links to share a temporary public URL with a client. If a new site will not open in the browser, jump to the mistakes section below; it is nearly always the hosts file or the router mode.
How do I install WordPress on localhost with XAMPP?
XAMPP is the old-school route, and it is still the best way to understand what every tool above is doing for you. One thing has changed: on 18 November 2026 the XAMPP download page listed installers for Windows only, in three builds (PHP 8.5.12, 8.4.27 and 8.3.36), plus an in-browser version. The PHP 8.5.12 build bundles Apache 2.4.65, MariaDB 10.11.16 and phpMyAdmin 5.2.3. Mac users are better served by Studio or Local.
Step 1: Install XAMPP and start the services
- Download the Windows installer for the PHP version closest to the one your host runs. If you are unsure, PHP 8.3 matches the WordPress.org recommendation.
- Run the installer. Install to the default
C:\xamppfolder; installing insideC:\Program Filescan cause permission problems. - Open the XAMPP Control Panel and click Start next to Apache and MySQL. Both rows should turn green.
- Visit
http://localhost/in your browser. You should see the XAMPP dashboard.
If Apache refuses to start with a message that port 80 is in use, another program has the port. The mistakes section below covers the usual culprits.
Step 2: Create a database
- Click Admin next to MySQL in the Control Panel to open phpMyAdmin.
- Open the Databases tab.
- Enter a database name with no spaces, for example
wp_local, choose theutf8mb4_unicode_cicollation, and click Create.
A database name with a space in it, as some old guides suggest, only causes trouble later in scripts and backups. Keep it short and lowercase.
Step 3: Copy the WordPress files
- Download the latest WordPress zip from wordpress.org/download. On 18 November 2026 that was WordPress 7.1.4.
- Extract it. You get a folder called
wordpress. - Move that folder into
C:\xampp\htdocsand rename it to something short, such asmysite.
Step 4: Run the installer
- Open
http://localhost/mysite/and choose your language. - Enter the database details: database name
wp_local, usernameroot, password left empty (the XAMPP default), database hostlocalhost, and keep the table prefix or change it. - Click Submit, then Run the installation.
- Enter the site title, an admin username, a strong password and your email, then click Install WordPress.
- Log in at
http://localhost/mysite/wp-admin/.
The empty root password is fine for a machine only you use. Never copy that setup, or the XAMPP folder, to a server that faces the internet.
If you prefer the command line, WP-CLI can do steps 3 and 4 in four commands once XAMPP’s PHP and MySQL are on your PATH:
# Checked on 18 Nov 2026 (WP-CLI 2.12.0, WordPress 7.1.4)
cd C:/xampp/htdocs
wp core download --path=mysite
cd mysite
wp config create --dbname=wp_local --dbuser=root --dbpass="" --dbhost=localhost
wp core install --url=http://localhost/mysite --title="My Local Site" --admin_user=admin --admin_password="choose-a-strong-one" --admin_email=you@example.comHow do I run WordPress locally with wp-env?
wp-env is the official WordPress tool for plugin and theme development. It lives in the Gutenberg repository and is published on npm as @wordpress/env. Version 12.1.0, released on 4 November 2026, needs Node.js 22.13 or newer, and by default it uses Docker with Compose v2. Its documentation lists Colima, Docker Desktop, Rancher Desktop or Docker Engine as runtimes.
# Checked on 18 Nov 2026 (@wordpress/env 12.1.0, Node.js 22.13+)
npm -g i @wordpress/env
# Run from your plugin or theme folder; it is mounted and activated
cd my-plugin
wp-env start
# Site: http://localhost:8888 (admin / password)
# Another port if 8888 is taken
WP_ENV_PORT=3333 wp-env start
# Run WP-CLI inside the environment
wp-env run cli wp plugin listNo Docker? Version 12 adds two experimental runtimes. wp-env start --runtime=playground runs WordPress in WebAssembly, and wp-env start --runtime=php uses the PHP on your computer with SQLite (it needs the pdo_sqlite extension). The README notes that the Playground runtime lacks some features, such as the run command. A .wp-env.json file in your project pins the WordPress version, PHP version, plugins and themes, so everyone on the team gets the same site.
How do I run WordPress with DDEV?
DDEV is an open source, Docker-based environment used by many agencies across WordPress, Drupal and other PHP projects. The latest release on GitHub when we checked was v1.25.5 from 26 October 2026. On macOS its documentation recommends a Docker provider such as OrbStack, Docker Desktop, Rancher Desktop or Colima. The WordPress quickstart is short:
# Checked on 18 Nov 2026 against the DDEV quickstart (DDEV v1.25.5)
mkdir my-wp-site && cd my-wp-site
ddev config --project-type=wordpress
ddev start
ddev wp core download
ddev wp core install --url="$(ddev exec echo '$DDEV_PRIMARY_URL')" --title='My WordPress site' --admin_user=admin --admin_password=admin --admin_email=admin@example.com
ddev launch wp-admin/Your site gets an HTTPS address like https://my-wp-site.ddev.site. The project config lives in a .ddev folder you can commit, so a teammate runs ddev start and gets the same PHP, database and web server versions. If you keep a site in Git, our guide on what to put in a WordPress GitHub repository explains which folders belong there and which do not.
Can I try WordPress without installing anything?
Yes. WordPress Playground runs a full WordPress site inside your browser. Open playground.wordpress.net and you have a working admin in seconds. Nothing is installed, and the site disappears when you clear it, which makes it ideal for testing a plugin or showing someone a feature.
The same engine runs from the command line through the Playground CLI, which replaced the older wp-now package. The npm package @wp-playground/cli was at 3.1.65 on 16 November 2026 and needs Node.js 20.18 or newer.
# Checked on 18 Nov 2026 (@wp-playground/cli 3.1.65, Node.js 20.18+)
cd my-plugin-or-theme
npx @wp-playground/cli@latest start
# Opens http://localhost:9400; the site persists between runs
# Pick versions explicitly
npx @wp-playground/cli@latest start --wp=7.1 --php=8.3By default the CLI loads the latest stable WordPress with PHP 8.3, detects whether the folder is a plugin, theme or full site, and keeps the site in ~/.wordpress-playground/sites/.
Which PHP and database versions should my local site use?
Match your live host first, then the WordPress recommendation. On 18 November 2026 the WordPress requirements page recommended PHP 8.3 or greater, MySQL 8.4 or MariaDB 10.11 or greater, and HTTPS support. The WordPress update API listed PHP 7.4 and MySQL 5.5.5 as the minimums for 7.1.4, but nobody should start a new site on those.
Testing locally on a newer PHP than your host is a good way to get ahead of an upgrade, as long as you know which one you are testing. Our guide to checking what a PHP upgrade will break shows how to use a local copy for exactly that. Studio, Local, wp-env, DDEV and Playground all let you set the PHP version per site; XAMPP ties it to the build you installed.
What should I do after WordPress is installed locally?
A fresh local install is a blank slate. These steps make it useful:
- Turn on debugging. Add
WP_DEBUGandWP_DEBUG_LOGtowp-config.phpso warnings land in a log file instead of hiding. If the log never appears, our post on why debug.log is not created walks through the causes. - Set permalinks. Go to Settings, then Permalinks, and pick “Post name” so your local URLs look like the live site.
- Do not expect email. Local servers rarely send real mail. Local and DDEV include a mail catcher; elsewhere, use an SMTP or mail-logging plugin while testing.
- Add realistic content. Import a copy of your live site, or the WordPress theme unit test data, so you test against real pages.
- Install the plugins you will use live. Configure them here first.
For an SEO plugin to practise with, Rank Math has a free version on WordPress.org:
Try Rank Math SEO (affiliate link).
Before a big plugin change, measure how heavy your plugin list is; our Query Monitor tutorial shows how to see which plugin costs the most on each page, and a local site is the safest place to run it.
How do I move a local WordPress site to live hosting?
Moving a site has two halves: files and database. The files (mainly wp-content) are copied as they are. The database holds the old local address in many places, including inside serialized PHP data, so you must replace URLs with a tool that understands serialization. A plain SQL find and replace breaks serialized values.
# Checked on 18 Nov 2026 (WP-CLI 2.12.0). Back up the database first.
# Preview first: nothing is written with --dry-run
wp search-replace 'https://mysite.local' 'https://example.com' --skip-columns=guid --dry-run
# Run it for real
wp search-replace 'https://mysite.local' 'https://example.com' --skip-columns=guid
# If you developed under a folder on XAMPP, replace that form too
wp search-replace 'http://localhost/mysite' 'https://example.com' --skip-columns=guid --dry-runThe --skip-columns=guid flag leaves post GUIDs alone, because a GUID is meant to stay fixed once a post has been published to feed readers; on a brand-new site moving live for the first time it does no harm either way. The search-replace reference lists every option, and the handbook page on migrating WordPress covers the manual route. Migration plugins such as Duplicator, All-in-One WP Migration and WP Migrate do the same replacement for you; Studio can publish straight to WordPress.com or Pressable, and Local can push to WP Engine and Flywheel.
After the move, check Settings, then General, for the right WordPress Address and Site Address, re-save permalinks, and click through menus and image-heavy pages for any leftover local links.
Common mistakes people report
These come up again and again in support forums and issue trackers. We paraphrase each one and link the source. Checked on 18 November 2026.
- Apache in XAMPP will not start because port 80 is taken. A widely viewed Stack Overflow question shows the XAMPP log saying port 80 is in use by PID 4. Answers trace it to Skype or the Windows web publishing service (IIS) holding the port; the fixes are to stop that program or move Apache to another port in
httpd.conf. (Stack Overflow, 2013, still active) - A new Local site will not open on Windows. In a March 2026 thread, Local reported that it could not update the hosts file and browsers showed connection errors. Suggestions were to switch Router Mode under Preferences, try another browser, check security software and do a clean reinstall. (Local community forum)
- Going live without a search and replace. A user pushed a Local site to a live server and found local file paths and
.localURLs still in the database, which blocked a security plugin from installing. The reply pointed towp search-replacewith the old and new domains, or the Better Search Replace plugin. (Local community forum, May 2025) - Images and links still pointing at localhost after a move. A site built on XAMPP with “localhost” as its address was moved live, and images still loaded from localhost while the admin was unreachable. The thread points to changing the site addresses and following the official moving guide. (WordPress.org support thread)
- Changing the wp-env port and breaking the site URL. An issue opened on 16 November 2026 reports that combining
WP_ENV_PORTwith the auto-port option can fail to start or leave the site URL pointing at the wrong port. It was still open when we checked, so set one fixed port per project. (Gutenberg GitHub issue 86904)
Frequently asked questions
Is it free to install WordPress on localhost?
Yes. WordPress, Studio, Local, XAMPP, wp-env, DDEV and Playground are all free to download and use. Some Docker providers used with wp-env or DDEV, such as Docker Desktop or OrbStack, need a paid licence for some business use, which is why free options like Colima and Rancher Desktop exist.
Do I need internet access to run a local WordPress site?
Only to download the tools, WordPress itself, themes and plugins. After that the site runs offline. Some plugins call remote services and will show errors when offline, which is normal.
Can other people see my localhost site?
No, not by default. Local’s Live Links, Studio’s preview sites and tunnels in other tools can share a temporary public URL when you need client feedback.
Which is better for beginners, Local or WordPress Studio?
Both are fine. Studio is lighter because it uses SQLite and needs no database server; Local runs a full MySQL or MariaDB stack, which behaves more like most web hosts. If a plugin you rely on is picky about MySQL, choose Local.
Can I run several local sites at once?
Yes. Studio and Local manage many sites from one window. wp-env, DDEV and the Playground CLI each run per project folder, so use different ports or names for each.
Why does WordPress ask for FTP details when I install a plugin locally?
WordPress could not write to its own folders, usually because of file ownership on macOS or Linux. Fixing the folder permissions for your local web server user solves it; desktop apps like Studio and Local set this up for you.
Plugins we build and run
We maintain these ourselves, which is why we can support them on your site.
- BuddyNextThe self-hosted community engine for WordPress
- BuddyXFree community theme, Pro when you outgrow it
- ReignPremium community theme. Add pieces, build anything
- JetonomyCommunity forum and Q&A for WordPress
- EventonomyEvents and RSVPs for WordPress communities
- LearnomyCourses and learning communities on WordPress
- ListoraDirectories and listings your members can browse
- SnipShareCode sharing built for developer communities
- WB Ad ManagerAd placements that turn traffic into revenue
- WP Career BoardA job board your community actually uses
- WP Sell ServicesSell services with offers, orders, and payouts
- MediaVersePhotos, video, and media albums for members
- WB GamificationPoints, badges, and rewards that keep members active
- Product RoadmapPublic roadmaps with voting your users trust
Related Posts

LiteSpeed Cache Vulnerability CVE-2026-93389: Check Your Version and What Was Exposed

Freemius SDK Stored XSS: How to Find Every Bundled Copy on a Client Site (Anything Under 2.13.5)
