How to Install WordPress on Localhost for Free
Install WordPress on localhost for free with WordPress Studio or XAMPP. Step-by-step setup, official requirements, a wp-config builder and common fixes.

Last updated December 5, 2026
To install WordPress on localhost, you need a local server app, a database and the WordPress files. The easiest free way is WordPress Studio, a free app that sets up a site in a few clicks.
If you want the classic way, XAMPP gives you Apache, a database and PHP. This guide shows both, plus a free tool that builds your wp-config.php settings.
Key Takeaways
- WordPress.org recommends PHP 8.3 or greater and MariaDB 10.11 or greater, or MySQL 8.4 or greater.
- WordPress Studio is a free, open source app for Windows, macOS and Linux.
- XAMPP is free, but its own help page says it is not meant for production use.
- On a fresh XAMPP install, the database user is root and it has no password.
- Developers can use wp-env, which runs a site at localhost:8888 with Docker.
Need the database settings for wp-config.php? Use this free builder. It fills in the lines and makes new secret keys.
Digieh local wp-config.php builder
Digieh tool. It makes new random secret keys in your browser each time. Nothing is sent anywhere. Paste the lines into wp-config.php in place of the matching lines. Use it only for a site on your own computer.
What Does Installing WordPress on Localhost Mean?
Localhost means your own computer acts as the web server. The site runs only on your machine, so nobody else can see it.
People use a local site to test themes, plugins and updates without risk. You can also learn WordPress offline and break things safely.
A local site is different from a staging site on your host. If you need a test copy online, read our guide to a WordPress staging site.
What Do You Need to Run WordPress Locally?
| Part | Recommended version | What it does |
|---|---|---|
| PHP | 8.3 or greater | Runs the WordPress code |
| Database | MariaDB 10.11+ or MySQL 8.4+ | Stores posts and settings |
| Web server | Apache or Nginx | Sends pages to your browser |
| WordPress files | Latest release | The software itself |
Source: WordPress.org Requirements, read December 5, 2026.
WordPress still runs on PHP 7.4 and MySQL 5.5.5. The requirements page warns that those versions have reached end of life and can expose a site to security problems.
You do not have to install these parts one by one. A local app bundles them for you.
Which Local Tool Should You Pick?
| Tool | Best for | Needs |
|---|---|---|
| WordPress Studio | Beginners, quick sites | Just the app |
| XAMPP | Learning how the parts fit | Some manual setup |
| wp-env | Plugin and theme developers | Node.js and Docker |
| WordPress Playground | A quick test in the browser | Nothing to install |
Source: WordPress developer docs, local development tools, WordPress Studio and WordPress Playground, read December 5, 2026.
The official WordPress docs also list MAMP, DDEV, Lando, VVV and others. All of them can work. We picked the four that cover most needs.
How Do You Install WordPress With Studio?
WordPress Studio is the fastest free option. Its page says it is free and open source, and it runs on Windows, macOS and Linux.
- Download WordPress Studio from its official page and install it.
- Open the app and choose to add a new site.
- Give the site a name and let Studio create it.
- Open the site in your browser, or open the admin area from the app.
- Start adding themes, plugins and content.
Source: WordPress Studio, read December 5, 2026.
Studio also offers preview sites and sync with a live site. The page says previews need a WordPress.com account and sync needs a paid plan. Plain local sites do not need either.
How Do You Install WordPress With XAMPP?
XAMPP is a free Apache bundle with MariaDB, PHP and Perl. It is a good choice if you want to see each step.
Source: Apache Friends, XAMPP, read December 5, 2026.
Step 1: Install XAMPP and start the servers
- Download XAMPP for your system from the Apache Friends site.
- Install it in the default folder.
- Open the XAMPP Control Panel.
- Click Start next to Apache and next to MySQL.
Step 2: Create a database
- Open
http://localhost/phpmyadminin your browser. - Click Databases.
- Type a name such as
wordpress_localand click Create.
Step 3: Add the WordPress files
- Download WordPress from wordpress.org.
- Unzip it into the
htdocsfolder inside XAMPP. - Rename the folder to your site name, such as
mysite.
Step 4: Run the installer
- Open
http://localhost/mysitein your browser. - Pick your language.
- Enter the database name, the user
rootand an empty password. - Leave the database host as
localhost. - Add a site title, admin user and password, then click Install WordPress.
Source: WordPress developer docs, How to install WordPress and XAMPP help page, read December 5, 2026.
Free updates
Join the Digieh list
Be the first to know when our weekly brief launches.
No spam. Unsubscribe anytime. Read our Privacy Policy.
How Do You Build wp-config.php by Hand?
The installer can write wp-config.php for you. If it cannot, rename wp-config-sample.php to wp-config.php and fill in the database details.
The WordPress docs list four values to set. These are the database name, user, password and host. The file also has a section for secret keys.
Source: WordPress developer docs, How to install WordPress, read December 5, 2026.
Our builder at the top of this page fills in those lines and makes fresh random keys. Copy the result into your file.
How Do You Use wp-env for Development?
wp-env is a free tool from the WordPress community. It suits people who build plugins or themes.
- Install Node.js and a Docker runtime such as Docker Desktop.
- Run
npm -g install @wordpress/envin a terminal. - Go to your plugin or theme folder and run
wp-env start. - Open
http://localhost:8888in your browser.
The docs say the default admin login is admin with the password password. That is fine on your own computer, but never use it online.
Source: Get started with wp-env, read December 5, 2026.
Can You Try WordPress Without Installing Anything?
Yes. WordPress Playground runs WordPress inside your browser. Its page says it runs fully on your side with no backend needed.
It is great for a quick look at a theme or plugin. For a site you want to keep working on, use Studio or XAMPP.
Source: WordPress Playground docs, read December 5, 2026.
What Are Common Localhost Problems?
| Problem | Likely cause | Fix |
|---|---|---|
| Apache will not start | Another app uses port 80 | Stop that app or change the port |
| Port 80 blocked on Windows | Microsoft Internet Information Services is running | Stop the World Wide Web Publishing Service |
| Database connection error | Wrong name, user or password | Check wp-config.php values |
| Page not found | Wrong folder name in the address | Match the folder name in htdocs |
Source: XAMPP Windows help page and WordPress docs, read December 5, 2026.
The XAMPP help page says only one web server can use port 80. It names Skype as one app that can block it.
If you see a database error, our guide to Error Establishing a Database Connection walks through each check.
Is a Local WordPress Site Safe?
A local site is safe for testing because only you can reach it. The XAMPP help page still warns that XAMPP is set up to be as open as possible.
- Never use XAMPP as a public web server.
- Set a database password if other people use your computer.
- Do not copy real customer data into a test site.
- Remove test sites you no longer need.
Source: XAMPP Windows help page, read December 5, 2026.
How Do You Move a Local Site Online Later?
When your local site is ready, you can move it to a host. You need the files and a copy of the database.
- Make a full backup of the local site.
- Create a new database on your host.
- Upload the files and import the database.
- Update the site address and the wp-config.php values.
A backup plugin makes this easier. See our guides on how to back up WordPress for free and connect a domain to hosting.
Which local tool will you try?
- WordPress Studio
- XAMPP
- wp-env
- Playground
- Not sure
Test Yourself
What is the default database user on a fresh XAMPP install?
- admin
- root
- wordpress
The XAMPP help page says the MySQL administrator is root and has no password by default.
Which address does wp-env use by default?
- localhost:8888
- localhost:3000
- localhost:80
The wp-env guide says the site runs at http://localhost:8888.
Frequently Asked Questions
Can I install WordPress on my computer for free?
Yes. WordPress Studio, XAMPP, wp-env and Playground are all free to use.
Do I need the internet to run WordPress locally?
You need it to download the tools and WordPress. After setup, a local site in XAMPP runs on your computer.
What is the database password in XAMPP?
On a fresh install the root user has no password. The XAMPP help page suggests setting one.
Is XAMPP safe for a live website?
No. The XAMPP help page says it is not meant for production use, only for development.
Conclusion
Use WordPress Studio for the quickest free local site, or XAMPP to learn each step. Keep test sites on your own computer and never reuse the default logins online.
Editor’s Note
This guide is accurate as of December 5, 2026. Versions and steps come from WordPress.org, the WordPress developer docs, WordPress Studio and Apache Friends. App screens can change after updates.
Spot an error in this article? Please contact us at support@digieh.com or read our Corrections Policy.
Keep exploring
Your next read is waiting
1AI & TechMicrosoft Store Not Working on Windows 11: Fixes7 min read
2Home & KitchenLG Range Error Codes: Meanings and Reset Steps7 min read
3AI & TechInvalid JSON Response Error in WordPress: 8 Fixes7 min read
4AI & TechClear Cache in Chrome: Visual Steps, Any Device7 min read
5AI & TechNew Zealand Visa Fees 2026: Every Official Cost7 min read
6AI & TechThe Link You Followed Has Expired: WordPress Fix8 min readFound this useful?












