Type something to search...
How to install WordPress locally on Windows and macOS?

How to install WordPress locally on Windows and macOS?

The easiest way to install WordPress locally on Windows or macOS is to use a free desktop app such as Local (by WP Engine) or WordPress Studio (by Automattic), which set up the web server, PHP, database, and WordPress for you in a couple of minutes. If you prefer a traditional stack, XAMPP works on both systems and MAMP is popular on macOS, and developers can use Docker-based tools like wp-env or DDEV. In every case, the result is a fully working WordPress site that runs on your own computer without an internet connection or hosting account.

A local installation is ideal for learning WordPress, building themes and plugins, and testing changes before they touch a live site. This guide explains what a local environment is, compares the main tools, and walks you through installing WordPress with each one on Windows and macOS. You'll also learn how to move a local site to live hosting when you're ready.

What Does Installing WordPress Locally Mean?

WordPress needs three things to run: a web server (usually Apache or Nginx), PHP, and a MySQL or MariaDB database. When you install WordPress on hosting, your host provides these. When you install it locally, you run them on your own laptop or desktop instead.

Your local site is usually available at an address like http://localhost:8080 or a friendly domain such as http://mysite.local. Only you can see it, and nothing you do affects any live website.

Why Install WordPress Locally?

There are plenty of good reasons to keep a local WordPress install around:

  • It's free: You don't need to pay for hosting or a domain to learn and experiment.
  • It's fast: Pages load from your own disk, so there's no network delay when you save and refresh.
  • It works offline: You can build on a plane or anywhere without Wi-Fi.
  • It's safe: Breaking something locally only affects you, which makes it the perfect place to try new plugins, PHP versions, or custom code.
  • It fits a proper workflow: Most developers build locally, test on staging, then deploy to production.

Choosing a Local Development Tool

Here's a quick overview of the most common options in 2026:

  • Local (by WP Engine): A free app for Windows, macOS, and Linux. It creates sites with one click, lets you choose PHP versions and web servers, and includes tools like Mailpit for catching emails, SSL for local domains, and one-click admin login. Best for most users.
  • WordPress Studio (by Automattic): A free, lightweight app for Windows and macOS that runs WordPress using WordPress Playground technology, without needing a separate database server. Very quick to set up and good for beginners and theme builders.
  • XAMPP: A free, cross-platform package that bundles Apache, MariaDB, and PHP. It's more manual but teaches you how the stack works.
  • MAMP: A macOS (and Windows) package similar to XAMPP, with a free version and a paid Pro version.
  • Docker-based tools: @wordpress/env (wp-env), DDEV, and Lando use containers to create reproducible environments. Ideal for developers and teams.

If you're not sure, start with Local or Studio. You can always switch later.

Method 1: Install WordPress with Local

Local works almost identically on Windows and macOS.

  1. Download Local: Visit the official Local website, choose your operating system, and download the installer. You may be asked for basic details, but the app is free.

  2. Install the app: On Windows, run the .exe installer and follow the prompts. On macOS, open the .dmg file and drag Local into your Applications folder. The first time you open it on macOS, you may need to confirm that you trust the app.

  3. Create a new site: Open Local and click the + button (or Create a new site). Choose Create a new site and click Continue.

  4. Name your site: Enter a name such as "My Test Site." Local generates a local domain like my-test-site.local. Click Continue.

  5. Pick an environment: Choose Preferred for sensible defaults, or Custom to select a specific PHP version, web server (Nginx or Apache), and MySQL version. Matching your live host's PHP version is a good habit.

  6. Set up WordPress credentials: Enter an admin username, password, and email. These are only used locally, but it's still good practice to avoid "admin" as the username.

  7. Finish: Click Add Site. Local may ask for your system password so it can update your hosts file for the local domain.

  8. Open your site: Click Open site to view the front end or WP Admin to go to the dashboard. The One-click admin option lets you skip the login screen.

Local also includes useful extras: Trust to enable HTTPS for your local domain, Database to open Adminer, Open site shell for WP-CLI, and Live Links to share a temporary public URL with someone else.

Method 2: Install WordPress with WordPress Studio

Studio is the newest option and one of the lightest.

  1. Download Studio: Get the installer for Windows or macOS from the official WordPress.com developer site.

  2. Install and open it: Run the installer and launch the app. No extra software, such as a database server, is required.

  3. Add a site: Click Add site, give it a name, and optionally choose a local folder where the files should live.

  4. Start the site: Studio creates the site and starts it. You'll see buttons to open WP Admin and the front end.

  5. Edit your files: Studio shows the site's folder path. Open it in your code editor to work on themes and plugins.

Studio uses SQLite rather than MySQL behind the scenes via the SQLite Database Integration plugin, which is part of what makes it so light. That's fine for most theme and content work, but if you need to match a MySQL production environment exactly, Local or Docker may suit you better.

Method 3: Install WordPress with XAMPP (Windows and macOS)

XAMPP takes a few more steps, but it's a great way to understand how WordPress really runs.

Step 1: Install XAMPP

Download XAMPP from Apache Friends. Pick a version that includes PHP 8.1 or newer. On Windows, run the installer and keep the default components (Apache, MySQL, PHP, phpMyAdmin). Installing to C:\xampp avoids permission issues with Program Files. On macOS, open the installer and follow the prompts; it installs to /Applications/XAMPP.

Step 2: Start Apache and MySQL

Open the XAMPP Control Panel (on macOS, the manager app under Manage Servers) and start Apache and MySQL. Visit http://localhost in your browser; you should see the XAMPP welcome page.

If Apache won't start on Windows, another program is probably using port 80 or 443. Close it, or change Apache's port in httpd.conf (for example to 8080) and visit http://localhost:8080.

Step 3: Create a Database

Go to http://localhost/phpmyadmin, click Databases, enter a name such as wordpress_local, choose utf8mb4_unicode_ci as the collation, and click Create. You can also do this with SQL:

CREATE DATABASE wordpress_local CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

XAMPP's default database user is root with an empty password. That's acceptable only because the site is local.

Step 4: Download WordPress

Download the latest WordPress zip from WordPress.org and extract it. Move the wordpress folder into XAMPP's web root:

  • Windows: C:\xampp\htdocs\
  • macOS: /Applications/XAMPP/htdocs/ (or xamppfiles/htdocs)

Rename the folder to something like mysite.

Step 5: Run the WordPress Installer

Visit http://localhost/mysite. WordPress will launch its setup wizard:

  1. Choose a language: Select your language and click Continue.

  2. Enter database details: Use wordpress_local as the database name, root as the username, leave the password blank, keep localhost as the host, and keep the wp_ table prefix or change it.

  3. Run the installation: Click Submit, then Run the installation.

  4. Create your admin account: Enter your site title, username, password, and email, then click Install WordPress.

  5. Log in: Visit http://localhost/mysite/wp-admin and sign in.

If WordPress can't write wp-config.php on its own, copy wp-config-sample.php to wp-config.php and fill in the database details yourself:

define( 'DB_NAME', 'wordpress_local' );
define( 'DB_USER', 'root' );
define( 'DB_PASSWORD', '' );
define( 'DB_HOST', 'localhost' );

Method 4: Install WordPress with MAMP on macOS

MAMP follows the same idea as XAMPP with a Mac-friendly interface.

  1. Install MAMP: Download it from the official MAMP website and install the free version. It appears in /Applications/MAMP.

  2. Start the servers: Open MAMP and click Start. MAMP's defaults use port 8888 for Apache and 8889 for MySQL, so your sites are available at http://localhost:8888.

  3. Create a database: Open the WebStart page, go to Tools > phpMyAdmin, and create a database. MAMP's default MySQL username and password are both root.

  4. Add WordPress files: Extract WordPress into /Applications/MAMP/htdocs/mysite.

  5. Install WordPress: Visit http://localhost:8888/mysite, enter the database name, root for both username and password, and localhost as the host (or localhost:8889 if the connection fails), then complete the setup.

Method 5: Install WordPress with Docker and wp-env

Developers who want a reproducible, per-project setup often use wp-env, the official tool from the WordPress core team. You need Docker Desktop and Node.js installed.

  • Install wp-env globally:
npm install -g @wordpress/env
  • Create a project folder and start WordPress:
mkdir my-project && cd my-project
wp-env start

By default, this starts WordPress at http://localhost:8888 with the username admin and password password.

  • Configure it with a file: Add a .wp-env.json file to the folder to control the PHP version, plugins, and themes that load:
{
  "core": null,
  "phpVersion": "8.3",
  "plugins": ["."],
  "themes": []
}

Setting "plugins": ["."] mounts the current folder as a plugin, which is perfect when you're developing one. Run wp-env stop to shut it down and wp-env destroy to remove the environment completely. You can run WP-CLI commands inside it with wp-env run cli wp plugin list.

DDEV and Lando offer similar container-based workflows with more options for matching complex production servers.

Tips for Working with a Local WordPress Site

Turn on debugging: Local sites are the place to see every warning. Add these lines to wp-config.php above /* That's all, stop editing! */:

define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', true );
define( 'WP_ENVIRONMENT_TYPE', 'local' );

Match your live PHP version: Testing on PHP 8.3 locally while your host runs 8.1 can hide compatibility issues.

Catch outgoing email: Local includes Mailpit, which captures every email WordPress sends so you can read it without it going anywhere. For XAMPP or MAMP, plugins such as WP Mail Logging let you inspect messages.

Use version control: Put your theme or plugin folder under Git so you can track changes and deploy them cleanly.

Keep permalinks working: If pretty permalinks return 404 errors on XAMPP or MAMP, make sure Apache's mod_rewrite is enabled and that AllowOverride All is set for your htdocs directory.

How to Move a Local Site to Live Hosting

Once your site is ready, you'll want to publish it. The common approaches are:

  • Local's built-in connect feature: Local can push sites directly to WP Engine and Flywheel hosting.
  • Studio sync: Studio can sync with sites hosted on WordPress.com and Pressable.
  • Migration plugins: Duplicator, All-in-One WP Migration, and similar plugins package your local site so you can import it on the live server.
  • Manual migration: Upload your files via SFTP, export and import the database, update wp-config.php, and run a URL search-replace.

For the manual route, WP-CLI's search-replace command safely updates your local URL to your real domain, including serialized data:

wp search-replace 'http://mysite.local' 'https://example.com' --skip-columns=guid

Always test the live site thoroughly after migrating, and re-save your permalinks under Settings > Permalinks.


FAQ: Installing WordPress Locally

Yes. WordPress itself is free, and tools like Local, WordPress Studio, XAMPP, the free version of MAMP, and wp-env cost nothing to use on your own computer.

For most people, Local or WordPress Studio is the best choice because they handle the server setup automatically. Developers who want reproducible environments often prefer Docker-based tools like wp-env or DDEV.

No. A local site runs only on your computer. If you need to show it to someone, tools like Local's Live Links can create a temporary public URL.

You only need the internet to download the tools, WordPress, and any themes or plugins. After that, your local site works fully offline.

This is usually a port conflict, where another program is already using port 80, 443, or 3306. Close the conflicting program or change the ports in XAMPP's configuration files.

Yes. Local and Studio let you create as many sites as you like, and with XAMPP or MAMP you can create separate folders and databases for each site.

  • Built-in sync: Use Local's or Studio's hosting integrations if your host is supported.
  • Plugins: Use a migration plugin such as Duplicator or All-in-One WP Migration.
  • Manual: Upload files, import the database, and run a URL search-replace.

Conclusion

Installing WordPress locally is one of the best things you can do as a WordPress user or developer. Tools like Local and WordPress Studio get you up and running in minutes on both Windows and macOS, while XAMPP and MAMP give you a closer look at the underlying stack, and Docker-based tools like wp-env bring consistency to team projects.

Pick the tool that fits your comfort level, match your local PHP version to your host, and use your local site to experiment freely. When you're ready to go live, a migration plugin or a careful manual move will get your work onto real hosting without surprises.

Tags :
Share :

Related Posts

What are the best WordPress security plugins?

What are the best WordPress security plugins?

The best WordPress security plugins for most sites are Wordfence, Sucuri Security, Solid Security, MalCare, All-In-One Security (AIOS), Patchstack, a

Dive Deeper
What is the difference between posts and pages in WordPress?

What is the difference between posts and pages in WordPress?

The main difference between posts and pages in WordPress is that posts are timely, dated entries that appear in your blog feed, archives, and RSS fee

Dive Deeper
How much does it cost to build a WordPress website?

How much does it cost to build a WordPress website?

Building a WordPress website can cost anywhere from roughly the price of a domain and a year of budget hosting, if you do it yourself with free tools

Dive Deeper