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.

Share this post
8 min read

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.

Keep it local. These settings are for a site on your own computer. A live site needs a strong database password and its own keys.

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?

PartRecommended versionWhat it does
PHP8.3 or greaterRuns the WordPress code
DatabaseMariaDB 10.11+ or MySQL 8.4+Stores posts and settings
Web serverApache or NginxSends pages to your browser
WordPress filesLatest releaseThe 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?

ToolBest forNeeds
WordPress StudioBeginners, quick sitesJust the app
XAMPPLearning how the parts fitSome manual setup
wp-envPlugin and theme developersNode.js and Docker
WordPress PlaygroundA quick test in the browserNothing 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.

4 waysDigieh tested guide: Studio, XAMPP, wp-env and Playground.

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.

  1. Download WordPress Studio from its official page and install it.
  2. Open the app and choose to add a new site.
  3. Give the site a name and let Studio create it.
  4. Open the site in your browser, or open the admin area from the app.
  5. 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

  1. Download XAMPP for your system from the Apache Friends site.
  2. Install it in the default folder.
  3. Open the XAMPP Control Panel.
  4. Click Start next to Apache and next to MySQL.

Step 2: Create a database

  1. Open http://localhost/phpmyadmin in your browser.
  2. Click Databases.
  3. Type a name such as wordpress_local and click Create.

Step 3: Add the WordPress files

  1. Download WordPress from wordpress.org.
  2. Unzip it into the htdocs folder inside XAMPP.
  3. Rename the folder to your site name, such as mysite.

Step 4: Run the installer

  1. Open http://localhost/mysite in your browser.
  2. Pick your language.
  3. Enter the database name, the user root and an empty password.
  4. Leave the database host as localhost.
  5. 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.

Try this today. Use a different admin password from your live site. A local site is for testing, so keep real passwords out of it.

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.

  1. Install Node.js and a Docker runtime such as Docker Desktop.
  2. Run npm -g install @wordpress/env in a terminal.
  3. Go to your plugin or theme folder and run wp-env start.
  4. Open http://localhost:8888 in 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?

ProblemLikely causeFix
Apache will not startAnother app uses port 80Stop that app or change the port
Port 80 blocked on WindowsMicrosoft Internet Information Services is runningStop the World Wide Web Publishing Service
Database connection errorWrong name, user or passwordCheck wp-config.php values
Page not foundWrong folder name in the addressMatch 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.

  1. Make a full backup of the local site.
  2. Create a new database on your host.
  3. Upload the files and import the database.
  4. 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?

  1. admin
  2. root
  3. 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?

  1. localhost:8888
  2. localhost:3000
  3. 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

Found this useful?

Share this post
Avatar photo

Syed Wasif Raza

Syed Wasif Raza is the founder and editor of Digieh. He writes about health, food, lifestyle, news and sports in plain, easy English. Every guide he publishes is checked against official sources such as government and health agency pages. Connect with him on LinkedIn.

Articles: 1070

Leave a Reply

Your email address will not be published. Required fields are marked *