How to Build a WordPress Website Using XAMPP on Localhost (Step-by-Step)

Learn how to build a WordPress website on your local computer using XAMPP. Step-by-step beginner tutorial covering installation, database setup, themes, plugins, and localhost configuration.

What You Need

Software Required

  1. XAMPP Official Website
  2. WordPress Official Website

STEP 1 — Download and Install XAMPP

Install XAMPP

  1. Open the XAMPP website
  2. Download the version for Windows
  3. Run the installer
  4. Click Next until installation starts
  5. Install it in:
C:\xampp
  1. Finish installation

STEP 2 — Start Apache and MySQL

Open XAMPP Control Panel

After installation:

  1. Launch XAMPP Control Panel
  2. Click Start beside:
  • Apache
  • MySQL

Both should turn green.


STEP 3 — Download WordPress

  1. Visit the WordPress download page
  2. Download the ZIP file
  3. Extract the ZIP file

You will see a folder named:

wordpress

STEP 4 — Move WordPress to XAMPP htdocs Folder

Go to:

C:\xampp\htdocs

Copy the extracted WordPress folder there.

You can rename it to your project name.

Example:

C:\xampp\htdocs\mysite

STEP 5 — Create a Database

Open phpMyAdmin

In your browser type:

http://localhost/phpmyadmin

Create Database

  1. Click New
  2. Enter database name:

Example:

mysite_db
  1. Click Create

STEP 6 — Install WordPress

Open browser and type:

http://localhost/mysite

(Replace “mysite” with your folder name.)


STEP 7 — WordPress Setup

Select Language

Choose English and continue.


Database Information

Enter:

Field Value
Database Name mysite_db
Username root
Password leave empty
Database Host localhost
Table Prefix wp_

Click Submit

Then click:

Run Installation

STEP 8 — Create Admin Account

Fill in:

Field Example
Site Title My Website
Username admin
Password Your Password
Email your email

Click:

Install WordPress

STEP 9 — Login to WordPress Dashboard

Visit:

http://localhost/mysite/wp-admin

Login with your username and password.


STEP 10 — Install a Theme

Inside dashboard:

Appearance → Themes → Add New

Popular free themes:

  • Astra
  • OceanWP
  • GeneratePress
  • Kadence

Search and click:

Install → Activate

STEP 11 — Install Important Plugins

Go to:

Plugins → Add New

Recommended plugins:

Plugin Purpose
Elementor Page Builder
WooCommerce Online Store
Rank Math SEO SEO
WPForms Contact Forms
LiteSpeed Cache Speed Optimization

STEP 12 — Create Pages

Go to:

Pages → Add New

Create:

  • Home
  • About
  • Services
  • Contact
  • Blog

STEP 13 — Design Your Website

Using Elementor:

  1. Edit page
  2. Click Edit with Elementor
  3. Drag and drop:
    • Text
    • Images
    • Buttons
    • Videos
    • Forms

STEP 14 — Set Homepage

Go to:

Settings → Reading

Choose:

A Static Page

Select your Home page.

Save changes.


STEP 15 — Create Navigation Menu

Go to:

Appearance → Menus

  1. Create menu
  2. Add pages
  3. Set as Primary Menu
  4. Save

STEP 16 — Test Your Website

Open:

http://localhost/mysite

Check:

  • Mobile view
  • Links
  • Images
  • Forms
  • Speed

STEP 17 — Backup Your Website

Important folders/files:

Website Files

C:\xampp\htdocs\mysite

Database Export

Export database from phpMyAdmin.


STEP 18 — Upload Website Online Later

When ready:

You can move your local WordPress site to a live hosting server using:

  • All-in-One WP Migration
  • Duplicator Plugin

Good hosting companies include:


Recommended Folder Structure

C:\xampp
 ├── htdocs
 │    └── mysite
 │
 ├── mysql
 ├── apache

Common Problems and Fixes

Apache Won’t Start

Possible causes:

  • Skype using port 80
  • IIS running
  • Another server software installed

Fix:

Change Apache port from 80 to 8080.

Then open:

http://localhost:8080/mysite

MySQL Won’t Start

Possible causes:

  • Another MySQL installation
  • Port conflict

Fix:

Change MySQL port in XAMPP settings.

Please follow and like us:
Pin Share

Related posts

Leave a Comment