Here’s a complete blog post ready to publish:
How to Set Up WordPress Locally: XAMPP vs Local by Flywheel
If you want to build or test a WordPress site without buying hosting, running it locally on your computer is the way to go. Two of the most popular tools for this are XAMPP and Local by Flywheel. One is quick and beginner-friendly, the other gives you more control and is worth learning properly.
This guide covers both.
Why Run WordPress Locally?
Before jumping in — why bother? Simple reasons:
- You can build and test without breaking a live site
- No hosting cost while developing
- Works completely offline
- Much faster iteration when designing or debugging
Now let’s get into it.
Method 1: Local by Flywheel (Easy — Recommended)
Local is a dedicated WordPress development tool. It handles everything — the server, the database, PHP — behind a clean UI. You don’t touch any config files.
Step 1: Download and Install Local
Go to localwp.com and download the free version for your OS (Windows, Mac, or Linux). Install it like any normal app.
Step 2: Create a New Site
Open Local and click the + button at the bottom left. You’ll be asked to:
- Enter a site name — this also becomes your local URL, like
mysite.local - Choose Preferred environment (recommended for beginners) or Custom if you want to pick your PHP version, web server (Nginx or Apache), and MySQL version manually
Click Continue.
Step 3: Set WordPress Credentials
Local will ask for:
- WordPress username
- Password
- Email (can be anything, it’s local)
Click Add Site. Local will set everything up automatically — server, database, WordPress install. Takes about 30 seconds.
Step 4: Open Your Site
Once done, you’ll see two buttons:
- Open Site — opens your site in the browser at
mysite.local - WP Admin — takes you straight to the WordPress dashboard
That’s it. You’re running WordPress locally. No terminal, no config files touched.
Bonus: One-Click Admin Login
Local has an Open WP Admin button that logs you in automatically without typing credentials every time. Small thing, saves you daily frustration.
Method 2: XAMPP (A Bit More Work, Worth Knowing)
XAMPP is not WordPress-specific. It’s a local server stack — Apache + MySQL + PHP — that you configure yourself. More steps, but you actually understand what’s happening under the hood. That knowledge pays off when you work on real servers later.
Step 1: Download and Install XAMPP
Go to apachefriends.org and download XAMPP for your OS. During installation, make sure Apache and MySQL are checked. PHP is included automatically.
Default install path is C:\xampp on Windows.
Step 2: Start Apache and MySQL
Open XAMPP Control Panel and click Start next to both:
- Apache — this is your web server
- MySQL — this is your database
Both should turn green. If Apache fails to start, something else is using port 80 (often Skype or IIS). You can change Apache’s port in httpd.conf or just close the conflicting app.
Step 3: Download WordPress
Go to wordpress.org/download and download the latest .zip file. Extract it and copy the wordpress folder into:
C:\xampp\htdocs\
Rename the folder to whatever you want your site called, for example mysite. So the path becomes:
C:\xampp\htdocs\mysite
Step 4: Create a Database
Open your browser and go to:
http://localhost/phpmyadmin
Click New in the left sidebar. Give your database a name — something like mysite_db. Set collation to utf8_general_ci and click Create.
Step 5: Run the WordPress Installer
In your browser go to:
http://localhost/mysite
WordPress will start the setup wizard. It will ask for:
- Database Name —
mysite_db(what you just created) - Username —
root - Password — leave it blank (XAMPP default)
- Database Host —
localhost - Table Prefix — leave as
wp_unless you want to change it
Click Submit, then Run the Installation. Fill in your site title, admin username, password, and email. Click Install WordPress.
Done. Go to http://localhost/mysite/wp-admin to access your dashboard.
XAMPP vs Local: Which Should You Use?
| Local by Flywheel | XAMPP | |
|---|---|---|
| Setup time | ~2 minutes | ~10 minutes |
| Technical knowledge needed | None | Basic |
| WordPress-specific | Yes | No |
| Multiple PHP versions | Yes (per site) | One global version |
| SSL on local | Built-in | Manual setup |
| What you learn | WordPress workflow | How servers actually work |
| Best for | Client projects, fast setup | Learning, non-WordPress projects too |
Short answer: Start with Local if you just want to build sites fast. Learn XAMPP too if you want to understand what Apache, MySQL, and PHP actually do — that knowledge directly transfers to managing real hosting servers, fixing database errors, and understanding php.ini and .htaccess.
Common Issues and Fixes
XAMPP Apache won’t start Port 80 is in use. Open XAMPP’s httpd.conf, find Listen 80 and change it to Listen 8080. Then access your site at http://localhost:8080/mysite.
WordPress can’t connect to database on XAMPP Double-check wp-config.php — the database name, username (root), and password (empty by default) must match exactly.
Local site not loading in browser Try restarting Local completely, then click Start Site again. If it still fails, check if another app is using the same port under Local’s site settings.
Forgot WordPress admin password on Local Click Open Site Shell in Local and run:
bash
wp user update admin --user_pass=newpassword
Final Thoughts
Both tools do the job. Local is faster to get started and better for pure WordPress work. XAMPP is worth setting up at least once because understanding the server stack behind WordPress makes you a better developer — you stop treating things like a black box.
Once you’re comfortable with local development, your workflow changes completely. You build locally, test everything, then push to live. No more editing files directly on production and hoping nothing breaks.
Have questions about setting up your WordPress development environment? Drop them in the comments.