21+ years in hosting · Jaipur, India · INR billing with 18% GST · 24/7 email support
Blog · WebJi® India

How to Install WordPress on XAMPP

Quick answer

To install WordPress on XAMPP, start Apache and MySQL in the XAMPP Control Panel, create a database in phpMyAdmin, unzip WordPress into a folder inside htdocs, then open http://localhost/yourfolder and enter the database name, user root and a blank password. It worked when the WordPress dashboard loads.

For beginners, students and developers who want a free offline WordPress site on their own computer for building and testing.

✓ In business since 2005
✓ INR + GST billing
✓ 24/7 Email Support — avg reply < 60 min
GuideWebJi®
knowledge
Read time
5 min
Sections
8
Updated
14 Nov 2026
Written by
WebJi® team

What is XAMPP, and when should you use it for WordPress?

XAMPP is a free local server bundle from Apache Friends that installs Apache, MariaDB (shown as "MySQL"), PHP and phpMyAdmin on your own computer, so WordPress can run offline for building and testing. It is not meant for public websites.

XAMPP on a laptop compared with live hosting
PointXAMPP locallyLive hosting
Who can reach itOnly your computerAnyone on the internet
Database loginroot with a blank passwordSeparate user with a strong password
PHP versionWhatever that XAMPP build shipsChosen per site in the panel
Caching, CDN, SSLNone by defaultServer cache, CDN and free SSL
Use forBuilding, learning, testing plugins and themesReal visitors

Because PHP versions and caching differ, a site that works in XAMPP can still behave differently on a host. Treat it as a workshop, not proof.

How do you install XAMPP and start Apache and MySQL?

Download a build with PHP 8.2 or newer from apachefriends.org, install it with Apache, MySQL, PHP and phpMyAdmin selected, then click Start beside Apache and MySQL in the XAMPP Control Panel. Both turn green when running.

  1. Run the installer and keep the default location (C:\xampp on Windows).
  2. Open the XAMPP Control Panel and start Apache, then MySQL.
  3. Open http://localhost; the XAMPP dashboard confirms Apache is serving.
  4. Open http://localhost/phpmyadmin to confirm the database is up.

On Linux, the stack is controlled with sudo /opt/lampp/lampp start. If Apache flashes green and stops, another program holds port 80; see the errors table below.

How do you create the WordPress database in phpMyAdmin?

In phpMyAdmin open Databases, enter a name such as wp_local, choose the utf8mb4_unicode_ci collation and click Create. Locally, XAMPP's root account with no password is enough.

utf8mb4 stores every Unicode character, including Devanagari text and emoji, which older utf8 settings cannot. Give each local site its own database and folder so testing one never touches another. If you prefer the command line, run mysql -u root -e "CREATE DATABASE wp_local CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;" from XAMPP's shell.

Where do the WordPress files go in XAMPP?

Put WordPress in a folder inside htdocs, XAMPP's web root; a folder named mysite becomes http://localhost/mysite. wp-admin, wp-content and index.php must sit directly inside that folder.

htdocs location by operating system
Systemhtdocs path
WindowsC:\xampp\htdocs\
macOS/Applications/XAMPP/htdocs/
Linux/opt/lampp/htdocs/

Download latest.zip from WordPress.org and extract it so you get htdocs/mysite/wp-admin, not htdocs/mysite/wordpress/wp-admin; the extra level puts the site one folder too deep.

How do you run the WordPress installer on localhost?

Open http://localhost/mysite, enter database wp_local, user root, an empty password and host localhost, then set the site title and admin login. The install is done when the dashboard loads.

  1. Choose a language, then enter the database details above and keep the table prefix wp_.
  2. If WordPress cannot write wp-config.php, it shows the contents; create the file in the site folder, paste and save.
  3. Set a site title, an admin username that is not "admin", a strong password and your email.
  4. Log in at http://localhost/mysite/wp-admin.

Apache and MySQL must be started again after each reboot. Next steps such as themes are in installing a WordPress theme.

How do you fix common XAMPP errors?

Most XAMPP problems are port conflicts or low PHP limits, each fixed in one configuration file opened from the Control Panel's Config button. Restart the service after every change.

XAMPP symptoms, causes and fixes
SymptomCauseFix
Apache will not startPort 80 or 443 used by IIS, Skype or another serverStop that program, or set Listen 8080 in httpd.conf and use localhost:8080
MySQL stops immediatelyPort 3306 used by another MySQL installStop the other service, or change the port in my.ini
Upload fails at 2 MB or soLow PHP upload limitsRaise upload_max_filesize and post_max_size in php.ini
Plugin or import times outShort max_execution_timeRaise it in php.ini
Database connection errorMySQL not running, or wrong nameStart MySQL; check the name in wp-config.php

On Windows, netstat -ano | findstr :80 shows which process ID holds port 80.

How do you move a XAMPP WordPress site to live hosting?

Export the database, upload the files, import the database on the host, then replace every http://localhost/mysite reference with your real https address using a serialisation-safe tool. Skipping the replacement leaves a live site that redirects to localhost.

# on the server, from the site folder, after importing the SQL file
wp search-replace 'http://localhost/mysite' 'https://example.in' --all-tables --skip-columns=guid
wp option get siteurl

Then update the database name, user and password in wp-config.php and resave permalinks. A migration plugin can do the whole move instead. A small site fits WebJi® WordPress hosting, and the WordPress migration guide covers moves between live hosts.

FAQ

Frequently asked questions

Is XAMPP safe to use?

On your own computer, yes. Its defaults, such as a blank database root password, assume nobody else can reach it. Never expose XAMPP to the internet or a shared office network without setting passwords and restricting access.

Should I use XAMPP or LocalWP for WordPress?

LocalWP is built only for WordPress and creates sites in a few clicks with per-site PHP versions. XAMPP is general-purpose and teaches how Apache, PHP and MySQL fit together. Both are free; choose by whether you want simplicity or a full stack to learn.

Can other people see my XAMPP site?

Not by default. localhost is reachable only from your computer. To show a client, upload the site to a staging subdomain on real hosting rather than opening ports on your machine.

Why does my local site look different on the host?

Different PHP versions, server caching, file permissions or URLs not fully replaced are the usual causes. Match the host's PHP version in your local setup, purge caches after upload and recheck the site URL settings.

Steps checked against Apache Friends and WordPress.org documentation · Reviewed by the WebJi® team, Jaipur.

WebJi® since 2005

Ready to get started with WebJi®?

Join 12,000+ businesses across India and overseas. INR pricing, 18% GST shown before payment and 24/7 email support in Hindi and English — average first reply under 60 minutes.