wordpress · beginner guide · interactive
How to install WordPress locally
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.
- 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?
| method | best for | works on | setup time |
|---|---|---|---|
| Local | Most beginners, client sites | Windows, Mac, Linux | About 2 minutes |
| WordPress Studio | A light, simple app | Windows, Mac | About 2 minutes |
| XAMPP | Learning how it all works | Windows, Mac, Linux | 15 to 20 minutes |
| Playground | A quick try, nothing to install | Any browser | Instant |
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.
What’s your site’s name?
Local site domain: mysite.local
ContinueChoose your environment
Set up WordPress
Add siteAdding site…
Provisioning web server, PHP and database
mysite running
- Site domain
- mysite.local
- One-click admin
- Download and install Local from localwp.com and pick your operating system. Run the installer with the default options.
- Create a site. Click the + button at the bottom left and choose Create a new site.
- Name it, for example
mysite. Local will serve it athttp://mysite.local. - Choose the environment. Keep Preferred unless you need a particular PHP or database version to match your host.
- Set your login. Enter a WordPress username, password and email. This is your admin login.
- 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.
- Download Studio for Windows or Mac and install it.
- Click Add site, give it a name, and confirm.
- 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.
- [main] Control Panel Ready
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:
Create database
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.
- dashboard
- img
- webalizer
- xampp
- mysite
- 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:
- Deutsch
- English (United States)
- Español
- Français
- हिन्दी
Before getting started, you will need to know:
- Database name
- Database username
- Database password
- Database host
- Table prefix
WordPress can now communicate with your database.
Run the installationSuccess!
WordPress has been installed.
Log InDashboard
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:
- Install a migration plugin such as All-in-One WP Migration or Duplicator on your local site and export it.
- Install WordPress on your host, add the same plugin, and import the file.
- 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
- Pick a theme under Appearance → Themes.
- Set a clean URL structure under Settings → Permalinks (Post name is a good default).
- Add your photo to your user profile: see how to change your WordPress profile picture without plugins or Gravatar.
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.