Every price is read from the vendor’s own pricing pagesee the comparisons
intechverse

wordpress · beginner guide · interactive

How to install WordPress locally

By Amardeep Pawar. First published 17 May 2020. Rewritten and checked 13 November 2026.

Installing WordPress locally means running a full WordPress site on your own computer, free, private and offline. It is the safest way to learn WordPress, test themes and plugins, or build a site before you pay for hosting. This guide shows four free ways to do it on Windows and Mac, and every screen below is interactive: press play, or click the buttons yourself.

The short answer

Download Local (free, Windows, Mac and Linux), click Create a new site, choose a name and a username, and open WP Admin. Your site is ready in about two minutes. Use XAMPP instead if you want to learn how the web server and database fit together.

What installing WordPress locally means

WordPress is a PHP application that stores its content in a MySQL (or MariaDB) database, and it needs a web server to run. On a live website your host provides all three. On your computer, a tool provides them instead and serves the site at a private address such as http://localhost or http://mysite.local.

web serverApache or nginx answers the browser
phpruns the WordPress code
databaseMySQL or MariaDB stores posts and settings
wordpressyour site, at localhost
  • Learn without risk. Break things, reset, and try again without anyone seeing.
  • Test before you change a live site. Try a new theme, plugin or WordPress update on a copy first.
  • Work offline and fast. No upload waits, no hosting bill.
  • Stay private. Only you can open a local site.

Which method should you pick?

methodbest forworks onsetup time
LocalMost beginners, client sitesWindows, Mac, LinuxAbout 2 minutes
WordPress StudioA light, simple appWindows, MacAbout 2 minutes
XAMPPLearning how it all worksWindows, Mac, Linux15 to 20 minutes
PlaygroundA quick try, nothing to installAny browserInstant

All four are free. If you are unsure, start with Local; you can always try XAMPP later.

Method 1: install WordPress locally with Local (easiest)

Local is a free app that sets up the web server, PHP and database for you. Each site gets its own address and can be started, stopped or deleted with one click. Watch the whole setup below, or step through it at your own pace.

Local
Create a new siteStart a fresh WordPress site
Create from a blueprintReuse a saved site setup
Continue

  1. Download and install Local from localwp.com and pick your operating system. Run the installer with the default options.
  2. Create a site. Click the + button at the bottom left and choose Create a new site.
  3. Name it, for example mysite. Local will serve it at http://mysite.local.
  4. Choose the environment. Keep Preferred unless you need a particular PHP or database version to match your host.
  5. Set your login. Enter a WordPress username, password and email. This is your admin login.
  6. Open the dashboard. Click Add site, wait for it to finish, then click WP Admin.

Tip. Turn on One-click admin in the site’s overview so Local logs you in without asking for the password every time.

Method 2: install WordPress locally with WordPress Studio

WordPress Studio is a free desktop app from the team behind WordPress.com. It needs no separate web server or database, so it is very light.

  1. Download Studio for Windows or Mac and install it.
  2. Click Add site, give it a name, and confirm.
  3. Click WP Admin to open the dashboard, or Open site to see the front end.

Studio is ideal for learning and building themes. For sites that need a specific server setup, Local or XAMPP give you more control.

Method 3: install WordPress locally with XAMPP (step by step)

XAMPP bundles the Apache web server, PHP and a MariaDB database. You set WordPress up yourself, which takes longer but teaches you exactly how a WordPress site is built. The steps are for Windows; on Mac and Linux they are the same apart from the folder paths.

1 Install XAMPP

Download XAMPP from apachefriends.org and run the installer. Install it to C:\xampp, not to C:\Program Files, because Windows permissions there can stop XAMPP from working. Apache, MySQL, PHP and phpMyAdmin are the only components you need, so you can untick the rest.

2 Start Apache and MySQL

Open the XAMPP Control Panel and click Start next to Apache and MySQL. When a module is running its name turns green and its ports appear. If Windows Firewall asks, allow access on private networks. Try it below.

XAMPP Control Panel
XAMPP Control Panel
modulepidport(s)actions
Apache Admin
MySQL Admin
FileZilla StartAdmin
Mercury StartAdmin
Tomcat StartAdmin
  1. [main] Control Panel Ready
Click Start on Apache and MySQL.

3 Create a database

Open http://localhost/phpmyadmin in your browser, go to the Databases tab, type a name such as wordpress and click Create. Try it here:

localhost/phpmyadmin
DatabasesSQLStatusUser accounts

Create database

utf8mb4_general_ci

4 Add the WordPress files

Download the latest WordPress zip from wordpress.org/download. Unzip it, rename the wordpress folder to your site name, for example mysite, and move it into C:\xampp\htdocs. That folder name becomes the address: http://localhost/mysite.

C:\xampp\htdocs
  • dashboard
  • img
  • webalizer
  • xampp
  • applications.html
  • bitnami.css
  • favicon.ico
  • index.php

5 Run the WordPress installer

Go to http://localhost/mysite. WordPress walks you through a short setup: pick a language, enter the database details, then create your admin account. Play the whole thing:

localhost/mysite/wp-admin/setup-config.php
  • Deutsch
  • English (United States)
  • Español
  • Français
  • हिन्दी
Continue

The database settings for a fresh XAMPP install, ready to copy:

Database name:   wordpress
Username:        root
Password:        (leave empty)
Database host:   localhost
Table prefix:    wp_

Keep it local. The root user with no password is fine on your own computer, but never use these settings on a live server.

6 Log in any time

Your dashboard is at http://localhost/mysite/wp-admin. Each time you restart your computer, open the XAMPP Control Panel and start Apache and MySQL again before visiting the site.

Method 4: try WordPress in your browser with Playground

If you only want to look around, open playground.wordpress.net. It runs a complete WordPress site inside your browser tab with nothing to install. It is perfect for a quick test, but treat it as temporary: export your work before closing the tab if you want to keep it.

Fix common localhost errors

Apache will not start: port 80 or 443 is in use

Another program, often IIS, Skype or the World Wide Web Publishing Service, is using the port. Stop that program, or in XAMPP click Config → Apache (httpd.conf), change Listen 80 to Listen 8080, restart Apache and open http://localhost:8080/mysite.

MySQL will not start

Usually another MySQL install is already using port 3306. Stop that service in Windows Services, or change the port in my.ini and use localhost:3307 as the database host.

“Error establishing a database connection”

Check that MySQL is running and that the database name, user and password in wp-config.php match what you created in phpMyAdmin.

“The uploaded file exceeds the upload_max_filesize directive”

Open C:\xampp\php\php.ini, raise upload_max_filesize and post_max_size (for example to 128M), save, and restart Apache.

Pages show a 404 after changing permalinks

Go to Settings → Permalinks and click Save Changes once to rebuild the rules.

Move your local site online

When the site is ready, you need hosting and a domain. To copy everything across:

  1. Install a migration plugin such as All-in-One WP Migration or Duplicator on your local site and export it.
  2. Install WordPress on your host, add the same plugin, and import the file.
  3. Check that the site address under Settings → General is your real domain, untick “discourage search engines”, then save your permalinks again.

If you use Local and your host is WP Engine or Flywheel, Local can push the site directly.

What to do after installing

Frequently asked questions

Is it free to install WordPress locally?

Yes. WordPress, Local, WordPress Studio, XAMPP and WordPress Playground are all free. You do not need hosting or a domain name until you want the site to be public.

Can I install WordPress locally without XAMPP?

Yes. Local and WordPress Studio install everything WordPress needs for you, and WordPress Playground runs in your browser with nothing to install. XAMPP is only needed if you want to set up the web server and database yourself.

Do I need internet to run WordPress locally?

You need it once to download the tools. After that a local site runs offline, although installing new themes or plugins from the WordPress directory still needs a connection.

Can other people see my local WordPress site?

No. A local site lives on your computer at an address like localhost or mysite.local, so only you can open it. Local can create a temporary share link if you want to show someone.

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

Export it with a migration plugin such as All-in-One WP Migration or Duplicator and import it on your host, or use the push feature in Local if your host supports it. Update the site URL if the plugin does not do it for you.

What is the localhost WordPress login URL?

Add /wp-admin/ to your local site address, for example http://localhost/mysite/wp-admin/ on XAMPP or http://mysite.local/wp-admin/ on Local. Log in with the username and password you chose during setup.