{"id":3305,"date":"2025-10-26T12:44:24","date_gmt":"2025-10-26T12:44:24","guid":{"rendered":"https:\/\/blog.surajweb.com\/?p=3305"},"modified":"2025-10-26T12:44:25","modified_gmt":"2025-10-26T12:44:25","slug":"how-to-install-wordpress-on-localhost-using-xampp-a-step-by-step-beginners-guide","status":"publish","type":"post","link":"https:\/\/surajweb.com\/blog\/wordpress\/how-to-install-wordpress-on-localhost-using-xampp-a-step-by-step-beginners-guide\/","title":{"rendered":"How to Install WordPress on Localhost Using XAMPP \u2014 A Step-by-Step Beginner\u2019s Guide"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/blog.surajweb.com\/wp-content\/uploads\/2025\/10\/how-to-install-wordpress-site-in-localhost-1024x576.jpg\" alt=\"\" class=\"wp-image-3307\" srcset=\"https:\/\/surajweb.com\/blog\/wp-content\/uploads\/2025\/10\/how-to-install-wordpress-site-in-localhost-1024x576.jpg 1024w, https:\/\/surajweb.com\/blog\/wp-content\/uploads\/2025\/10\/how-to-install-wordpress-site-in-localhost-300x169.jpg 300w, https:\/\/surajweb.com\/blog\/wp-content\/uploads\/2025\/10\/how-to-install-wordpress-site-in-localhost-768x432.jpg 768w, https:\/\/surajweb.com\/blog\/wp-content\/uploads\/2025\/10\/how-to-install-wordpress-site-in-localhost.jpg 1280w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Want to build and test WordPress sites on your own computer before pushing them live? Great \u2014 this guide walks you through the <strong>entire process<\/strong> from zero to login, with clear, numbered steps and helpful tips. I\u2019ll keep it beginner-friendly and show commands\/paths for Windows and macOS where needed.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Why use XAMPP + WordPress locally?<\/strong><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>No internet required for development.<br><\/li>\n\n\n\n<li>Safe place to test themes, plugins, or edits.<br><\/li>\n\n\n\n<li>Faster iteration \u2014 make changes and see them instantly.<br><\/li>\n\n\n\n<li>Perfect for learning WordPress without breaking a live site.<br><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>What you\u2019ll need<\/strong><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>A computer (Windows, macOS, or Linux)<br><\/li>\n\n\n\n<li>XAMPP (includes Apache, PHP, MySQL\/phpMyAdmin) \u2014 free<br><\/li>\n\n\n\n<li>WordPress (latest ZIP from wordpress.org)<br><\/li>\n\n\n\n<li>Basic comfort with downloading files and opening folder paths<br><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Step 1 \u2014 Download &amp; Install XAMPP<\/strong><\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Go to<a href=\"https:\/\/www.apachefriends.org\/\"> <strong>https:\/\/www.apachefriends.org<\/strong><\/a> and download the XAMPP installer for your OS.<br><\/li>\n\n\n\n<li>Run the installer and follow the wizard. Keep default components <strong>Apache<\/strong>, <strong>MySQL<\/strong>, <strong>PHP<\/strong>, and <strong>phpMyAdmin<\/strong> checked.<br><\/li>\n\n\n\n<li>Choose an install folder:<br>\n<ul class=\"wp-block-list\">\n<li>Windows default: C:\\xampp\\<br><\/li>\n\n\n\n<li>macOS default: \/Applications\/XAMPP\/<br><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Complete installation. If Windows asks about firewall access for Apache, allow it for private networks.<br><\/li>\n<\/ol>\n\n\n\n<p><strong>Tip:<\/strong> On macOS, you may need to allow XAMPP in System Preferences \u2192 Security &amp; Privacy if blocked.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Step 2 \u2014 Start Apache &amp; MySQL<\/strong><\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Open the <strong>XAMPP Control Panel<\/strong>:<br>\n<ul class=\"wp-block-list\">\n<li>Windows: Run xampp-control.exe (from Start Menu or C:\\xampp)<br><\/li>\n\n\n\n<li>macOS: Launch the XAMPP app or use the manager tool<br><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Start these two services:<br>\n<ul class=\"wp-block-list\">\n<li>Click <strong>Start<\/strong> next to <strong>Apache<\/strong><strong><br><\/strong><\/li>\n\n\n\n<li>Click <strong>Start<\/strong> next to <strong>MySQL<\/strong><strong><br><\/strong><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Confirm both are running (status shows green).<br><\/li>\n<\/ol>\n\n\n\n<p><strong>Quick test:<\/strong> Open your browser and visit http:\/\/localhost\/. You should see the XAMPP dashboard or a welcome page.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Step 3 \u2014 Create a MySQL Database for WordPress<\/strong><\/h2>\n\n\n\n<p>In your browser, go to:<br><br>http:\/\/localhost\/phpmyadmin\/<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><\/li>\n\n\n\n<li>Click the <strong>Databases<\/strong> tab.<br><\/li>\n\n\n\n<li>Under <em>Create database<\/em>, enter a name (e.g., wordpress_local) and click <strong>Create<\/strong>.<br><\/li>\n<\/ol>\n\n\n\n<p>You now have a database ready for WordPress.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Step 4 \u2014 Download &amp; Extract WordPress<\/strong><\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Download WordPress from<a href=\"https:\/\/wordpress.org\/download\/\"> <strong>https:\/\/wordpress.org\/download\/<\/strong><\/a> \u2014 you\u2019ll get a .zip file.<br><\/li>\n\n\n\n<li>Extract the ZIP. You\u2019ll get a wordpress folder.<br><\/li>\n\n\n\n<li>Move this folder into your XAMPP web root:<br>\n<ul class=\"wp-block-list\">\n<li>Windows: C:\\xampp\\htdocs\\ \u2192 paste the wordpress folder there<br><\/li>\n\n\n\n<li>macOS: \/Applications\/XAMPP\/htdocs\/ \u2192 paste the folder there<br><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>(Optional) Rename the folder to your site name, e.g., mywebsite. The folder name becomes the local site URL: http:\/\/localhost\/mywebsite\/<br><\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Step 5 \u2014 Begin WordPress Installation in Browser<\/strong><\/h2>\n\n\n\n<p>Open your browser and navigate to:<br><br>http:\/\/localhost\/your-folder-name\/<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u00a0Example: http:\/\/localhost\/mywebsite\/<br><\/li>\n\n\n\n<li>Choose your language and click <strong>Continue<\/strong>.<br><\/li>\n\n\n\n<li>Click <strong>Let\u2019s go!<\/strong> when the database setup screen appears.<br><\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Step 6 \u2014 Enter Database Details<\/strong><\/h2>\n\n\n\n<p>Fill in the fields on the setup page:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Database Name:<\/strong> the name you created in phpMyAdmin (e.g., wordpress_local)<br><\/li>\n\n\n\n<li><strong>Username:<\/strong> root<br><\/li>\n\n\n\n<li><strong>Password:<\/strong> (leave blank) \u2014 default for XAMPP is an empty password<br><\/li>\n\n\n\n<li><strong>Database Host:<\/strong> localhost<br><\/li>\n\n\n\n<li><strong>Table Prefix:<\/strong> wp_ (default \u2014 you can change for security)<br><\/li>\n<\/ul>\n\n\n\n<p>Click <strong>Submit<\/strong>, then <strong>Run the installation<\/strong>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Step 7 \u2014 Create Admin Account &amp; Finish Setup<\/strong><\/h2>\n\n\n\n<p>On the next screen fill site\/account info:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Site Title:<\/strong> e.g., My Local Site<br><\/li>\n\n\n\n<li><strong>Username:<\/strong> choose an admin username (avoid admin for security in production)<br><\/li>\n\n\n\n<li><strong>Password:<\/strong> pick a strong password and note it down<br><\/li>\n\n\n\n<li><strong>Your Email:<\/strong> enter an email (for local dev this can be anything)<br><\/li>\n\n\n\n<li><strong>Search Engine Visibility:<\/strong> irrelevant on localhost, leave default<br><\/li>\n<\/ul>\n\n\n\n<p>Click <strong>Install WordPress<\/strong>. When it finishes, click <strong>Log In<\/strong> to access your site dashboard.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Step 8 \u2014 Access WordPress Dashboard<\/strong><\/h2>\n\n\n\n<p>Visit:<\/p>\n\n\n\n<p>http:\/\/localhost\/your-folder-name\/wp-admin\/<\/p>\n\n\n\n<p>Log in with the admin username and password you created. You\u2019re now inside the WordPress Dashboard \u2014 build pages, install themes, add plugins, and experiment freely.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Troubleshooting (common issues)<\/strong><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Apache won\u2019t start \/ port 80 in use<\/strong><strong><br><\/strong>\n<ul class=\"wp-block-list\">\n<li>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\/.<br><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>MySQL won\u2019t start<\/strong><strong><br><\/strong>\n<ul class=\"wp-block-list\">\n<li>Check XAMPP logs (\/xampp\/mysql\/data\/mysql_error.log) or change MySQL port if conflict exists.<br><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Database connection error (wpdb)<\/strong><strong><br><\/strong>\n<ul class=\"wp-block-list\">\n<li>Re-check db name, username (root), and password (blank). Ensure MySQL is running.<br><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Blank page after install (white screen)<\/strong><strong><br><\/strong><\/li>\n<\/ul>\n\n\n\n<p>Enable WP debug in wp-config.php by adding:<br><br>define(&#8216;WP_DEBUG&#8217;, true);<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u00a0This shows errors that help diagnose the problem.<br><\/li>\n\n\n\n<li><strong>Emails don&#8217;t send from localhost<\/strong><strong><br><\/strong>\n<ul class=\"wp-block-list\">\n<li>Local installs don\u2019t send email by default. Use a plugin like <em>WP Mail SMTP<\/em> and configure SMTP for testing, or use MailHog\/Mailtrap.<br><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Extra Tips &amp; Useful Tweaks<\/strong><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Create multiple local sites<\/strong>: each site = a separate folder in htdocs + its own database.<br><\/li>\n\n\n\n<li><strong>Back up your local site<\/strong>: copy the site folder and export the DB via phpMyAdmin.<br><\/li>\n\n\n\n<li><strong>Use a tool for easy local WP development<\/strong>: alternatives like Local by Flywheel, DesktopServer, or Docker-based setups exist and simplify some tasks. (Optional \u2014 only if you want to try another approach.)<br><\/li>\n\n\n\n<li><strong>Permalink issue<\/strong>: if pretty permalinks break, go to <strong>Settings \u2192 Permalinks<\/strong> and re-save. Make sure .htaccess is writable (Windows permissions).<br><\/li>\n\n\n\n<li><strong>Enable pretty permalinks<\/strong>: You may need Apache\u2019s mod_rewrite enabled (XAMPP usually has it on).<br><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Security reminders (for future live sites)<\/strong><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Never use root user for live DBs; create a dedicated DB user with a strong password.<br><\/li>\n\n\n\n<li>Don\u2019t leave default usernames like admin on a live site.<br><\/li>\n\n\n\n<li>Local dev sites are safe, but when migrating to live hosting, make sure file permissions and secrets are handled properly.<br><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Quick Reference \u2014 Commands &amp; Paths<\/strong><\/h2>\n\n\n\n<p>Windows:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>XAMPP folder: C:\\xampp\\<br><\/li>\n\n\n\n<li>Web root: C:\\xampp\\htdocs\\<br><\/li>\n\n\n\n<li>Local URL: http:\/\/localhost\/foldername\/<br><\/li>\n<\/ul>\n\n\n\n<p>macOS:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>XAMPP folder: \/Applications\/XAMPP\/<br><\/li>\n\n\n\n<li>Web root: \/Applications\/XAMPP\/htdocs\/<br><\/li>\n\n\n\n<li>Local URL: http:\/\/localhost\/foldername\/<br><\/li>\n<\/ul>\n\n\n\n<p>phpMyAdmin:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>http:\/\/localhost\/phpmyadmin\/<br><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>FAQ<\/strong><\/h2>\n\n\n\n<p><strong>Q: Can I use a password for the MySQL <\/strong><strong>root<\/strong><strong> user in XAMPP?<\/strong><strong><br><\/strong> A: Yes \u2014 you can set one for extra safety, but then update wp-config.php or the WordPress installer to use it.<\/p>\n\n\n\n<p><strong>Q: How do I move my local site to a live host?<\/strong><strong><br><\/strong> 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.<\/p>\n\n\n\n<p><strong>Q: Can I run multiple WordPress versions on localhost?<\/strong><strong><br><\/strong> A: Yes \u2014 each site folder can hold a different WordPress version and its own DB.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Conclusion<\/strong><\/h2>\n\n\n\n<p>That\u2019s it \u2014 you\u2019ve 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. \ud83c\udf89<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Want to build and test WordPress sites on your own computer before pushing them live? Great \u2014 this guide walks you through the entire process from zero to login, with clear, numbered steps and helpful tips. I\u2019ll keep it beginner-friendly and show commands\/paths for Windows and macOS where needed. Why use XAMPP + WordPress locally? [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":3307,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23],"tags":[32,31],"class_list":["post-3305","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-wordpress","tag-suraj-web","tag-wordpress"],"blocksy_meta":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/surajweb.com\/blog\/wp-json\/wp\/v2\/posts\/3305","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/surajweb.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/surajweb.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/surajweb.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/surajweb.com\/blog\/wp-json\/wp\/v2\/comments?post=3305"}],"version-history":[{"count":1,"href":"https:\/\/surajweb.com\/blog\/wp-json\/wp\/v2\/posts\/3305\/revisions"}],"predecessor-version":[{"id":3310,"href":"https:\/\/surajweb.com\/blog\/wp-json\/wp\/v2\/posts\/3305\/revisions\/3310"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/surajweb.com\/blog\/wp-json\/wp\/v2\/media\/3307"}],"wp:attachment":[{"href":"https:\/\/surajweb.com\/blog\/wp-json\/wp\/v2\/media?parent=3305"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/surajweb.com\/blog\/wp-json\/wp\/v2\/categories?post=3305"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/surajweb.com\/blog\/wp-json\/wp\/v2\/tags?post=3305"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}