WordPress Logo – Athemeart WordPress Themes

How to Set Up WordPress on localhost Using XAMPP or Laragon (Windows Guide)

How a WordPress localhost setup worksA Windows laptop runs Apache, PHP and MySQL through XAMPP or Laragon, which together serve a local WordPress site at localhost.Your PC becomes a web serverinstall WordPress on localhost β€” no hosting, no domain, no internet neededBrowserlocalhost/mysiteWindows 10 / 11XAMPP or LaragonApache (web server)PHP (runs WordPress)MySQL / MariaDBWLocal WordPressthemes Β· plugins Β· contentBuild β†’ Test themes & plugins β†’ Break things safely β†’ Push live
A WordPress localhost setup turns your Windows PC into a private web server that only you can see.

Every professional WordPress developer has a local copy of their site running on their own computer. It’s where themes get tested, plugins get stress-checked, and risky code gets written without a single visitor seeing a broken page. If you’ve been editing your live site directly and holding your breath every time you click “Update”, this guide will change how you work.

Below you’ll learn how to install WordPress on localhost on Windows using two of the most popular tools: XAMPP (free, battle-tested, and everywhere) and Laragon (faster, cleaner, and built for developers). We go further than a basic install, too. You’ll also learn how to install a theme in WordPress on localhost, add plugins, configure the right settings, fix the errors almost everyone hits, and finally move the finished site to a live server.

No prior server experience is needed. If you can download a file and unzip a folder, you can complete this WordPress localhost setup in about 15 minutes.

1. Introduction: Why Install WordPress on localhost?

What is localhost?

localhost is the name your computer uses to talk to itself. When you type http://localhost into a browser, the request never leaves your machine. It goes straight to a web server running on your own PC, which is exactly what XAMPP and Laragon provide. Technically, localhost points to the loopback IP address 127.0.0.1.

WordPress needs three things to run: a web server (Apache or Nginx), PHP to execute its code, and a MySQL or MariaDB database to store your posts, pages, and settings. On a hosting account, your provider supplies all three. On localhost, a bundle like XAMPP or Laragon installs them in a single package and starts them with one click. The result is a complete WordPress local development environment on your desktop.

Benefits of running WordPress locally

  • Zero risk to your live site. Update a theme, test a plugin conflict, or edit functions.php without a single visitor seeing an error.
  • It’s completely free. No hosting plan, no domain name. XAMPP, WordPress, and thousands of themes and plugins cost nothing.
  • Blazing-fast feedback. Pages load from your own disk, so there’s no upload or network delay between saving a file and seeing the change.
  • Works offline. Build on a plane, in a cafΓ© with bad Wi-Fi, or during an ISP outage.
  • Perfect for learning. Beginners can explore the WordPress dashboard on localhost, break things, and reinstall in minutes.
  • Safe theme and plugin testing. Test WordPress themes locally before you commit to buying one or switching your live store.
  • Client demos and staging. Agencies build a full site locally, then migrate it when the client signs off.

When should you use XAMPP or Laragon?

Both tools give you a working local server, but they suit different people:

  • Choose XAMPP if you want a free, cross-platform tool with a huge support community, or you’re following a course or tutorial that uses it. It’s the classic “learn the fundamentals” option because you do each step by hand.
  • Choose Laragon if you’re on Windows, want WordPress installed in about 60 seconds, prefer pretty URLs like mysite.test, or juggle many projects at once.

Using a Mac instead? Our dedicated guide on how to install WordPress on Mac with MAMP, XAMPP, or LocalWP walks through the macOS version of this process.

2. XAMPP vs. Laragon: Which Is Better for WordPress?

XAMPP overview

XAMPP for WordPress localhost installation on Windows
XAMPP is a free Apache distribution from Apache Friends, available for Windows, macOS, and Linux.

XAMPP stands for Cross-platform (X), Apache, MariaDB (formerly MySQL), PHP, and Perl. It’s maintained by Apache Friends and has been the default way to install WordPress on a local server for well over a decade. The current Windows release, available from the official XAMPP download page, ships PHP 8.2.12 alongside Apache 2.4.58, MariaDB 10.4.32, and phpMyAdmin 5.2.1.

XAMPP is 100% free and open source. You get a simple Control Panel to start and stop services, phpMyAdmin for database management, and a single web folder called htdocs where every local site lives.

Laragon overview

Laragon, the fastest WordPress localhost software for Windows
Laragon is a portable, Windows-only development environment with automatic virtual hosts.

Laragon is a lightweight, portable environment created by Leo Khoa, designed specifically for Windows. Its signature feature is Quick App: pick WordPress from a menu, type a name, and Laragon downloads WordPress, creates the database, and sets up a pretty URL such as http://mysite.test automatically. The currently offers v8.9.0 as a roughly 229 MB full installer.

Important licensing note: Laragon is no longer fully free. Since version 7, it follows the policy explained on Laragon’s page: personal, non-commercial use is allowed with every feature unlocked, but a reminder popup appears periodically. Paid client work counts as commercial use and needs a license, which costs $49 per year or $149 for a lifetime license on a single device. Older v6.0 builds remain free but no longer receive updates.

Key differences between XAMPP and Laragon

Feature XAMPP Laragon
Price Free and open source Free for non-commercial use; $49/yr or $149 lifetime for commercial
Operating systems Windows, macOS, Linux Windows 10/11 only
WordPress install Manual (download, unzip, create DB) One-click Quick App
Site URL localhost/sitename sitename.test (auto virtual host)
Web server Apache Apache or Nginx (switchable)
Bundled PHP (Windows) PHP 8.2 Multiple versions, switchable from the menu
Database tool phpMyAdmin HeidiSQL (phpMyAdmin optional)
Local SSL (HTTPS) Manual setup Built in (one click)
Portable Portable build available Fully portable by design
Best for Beginners, learners, cross-platform teams Windows developers, agencies, multi-site work

System requirements for Windows

Before you start, make sure your PC meets these practical requirements:

  • Operating system: Windows 10 or Windows 11 (64-bit). XAMPP 8.2 also runs on older 64-bit Windows, but Windows 10+ is recommended.
  • Disk space: At least 1 GB free (the installers are around 150–230 MB, and each WordPress site adds 60–100 MB plus uploads).
  • RAM: 4 GB minimum; 8 GB or more is comfortable when running a browser, code editor, and server together.
  • Admin rights: Needed to install software and, for Laragon, to edit the Windows hosts file.
  • Visual C++ Redistributable: XAMPP’s Windows build depends on the . Install the latest x64 version if Apache refuses to start.

On the WordPress side, the recommend PHP 8.3 or greater. According to the , the absolute floor is PHP 7.4 with MySQL or MariaDB 5.5.5+. Both XAMPP and Laragon comfortably exceed the minimums.

Pro tip most guides miss: XAMPP’s newest Windows build uses PHP 8.2, and PHP 8.2’s security support ends on December 31, 2026. That’s fine on a private local machine, but your live host is probably on PHP 8.3 or 8.4. If you need your WordPress localhost setup to match production exactly, Laragon’s version switcher makes that much easier. The WordPress core team explains its current stance in the .

3. How to Install WordPress on localhost Using XAMPP

This is the classic manual method. It takes a little longer than Laragon, but you’ll understand exactly how WordPress, PHP, and the database fit together, which helps enormously when something goes wrong later.

Step 1: Download and Install XAMPP on Windows

  1. Go to the Apache Friends download page and choose the newest XAMPP for Windows version (PHP 8.2.x).
  2. Run the downloaded .exe installer. If Windows shows a User Account Control prompt, click Yes.
  3. You may see a warning that antivirus software or UAC can interfere. Click OK; this is why we install outside C:\Program Files.
  4. On the Select Components screen, keep Apache, MySQL, PHP, and phpMyAdmin checked. You can safely untick Mercury, Tomcat, FileZilla, Perl, and Webalizer for WordPress.
  5. Keep the default install folder C:\xampp. Avoid paths with spaces or Program Files, which cause permission problems.
  6. Click Next until the installation finishes, then launch the XAMPP Control Panel.

Step 2: Start Apache and MySQL Services

In the XAMPP Control Panel, click Start next to Apache and MySQL. Each module name turns green when it’s running. If Windows Defender Firewall asks for permission, allow access on Private networks only.

XAMPP Control Panel with Apache and MySQL runningXAMPP Control Panel v3.3.0β€” βœ•ModulePID(s)Port(s)ActionsApache1024880, 443StopAdminConfigLogsMySQL77123306StopAdminConfigLogsFileZillaMercuryTomcat10:06:12 [main] Control Panel Ready10:06:20 [Apache] Attempting to start Apache app…10:06:21 [Apache] Status change detected: running10:06:24 [mysql] Attempting to start MySQL app…10:06:25 [mysql] Status change detected: runningAdmin β†’ opens phpMyAdmin
Illustration: XAMPP Control Panel with Apache (ports 80/443) and MySQL (port 3306) running. Green means ready.

To confirm everything works, open your browser and visit http://localhost. You should see the XAMPP welcome dashboard. If Apache won’t start or turns red, jump to the troubleshooting section; it’s almost always a port conflict.

Step 3: Create a WordPress Database Using phpMyAdmin

  1. Click the Admin button next to MySQL, or go to http://localhost/phpmyadmin.
  2. Click the Databases tab at the top.
  3. Under Create database, type a name such as wp_mysite (lowercase letters, numbers, and underscores only).
  4. Set the collation to utf8mb4_unicode_ci so emojis and non-English characters store correctly.
  5. Click Create.
Creating a WordPress database in phpMyAdminlocalhost/phpmyadmin/index.php?route=/server/databasesphpMyAdminβŠ• NewβŠ• information_schemaβŠ• mysqlβŠ• performance_schemaβŠ• phpmyadminDatabasesSQLStatusUser accountsExportImportDatabases⛁ Create databasewp_mysiteutf8mb4_unicode_ci β–ΎCreateβœ“ Database wp_mysite has been created.Default XAMPP login: user root Β· password (leave empty) Β· host localhost
Illustration: create an empty database named wp_mysite with utf8mb4_unicode_ci collation. WordPress will fill it with tables during installation.

That’s all. You don’t need to add tables; WordPress creates them during installation. On a default XAMPP install, the database username is root and the password is empty.

Step 4: Download the Latest WordPress Version

Head to and grab the latest ZIP file. WordPress 7.1 “Mary Lou” was released on August 19, 2026, and the download page always serves the newest stable release. Always download WordPress from WordPress.org itself, never from third-party mirrors, which can bundle malware.

Step 5: Extract WordPress into the htdocs Folder

  1. Open C:\xampp\htdocs in File Explorer. This is XAMPP’s web root; anything placed here is served at http://localhost/.
  2. Extract the WordPress ZIP. You’ll get a folder named wordpress.
  3. Move it into htdocs and rename it to your project name, e.g. mysite. That name becomes your local URL: http://localhost/mysite.
WordPress files inside the XAMPP htdocs folderπŸ“ This PC β€Ί Local Disk (C:) β€Ί xampp β€Ί htdocs β€Ί mysiteπŸ“ wp-adminπŸ“ wp-contentπŸ“ wp-includesπŸ“„ index.phpπŸ“„ wp-config-sample.phpπŸ“„ wp-login.phpπŸ“„ …and other core filesFolder name = local URLC:\xampp\htdocs\mysite⬇http://localhost/mysiteTip: themes & plugins live inmysite\wp-content\themes
Illustration: the WordPress core files placed in C:\xampp\htdocs\mysite.

Step 6: Configure WordPress Database Settings

You have two options. The easiest is to let the installation wizard write the configuration for you (Step 7). If you prefer doing it manually, or the wizard can’t write the file, follow these steps:

  1. In your mysite folder, copy wp-config-sample.php and rename the copy to wp-config.php.
  2. Open it in a code editor such as VS Code or Notepad++.
  3. Update the database lines as shown below and save.
// ** Database settings for XAMPP ** //
define( 'DB_NAME', 'wp_mysite' );
define( 'DB_USER', 'root' );
define( 'DB_PASSWORD', '' );
define( 'DB_HOST', 'localhost' );
define( 'DB_CHARSET', 'utf8mb4' );
define( 'DB_COLLATE', '' );

// Helpful while developing locally (turn OFF on a live site)
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
define( 'WP_ENVIRONMENT_TYPE', 'local' );

While you’re in the file, replace the placeholder “salt” keys with fresh ones from the WordPress secret-key generator linked inside the file. Setting WP_ENVIRONMENT_TYPE to local tells WordPress and many plugins that this is a development copy. Learn what every constant does in the official .

Step 7: Run the WordPress Installation Wizard

  1. Visit http://localhost/mysite in your browser.
  2. Choose your language and click Continue.
  3. If you skipped Step 6, click Let’s go! and enter the database details: Database Name wp_mysite, Username root, Password (leave blank), Database Host localhost, Table Prefix wp_ (or something unique like ms_).
  4. Click Submit, then Run the installation.
  5. Fill in the Site Title, an admin Username, a strong Password, and your Email.
  6. Tick Discourage search engines (good habit; it doesn’t matter locally but carries over if you migrate).
  7. Click Install WordPress.
WordPress installation wizard database connection formWBelow you should enter your database connection details.Database NameUsernamePasswordDatabase HostTable Prefixwp_mysiteroot(leave empty for XAMPP/Laragon)localhostwp_Submit
Illustration: the database connection screen of the WordPress installer, filled in with default XAMPP values.

Step 8: Log In to Your WordPress Dashboard

After the “Success!” screen, click Log In or go to http://localhost/mysite/wp-admin. Enter the username and password you just created, and you’ll land on your WordPress dashboard on localhost. Visit http://localhost/mysite to see the front end with the default theme.

Congratulations! You’ve just completed a full WordPress localhost installation with XAMPP. Bookmark the admin URL; if you ever forget your password, you can reset it directly in phpMyAdmin.

4. How to Install WordPress on localhost Using Laragon

If XAMPP is the manual transmission, Laragon is the automatic. The same result takes about one minute, and you get a clean .test domain instead of a subfolder URL.

Step 1: Download and Install Laragon

  1. Download Laragon Full from laragon.org. The Full edition includes Apache, Nginx, MySQL, PHP, HeidiSQL, and more.
  2. Run the installer. Keep the default folder C:\laragon.
  3. Leave Auto virtual hosts enabled; it’s the feature that creates mysite.test URLs.
  4. Finish the installer and launch Laragon. If a license dialog appears and you’re using it for personal learning, you can close it and continue.

Step 2: Start Laragon Services

Click Start All on the main Laragon window. Apache and MySQL start together, and their status shows in the window. Your web root is C:\laragon\www. Click the Web button to open http://localhost and confirm the server is running.

Step 3: Create a New WordPress Project

  1. Click the Menu button (or right-click Laragon’s tray icon).
  2. Go to Quick app β†’ WordPress.
  3. Type a project name, e.g. mysite, and click OK.
  4. Laragon downloads the latest WordPress into C:\laragon\www\mysite, creates a database named mysite, and adds mysite.test to your Windows hosts file. Approve the admin prompt if asked.
Laragon Quick App menu creating a WordPress siteLaragon Full 8.x β€” Apache Β· MySQL● Apache httpd started (80, 443)● MySQL started (3306)StopWebDatabaseRoot (www)wwwApache β–ΈPHP β–ΈQuick app β–ΈTools β–ΈWordPressJoomlaLaravelDrupalCreate project: WordPressProject namemysiteβ†’ http://mysite.test (auto)βœ“ Downloaded WordPress βœ“ Created DB “mysite” βœ“ Added mysite.test to hosts
Illustration: Laragon’s Menu β†’ Quick app β†’ WordPress flow creates files, the database, and a .test domain in one step.

Step 4: Set Up the WordPress Database

Quick App already created the database for you, so there’s usually nothing to do here. If you ever need to create one manually (for example, when importing an existing site), click Database in Laragon to open HeidiSQL, right-click your connection, and choose Create new β†’ Database. Laragon’s default credentials are user root with an empty password, the same as XAMPP.

Step 5: Complete the WordPress Installation

Laragon opens http://mysite.test automatically. Because Quick App pre-configured wp-config.php, you’ll go straight to the “Welcome” screen. Enter your site title, admin username, password, and email, then click Install WordPress.

Step 6: Access Your Local WordPress Dashboard

Log in at http://mysite.test/wp-admin. That’s it. Want HTTPS locally? Open Menu β†’ Apache β†’ SSL β†’ Enabled, and Laragon issues a trusted local certificate so https://mysite.test works without browser warnings. This is handy for testing payment gateways, mixed-content issues, and anything that requires a secure context.

5. How to Install a WordPress Theme on localhost

Now for the part most localhost tutorials skip: how to install a theme in WordPress on localhost. The good news is that it works exactly like a live site, with one extra manual option that’s actually easier locally. For a broader look at every scenario, including demo content, see our full WordPress theme installation guide.

Method 1: Install a Theme from the WordPress Theme Directory

This method requires an internet connection, because WordPress downloads the theme from WordPress.org.

  1. In your local dashboard, go to Appearance β†’ Themes.
  2. Click Add New Theme.
  3. Browse Popular or Latest, or use the search box and the Feature Filter (e.g. “E-Commerce”, “Block Editor Patterns”).
  4. Hover over a theme and click Preview to see it, or Install to download it.
  5. Click Activate.

You can browse the full WordPress.org theme directory in your browser first to shortlist designs. If you want hand-picked options, our roundup of the best free WordPress themes is a great place to start testing.

Method 2: Upload a Premium or Custom WordPress Theme

Use this method for themes bought from aThemeArt, ThemeForest, or any other marketplace, or for a custom theme a developer delivered as a ZIP.

  1. Download the theme ZIP from your account. Some marketplaces give you a “full package” ZIP; unzip it first and find the installable theme ZIP inside (it contains style.css at its root).
  2. Go to Appearance β†’ Themes β†’ Add New Theme.
  3. Click Upload Theme at the top.
  4. Click Choose File, select the theme ZIP, then click Install Now.
  5. When you see “Theme installed successfully”, click Activate.
Upload Theme screen in the WordPress dashboard on localhost🏠 DashboardπŸ“Œ PostsπŸ–Ό MediaπŸ“„ Pages🎨 AppearanceThemesEditorπŸ”Œ Pluginsβš™ SettingsAdd ThemesUpload ThemeIf you have a theme in a .zip format, you may install or update it by uploading it here.Choose Filemy-theme.zipInstall Nowhttp://localhost/mysite/wp-admin/theme-install.php?upload
Illustration: the Upload Theme panel lets you install premium or custom WordPress themes on localhost from a ZIP file.

Getting “The uploaded file exceeds the upload_max_filesize directive”? XAMPP’s default PHP upload limit is small, and big premium themes often exceed it. Raise upload_max_filesize and post_max_size in php.ini (details in the errors section) or simply use Method 3.

Method 3: Manually Install a Theme Using FTP or File Manager

On a live server you’d use FTP or cPanel’s File Manager. On localhost, Windows File Explorer is your file manager, so this is the fastest method of all and bypasses upload limits completely.

  1. Unzip the theme on your computer. You should get a folder (e.g. my-theme) with style.css directly inside.
  2. Copy that folder into:
    • XAMPP: C:\xampp\htdocs\mysite\wp-content\themes\
    • Laragon: C:\laragon\www\mysite\wp-content\themes\
  3. Go to Appearance β†’ Themes in your dashboard. The theme now appears in the list.
  4. Click Activate.

Watch out for the “double folder” mistake: if you end up with themes/my-theme/my-theme/style.css, WordPress reports “The package could not be installed. The theme is missing the style.css stylesheet.” Move the inner folder up one level to fix it.

How to Activate and Customize Your WordPress Theme

Once a theme is active, how you customize it locally depends on its type:

  • Block themes (full site editing): go to Appearance β†’ Editor to edit templates, headers, footers, colors, and typography visually.
  • Classic themes: go to Appearance β†’ Customize for the live Customizer, plus Appearance β†’ Menus and Widgets.
  • Demo import: many premium themes include a one-click demo importer (often under Appearance β†’ Import Demo Data). Localhost is the perfect place to run it, because demo imports add lots of sample posts and images you might not want on a live site.
  • Recommended plugins: if the theme shows a notice asking you to install required plugins, follow it before importing a demo.

Planning to edit theme code? Create a child theme first so your changes survive theme updates. Our tutorial on how to create a child theme in WordPress includes a free generator. WordPress theme customization locally is also the safest way to test layout changes before showing them to clients.

6. How to Install WordPress Plugins on localhost

Plugins install the same three ways as themes. If you’re not sure which ones you actually need, start with our list of must-have WordPress plugins and test them on localhost before adding them to your live site.

Install plugins from the WordPress dashboard

  1. Go to Plugins β†’ Add New Plugin.
  2. Search for a plugin by name or feature.
  3. Click Install Now, then Activate.

Like themes, this needs internet access because it pulls from the WordPress.org plugin directory.

Upload and activate ZIP plugins

  1. Download the premium or custom plugin ZIP.
  2. Go to Plugins β†’ Add New Plugin β†’ Upload Plugin.
  3. Choose the ZIP, click Install Now, then Activate Plugin.
  4. Enter your license key if the plugin asks. Many premium plugins let you activate on localhost or .test domains without using up a site license; check the vendor’s policy.

Manually install plugins

  1. Unzip the plugin.
  2. Copy the plugin folder into wp-content\plugins\ inside your site folder.
  3. Go to Plugins β†’ Installed Plugins and click Activate.

Bonus troubleshooting trick: if a plugin crashes your local site and you can’t reach the dashboard, open wp-content\plugins and rename the problem plugin’s folder (e.g. add -off). WordPress deactivates it instantly, and you can log back in.

7. How to Configure WordPress Settings on localhost

A fresh install works, but a few minutes in Settings makes your local site behave like a real one and avoids surprises when you move it live.

Change permalink settings

Go to Settings β†’ Permalinks, select Post name, and click Save Changes. This gives clean URLs like localhost/mysite/sample-post/. WordPress writes the rewrite rules into an .htaccess file in your site folder. If you get 404 errors on every page after saving, make sure Apache’s mod_rewrite is enabled (it is by default in XAMPP and Laragon). Our WordPress .htaccess guide shows the default rules if you need to recreate the file.

Configure site title and tagline

Under Settings β†’ General, set your Site Title, Tagline, time zone, and date format. Leave the WordPress Address (URL) and Site Address (URL) as they are; changing these locally is the fastest way to lock yourself out of the dashboard.

Set up a homepage and blog page

  1. Create two pages under Pages β†’ Add New: “Home” and “Blog”.
  2. Go to Settings β†’ Reading.
  3. Under Your homepage displays, choose A static page.
  4. Set Homepage to “Home” and Posts page to “Blog”.
  5. Save. (Block themes may also let you design the front page directly in the Site Editor.)

Configure media and discussion settings

  • Settings β†’ Media: adjust thumbnail, medium, and large image sizes to match your theme’s recommendations before uploading lots of images.
  • Settings β†’ Discussion: disable pingbacks and trackbacks, and decide whether comments are allowed. Locally, many developers turn off email notifications since XAMPP and Laragon don’t send mail by default.

8. XAMPP vs. Laragon: Which WordPress Localhost Setup Should You Choose?

XAMPP vs Laragon scorecard for WordPressEditorial scores out of 10: setup speed XAMPP 5, Laragon 10; ease of use XAMPP 7, Laragon 9; multi-site handling XAMPP 5, Laragon 10; cost XAMPP 10, Laragon 6; cross-platform XAMPP 10, Laragon 3; community and tutorials XAMPP 10, Laragon 7.XAMPP vs. Laragon for WordPress (aThemeArt score /10)XAMPPLaragonSetup speedEase of useMultiple sitesCostCross-platformCommunity51079510106103107
Our editorial scorecard, based on hands-on use of both tools for WordPress and WooCommerce development.

Performance and ease of use

Laragon starts faster and uses less memory than XAMPP, and its Quick App turns a 10-step manual process into one menu click. XAMPP isn’t slow for single-site work, but its manual workflow and occasional port quirks make it feel heavier. For absolute beginners who want to understand the stack, XAMPP’s hands-on process is actually an advantage.

Database management

XAMPP ships phpMyAdmin, a browser-based tool that almost every WordPress tutorial and hosting provider uses, so the skills transfer directly to cPanel hosting. Laragon uses HeidiSQL, a faster desktop client that’s excellent for large imports and quick edits. You can add phpMyAdmin to Laragon if you prefer it.

Local domain support

This is Laragon’s biggest win. Every project gets its own projectname.test domain automatically, which mirrors how a live site works (site at the root, not in a subfolder) and makes migration cleaner. XAMPP can do the same, but you must edit httpd-vhosts.conf and the Windows hosts file by hand for each site.

Final comparison and recommendation

Pick XAMPP if you…

  • Want a 100% free tool for any use, including client work
  • Switch between Windows, macOS, and Linux
  • Are learning how Apache, PHP, and MySQL fit together
  • Follow courses and tutorials that use phpMyAdmin
  • Only need one or two local WordPress sites

Pick Laragon if you…

  • Work only on Windows 10/11
  • Want WordPress installed in under a minute
  • Build many sites and want clean .test URLs
  • Need to switch PHP versions to match production
  • Want one-click local SSL (and will license it for paid work)

Our recommendation: Beginners and hobbyists should start with XAMPP, since it’s free forever and teaches the fundamentals. Freelancers and agencies on Windows will save hours every month with Laragon, and the commercial license pays for itself quickly. If neither fits, LocalWP, WAMP, and MAMP are solid alternatives worth exploring.

9. Common WordPress localhost Errors and How to Fix Them

Most local setup problems come down to a handful of causes. Here’s how to diagnose and fix each one. For problems that also happen on live sites, our guide to the most common WordPress errors goes deeper.

Troubleshooting flow for a local WordPress site that won’t loadSite won’t load?Is Apache green / running?NoPort 80/443 in use β†’ stop Skype/IISor change Apache to port 8080YesIs MySQL running?DB error? Check wp-config.phpNo: port 3306 / repair mysql\dataStill stuck? Check Apache & MySQL logs in the panel
A quick decision flow for the most frequent WordPress localhost problems.

Apache port 80 or 443 already in use

Symptom: Apache turns red or the log says “Port 80 in use by…” or “Problem detected!”.

Fix: Another program (often Skype, IIS / World Wide Web Publishing Service, VMware, or another local server) is using the port. Click Netstat in the XAMPP panel to find it, then close that program or stop its Windows service. Alternatively, change Apache’s port: click Config β†’ httpd.conf and change Listen 80 to Listen 8080 (and ServerName localhost:8080). For 443, edit httpd-ssl.conf and use 4433. Your site then lives at http://localhost:8080/mysite.

MySQL won’t start in XAMPP

Symptom: “MySQL shutdown unexpectedly” or “Error: MySQL shutdown unexpectedly. This may be due to a blocked port, missing dependencies…”.

Fix: First, check that no other MySQL service (e.g. a standalone MySQL install) is using port 3306. If not, the data folder is likely corrupted from an improper shutdown. Back up C:\xampp\mysql\data, then copy everything from C:\xampp\mysql\backup into data except your own database folders and the ibdata1 file. Restart MySQL. Always stop services from the Control Panel before shutting down Windows to prevent this.

Error establishing a database connection

Symptom: A white page that reads “Error establishing a database connection”.

Fix: Confirm MySQL is running, then open wp-config.php and verify DB_NAME matches the database you created exactly, DB_USER is root, DB_PASSWORD is empty (unless you set one), and DB_HOST is localhost. If MySQL runs on a custom port, use localhost:3307.

localhost refused to connect

Symptom: Browser shows “This site can’t be reached. localhost refused to connect.”

Fix: Apache isn’t running or is on a different port. Start it in the panel; if you changed the port, include it in the URL. Also check that Windows Firewall or your antivirus isn’t blocking httpd.exe. With Laragon, if .test domains don’t resolve, run Laragon as administrator so it can update the hosts file.

WordPress installation redirects incorrectly

Symptom: Visiting your site redirects to a different folder, to a live domain, or loops (“too many redirects”).

Fix: The siteurl and home values in the wp_options table don’t match your local URL. This often happens after importing a live database or renaming your folder. Fix them in phpMyAdmin, or add these lines temporarily to wp-config.php:

define( 'WP_HOME', 'http://localhost/mysite' );
define( 'WP_SITEURL', 'http://localhost/mysite' );

Also clear your browser cache, since browsers aggressively cache redirects.

Missing PHP extensions

Symptom: Site Health warns about missing modules (intl, imagick, zip, gd), or a plugin says “requires the X extension”.

Fix: Open php.ini (XAMPP: Apache β†’ Config β†’ PHP (php.ini); Laragon: Menu β†’ PHP β†’ php.ini), find the line such as ;extension=intl, remove the semicolon, save, and restart Apache. Laragon also lets you toggle extensions from Menu β†’ PHP β†’ Extensions.

Maximum file upload size errors

Symptom: “The uploaded file exceeds the upload_max_filesize directive in php.ini” when uploading a theme, plugin, or large image.

Fix: Edit php.ini and raise these values, then restart Apache:

upload_max_filesize = 128M
post_max_size = 128M
memory_limit = 512M
max_execution_time = 300
max_input_time = 300

Need other methods, such as .htaccess or a plugin? See our step-by-step guide on how to increase the maximum file upload size in WordPress.

10. How to Move WordPress from localhost to a Live Server

Building locally is only half the job. When your site is ready, here’s how to publish it. Our full guide to migrating WordPress to a new host without downtime covers advanced scenarios.

Six steps to move WordPress from localhost to a live serverlocalhost β†’ Live: the 6-step migration path1Prepareclean & update2Pluginpick a migrator3Export DB.sql file4Upload filesFTP / File Manager5Update URLssearch-replace6Test livelinks Β· forms Β· SSLUsing a migration plugin automates steps 3–5 in a single export/import.
The six stages of moving a local WordPress site to live hosting.

Prepare your local WordPress website

  • Update WordPress core, themes, and plugins to their latest versions.
  • Delete unused themes, plugins, test posts, and spam comments.
  • Turn off WP_DEBUG in wp-config.php.
  • Untick “Discourage search engines” under Settings β†’ Reading when you’re ready to be indexed.
  • Make a full backup of the site folder and database.

Choose a migration plugin

Migration plugins bundle your files and database into one package and handle URL replacement automatically. Popular free options include All-in-One WP Migration (simple drag-and-drop import, with a file size limit in the free version) and Duplicator (creates an installer package, great for larger sites). With either, you install WordPress on your host, install the same plugin there, and import the package. If you go this route, you can skip the manual steps below.

Export your local WordPress database

For a manual migration, open phpMyAdmin (or HeidiSQL in Laragon), select your database, click Export, choose Quick and SQL, and click Export. Save the .sql file.

Upload WordPress files to hosting

  1. Create a new database and user in your hosting control panel and note the credentials.
  2. Import your .sql file into the new database using the host’s phpMyAdmin.
  3. Upload all files from your local site folder to public_html (or your domain’s root) using FTP or the File Manager. Zipping the folder first and extracting it on the server is much faster.
  4. Edit the live wp-config.php with the new database name, user, password, and host.

Still choosing where to host? Compare affordable options in our list of cheap WordPress hosting plans.

Update website URLs and database settings

Your database still contains http://localhost/mysite (or http://mysite.test) in hundreds of places. Replace every instance with your real domain using a serialization-safe tool like the Better Search Replace plugin or WP-CLI:

wp search-replace 'http://localhost/mysite' 'https://yourdomain.com' --all-tables

Never use a plain find-and-replace in a text editor on the .sql file; it breaks serialized data in widgets and theme options. Then go to Settings β†’ Permalinks and click Save to regenerate .htaccess on the server.

Test your live website

  • Click through every page, menu, and internal link.
  • Confirm images load from your domain, not localhost.
  • Submit every contact form and, for WooCommerce, place a test order.
  • Install an SSL certificate and force HTTPS.
  • Log in to the dashboard and confirm plugins and theme licenses are active on the new domain.
  • Install a security plugin and set up automatic backups.

11. Frequently Asked Questions (FAQs)

Is XAMPP free for WordPress development?

Yes. XAMPP is completely free and open source, with no license fees or usage restrictions. You can use it for personal projects, learning, and paid client work alike.

Is Laragon better than XAMPP?

For Windows developers, Laragon is usually faster and more convenient thanks to one-click WordPress installs, automatic .test domains, PHP version switching, and built-in SSL. XAMPP is better if you need a free tool for commercial work, use macOS or Linux, or want to learn the manual setup process.

Can I install multiple WordPress websites on localhost?

Yes. In XAMPP, create a separate folder in htdocs and a separate database for each site (e.g. localhost/site1, localhost/site2). In Laragon, just run Quick App again with a new name; each site gets its own .test domain and database.

Can I use WordPress themes and plugins offline?

Yes, once they’re installed. Themes and plugins run entirely from your computer. You only need internet access to download them from the WordPress.org directories, to activate some premium licenses, or for features that call external services (Google Fonts, maps, payment gateways).

Does localhost WordPress work without an internet connection?

Yes. After installation, Apache, PHP, MySQL, and WordPress all run locally, so you can write posts, design pages, and edit code fully offline. Core, theme, and plugin updates simply wait until you’re back online.

Can I access my localhost WordPress website from another computer?

Yes, on the same network. Find your PC’s local IP (run ipconfig in Command Prompt), allow Apache through Windows Firewall on private networks, and visit http://192.168.x.x/mysite from the other device. Because WordPress stores localhost as its URL, set WP_HOME and WP_SITEURL to the IP address while testing. To share with someone outside your network, use a tunneling service such as ngrok (Laragon includes a Share feature for this).

How do I uninstall WordPress from XAMPP or Laragon?

Delete the site’s folder from htdocs (XAMPP) or www (Laragon), then drop its database in phpMyAdmin or HeidiSQL. In Laragon, also remove the .test entry, or simply reload Laragon so it cleans up its virtual hosts. To remove the server software itself, run XAMPP’s or Laragon’s uninstaller from Windows Settings β†’ Apps.

Which is better for WordPress: localhost or a staging site?

Use both. Localhost is ideal for fast development, learning, and experiments. A staging site on your host is better for final testing in the real server environment and for letting clients review work online before it goes live.

12. Conclusion

Learning to install WordPress on localhost is one of the best investments you can make as a site owner, freelancer, or developer. With XAMPP, you get a free, cross-platform setup that teaches you how every piece of WordPress fits together. With Laragon, you get a lightning-fast Windows workflow that installs WordPress in a minute and handles domains, SSL, and PHP versions for you.

Whichever tool you choose, you now know the complete workflow: set up the local server, create the database, install WordPress, add and customize themes and plugins, configure settings, fix common errors, and migrate the finished site to live hosting. Start with a test site, break things freely, and enjoy building without the fear of taking your real website down.

Ready to design your first local project? Grab one of the free themes from the shortlist above, install it on localhost using the methods above, and see how it looks before you ever touch your live site.

Inspire us with your love!

Saiful Islam

By Saiful Islam

Saiful Islam, the founder of aThemeArt, is a successful freelancer, a father of two boys, and an enthusiast in coding, YouTube, and gaming. Connect with me on Twitter, Facebook, and Instagram to stay updated with my latest endeavors.

You can check also

Leave a Reply

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

*
*