Want to build and test WordPress sites on your own computer before pushing them live? Great — this guide walks you through the entire process from zero to login, with clear, numbered steps and helpful tips. I’ll keep it beginner-friendly and show commands/paths for Windows and macOS where needed.
Why use XAMPP + WordPress locally?
No internet required for development.
Safe place to test themes, plugins, or edits.
Faster iteration — make changes and see them instantly.
Perfect for learning WordPress without breaking a live site.
Windows: C:\xampp\htdocs\ → paste the wordpress folder there
macOS: /Applications/XAMPP/htdocs/ → paste the folder there
(Optional) Rename the folder to your site name, e.g., mywebsite. The folder name becomes the local site URL: http://localhost/mywebsite/
Step 5 — Begin WordPress Installation in Browser
Open your browser and navigate to:
http://localhost/your-folder-name/
Example: http://localhost/mywebsite/
Choose your language and click Continue.
Click Let’s go! when the database setup screen appears.
Step 6 — Enter Database Details
Fill in the fields on the setup page:
Database Name: the name you created in phpMyAdmin (e.g., wordpress_local)
Username: root
Password: (leave blank) — default for XAMPP is an empty password
Database Host: localhost
Table Prefix: wp_ (default — you can change for security)
Click Submit, then Run the installation.
Step 7 — Create Admin Account & Finish Setup
On the next screen fill site/account info:
Site Title: e.g., My Local Site
Username: choose an admin username (avoid admin for security in production)
Password: pick a strong password and note it down
Your Email: enter an email (for local dev this can be anything)
Search Engine Visibility: irrelevant on localhost, leave default
Click Install WordPress. When it finishes, click Log In to access your site dashboard.
Step 8 — Access WordPress Dashboard
Visit:
http://localhost/your-folder-name/wp-admin/
Log in with the admin username and password you created. You’re now inside the WordPress Dashboard — build pages, install themes, add plugins, and experiment freely.
Troubleshooting (common issues)
Apache won’t start / port 80 in use
Skype, IIS, or another program may use port 80. Stop that program or change Apache ports in XAMPP (e.g., to 8080). If you change to 8080, access via http://localhost:8080/.
MySQL won’t start
Check XAMPP logs (/xampp/mysql/data/mysql_error.log) or change MySQL port if conflict exists.
Database connection error (wpdb)
Re-check db name, username (root), and password (blank). Ensure MySQL is running.
Blank page after install (white screen)
Enable WP debug in wp-config.php by adding:
define(‘WP_DEBUG’, true);
This shows errors that help diagnose the problem.
Emails don’t send from localhost
Local installs don’t send email by default. Use a plugin like WP Mail SMTP and configure SMTP for testing, or use MailHog/Mailtrap.
Extra Tips & Useful Tweaks
Create multiple local sites: each site = a separate folder in htdocs + its own database.
Back up your local site: copy the site folder and export the DB via phpMyAdmin.
Use a tool for easy local WP development: alternatives like Local by Flywheel, DesktopServer, or Docker-based setups exist and simplify some tasks. (Optional — only if you want to try another approach.)
Permalink issue: if pretty permalinks break, go to Settings → Permalinks and re-save. Make sure .htaccess is writable (Windows permissions).
Enable pretty permalinks: You may need Apache’s mod_rewrite enabled (XAMPP usually has it on).
Security reminders (for future live sites)
Never use root user for live DBs; create a dedicated DB user with a strong password.
Don’t leave default usernames like admin on a live site.
Local dev sites are safe, but when migrating to live hosting, make sure file permissions and secrets are handled properly.
Quick Reference — Commands & Paths
Windows:
XAMPP folder: C:\xampp\
Web root: C:\xampp\htdocs\
Local URL: http://localhost/foldername/
macOS:
XAMPP folder: /Applications/XAMPP/
Web root: /Applications/XAMPP/htdocs/
Local URL: http://localhost/foldername/
phpMyAdmin:
http://localhost/phpmyadmin/
FAQ
Q: Can I use a password for the MySQL root user in XAMPP? A: Yes — you can set one for extra safety, but then update wp-config.php or the WordPress installer to use it.
Q: How do I move my local site to a live host? A: Use a migration plugin (e.g., All-in-One WP Migration, Duplicator) or export/import the DB, copy files, and update wp-config.php and site URLs.
Q: Can I run multiple WordPress versions on localhost? A: Yes — each site folder can hold a different WordPress version and its own DB.
Conclusion
That’s it — you’ve installed WordPress on your local machine using XAMPP and learned how to troubleshoot common issues. Local WordPress development is a powerful way to practice, build prototypes, and test changes before going live. 🎉