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.phpwithout 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 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 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 Laragon download page 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 free license policy 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 Microsoft Visual C++ Redistributable. Install the latest x64 version if Apache refuses to start.
On the WordPress side, the official WordPress requirements recommend PHP 8.3 or greater. According to the WordPress 7.1 server compatibility notes, 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 2026 PHP support clarification.
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
- Go to the Apache Friends download page and choose the newest XAMPP for Windows version (PHP 8.2.x).
- Run the downloaded
.exeinstaller. If Windows shows a User Account Control prompt, click Yes. - You may see a warning that antivirus software or UAC can interfere. Click OK; this is why we install outside
C:\Program Files. - On the Select Components screen, keep Apache, MySQL, PHP, and phpMyAdmin checked. You can safely untick Mercury, Tomcat, FileZilla, Perl, and Webalizer for WordPress.
- Keep the default install folder
C:\xampp. Avoid paths with spaces orProgram Files, which cause permission problems. - 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.
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
- Click the Admin button next to MySQL, or go to
http://localhost/phpmyadmin. - Click the Databases tab at the top.
- Under Create database, type a name such as
wp_mysite(lowercase letters, numbers, and underscores only). - Set the collation to
utf8mb4_unicode_ciso emojis and non-English characters store correctly. - Click Create.
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 WordPress.org’s download page 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
- Open
C:\xampp\htdocsin File Explorer. This is XAMPP’s web root; anything placed here is served athttp://localhost/. - Extract the WordPress ZIP. You’ll get a folder named
wordpress. - Move it into
htdocsand rename it to your project name, e.g.mysite. That name becomes your local URL:http://localhost/mysite.
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:
- In your
mysitefolder, copywp-config-sample.phpand rename the copy towp-config.php. - Open it in a code editor such as VS Code or Notepad++.
- 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 wp-config.php documentation.
Step 7: Run the WordPress Installation Wizard
- Visit
http://localhost/mysitein your browser. - Choose your language and click Continue.
- If you skipped Step 6, click Let’s go! and enter the database details: Database Name
wp_mysite, Usernameroot, Password (leave blank), Database Hostlocalhost, Table Prefixwp_(or something unique likems_). - Click Submit, then Run the installation.
- Fill in the Site Title, an admin Username, a strong Password, and your Email.
- Tick Discourage search engines (good habit; it doesn’t matter locally but carries over if you migrate).
- Click Install WordPress.
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
- Download Laragon Full from laragon.org. The Full edition includes Apache, Nginx, MySQL, PHP, HeidiSQL, and more.
- Run the installer. Keep the default folder
C:\laragon. - Leave Auto virtual hosts enabled; it’s the feature that creates
mysite.testURLs. - 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
- Click the Menu button (or right-click Laragon’s tray icon).
- Go to Quick app β WordPress.
- Type a project name, e.g.
mysite, and click OK. - Laragon downloads the latest WordPress into
C:\laragon\www\mysite, creates a database namedmysite, and addsmysite.testto your Windows hosts file. Approve the admin prompt if asked.
.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.
- In your local dashboard, go to Appearance β Themes.
- Click Add New Theme.
- Browse Popular or Latest, or use the search box and the Feature Filter (e.g. “E-Commerce”, “Block Editor Patterns”).
- Hover over a theme and click Preview to see it, or Install to download it.
- 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.
- 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.cssat its root). - Go to Appearance β Themes β Add New Theme.
- Click Upload Theme at the top.
- Click Choose File, select the theme ZIP, then click Install Now.
- When you see “Theme installed successfully”, click Activate.
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.
- Unzip the theme on your computer. You should get a folder (e.g.
my-theme) withstyle.cssdirectly inside. - Copy that folder into:
- XAMPP:
C:\xampp\htdocs\mysite\wp-content\themes\ - Laragon:
C:\laragon\www\mysite\wp-content\themes\
- XAMPP:
- Go to Appearance β Themes in your dashboard. The theme now appears in the list.
- 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
- Go to Plugins β Add New Plugin.
- Search for a plugin by name or feature.
- 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
- Download the premium or custom plugin ZIP.
- Go to Plugins β Add New Plugin β Upload Plugin.
- Choose the ZIP, click Install Now, then Activate Plugin.
- Enter your license key if the plugin asks. Many premium plugins let you activate on
localhostor.testdomains without using up a site license; check the vendor’s policy.
Manually install plugins
- Unzip the plugin.
- Copy the plugin folder into
wp-content\plugins\inside your site folder. - 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
- Create two pages under Pages β Add New: “Home” and “Blog”.
- Go to Settings β Reading.
- Under Your homepage displays, choose A static page.
- Set Homepage to “Home” and Posts page to “Blog”.
- 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?
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
.testURLs - 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.
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.
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_DEBUGinwp-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
- Create a new database and user in your hosting control panel and note the credentials.
- Import your
.sqlfile into the new database using the host’s phpMyAdmin. - 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. - Edit the live
wp-config.phpwith 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.

