Paramclasses Academy - Blog

Tutorials Details

←
Post 8 of 40
→

WordPress Localhost Setup: Install WordPress on XAMPP ?

WordPress Localhost Setup: Install WordPress on XAMPP ?

November 13, 2026

 

Series: WordPress Development – Top 40 Tutorials
Module: 2 – Domain, Hosting & Installation
Tutorial: 8 of 40
Level: Beginner
Local Server: XAMPP
CMS: WordPress
Installation Method: Manual Localhost Installation


1. Introduction

WordPress is a Content Management System (CMS) that allows users to create websites without developing every feature from scratch.

Normally, a WordPress website runs on a web hosting server connected to a domain name. However, you can also install WordPress directly on your computer using a local development environment.

One popular tool for creating this environment is XAMPP.

XAMPP provides the essential software required to run PHP-based websites locally. It includes:

  • Apache Web Server

  • MariaDB Database Server

  • PHP

  • phpMyAdmin

  • Other supporting utilities

WordPress uses PHP to execute its application code and a MySQL-compatible database to store website content, settings, users, and other information.

By installing WordPress on XAMPP, you can develop and test a website without purchasing hosting or making it publicly accessible.

What Is Localhost?

Localhost refers to the computer you are currently using.

When you open the following address in your browser:

http://localhost

Your browser communicates with a web server running on your own computer.

For example:

http://localhost/wordpress

This address can open a WordPress installation stored inside your local XAMPP web directory.

What Is XAMPP?

XAMPP is a free, cross-platform web server distribution used for local development.

The name represents its main components:

  • X: Cross-platform

  • A: Apache

  • M: MariaDB (historically MySQL)

  • P: PHP

  • P: Perl

XAMPP makes it easier to run PHP applications without separately configuring every component.

What Is phpMyAdmin?

phpMyAdmin is a browser-based tool for managing MySQL-compatible databases.

You can use it to:

  • Create databases.

  • View database tables.

  • Insert and edit records.

  • Run SQL queries.

  • Manage database users and permissions.

  • Export and import databases.


2. Learning Objectives

After completing this tutorial, you will be able to:

  1. Understand localhost and local development.

  2. Understand the purpose of XAMPP.

  3. Download and install XAMPP.

  4. Start Apache and MySQL/MariaDB services.

  5. Access phpMyAdmin.

  6. Create a WordPress database.

  7. Download the WordPress package.

  8. Extract WordPress into the XAMPP htdocs directory.

  9. Configure WordPress database settings.

  10. Complete the WordPress installation.

  11. Access the WordPress Admin Dashboard.

  12. Troubleshoot common localhost errors.


3. Requirements Before Installation

Before starting the installation, prepare the following:

3.1 Computer

A Windows computer is used for the primary practical steps in this tutorial.

The process is conceptually similar on macOS and Linux, but installation paths and service-management procedures differ.

3.2 XAMPP

Download XAMPP from the official Apache Friends website.

Official download:

https://www.apachefriends.org/download.html

3.3 WordPress Package

Download WordPress from the official WordPress website.

Official download:

https://wordpress.org/download/

The downloaded package is generally provided as a ZIP file.

3.4 Web Browser

You can use any modern browser, such as:

  • Google Chrome

  • Mozilla Firefox

  • Microsoft Edge

  • Safari

3.5 Code Editor

A code editor is useful for viewing or editing WordPress configuration files.

Examples include:

  • Visual Studio Code

  • Notepad++

  • Notepad


4. Understanding the XAMPP Components

Before installation, understand the purpose of the main components.

4.1 Apache

Apache is the web server that receives browser requests and serves website files.

When you open:

http://localhost/wordpress

Apache locates the requested WordPress installation and processes the request.

4.2 MySQL and MariaDB

WordPress needs a database to store website information.

The database stores:

  • Posts

  • Pages

  • User information

  • Website settings

  • Comments

  • Plugin data

  • Theme-related settings

Important: Current XAMPP distributions use MariaDB instead of MySQL, even though the XAMPP Control Panel may still label the service as MySQL. MariaDB is compatible with WordPress's MySQL database interface.

4.3 PHP

PHP is the server-side programming language used by WordPress.

When a visitor opens a WordPress page, PHP executes the required application code and generates the response.

4.4 phpMyAdmin

phpMyAdmin provides a graphical interface for database management.

Instead of writing SQL commands for every database operation, beginners can use its interface to create and manage databases.

4.5 How These Components Work Together

The basic WordPress localhost request works like this:

  1. You enter a localhost URL in your browser.

  2. Apache receives the request.

  3. Apache processes the WordPress PHP files.

  4. WordPress communicates with the MariaDB database.

  5. The database returns the requested information.

  6. WordPress generates the page.

  7. Apache sends the response to your browser.


5. Step-by-Step: Download and Install XAMPP

We will now install XAMPP on Windows.

Step 1: Open the Official XAMPP Website

  1. Open your browser.

  2. Visit https://www.apachefriends.org/download.html.

  3. Find the Windows download section.

  4. Select an appropriate XAMPP package.

  5. Download the installer.

Always download XAMPP from the official Apache Friends website rather than an unknown third-party website.

Step 2: Run the XAMPP Installer

After downloading:

  1. Open the Downloads folder.

  2. Locate the XAMPP installer.

  3. Double-click the installer.

  4. Approve the Windows permission prompt if it appears.

  5. Continue to the setup wizard.

If your antivirus or Windows security software displays a warning, verify that the installer came from the official source before proceeding.

Step 3: Select XAMPP Components

The installer displays a component-selection screen.

For a basic WordPress local environment, the important components are:

  • Apache

  • MySQL (MariaDB in current XAMPP distributions)

  • PHP

  • phpMyAdmin

Select the required components and continue.

Step 4: Select the Installation Directory

Choose the location where XAMPP should be installed.

For this tutorial, we will use:

C:\xampp

Using a simple directory such as C:\xampp makes it easier to understand file paths and access the web root.

Avoid changing the installation directory unnecessarily during your first setup.

Step 5: Complete the Installation

  1. Click Next through the remaining setup screens.

  2. Wait while XAMPP extracts and installs its components.

  3. Finish the installation.

  4. Open the XAMPP Control Panel.

XAMPP is now installed on your computer.


6. Start Apache and MySQL Services

After installation, you need to start the services required by WordPress.

Step 1: Open XAMPP Control Panel

Open the XAMPP Control Panel from the Start Menu or installation directory.

You should see a list of available modules.

Step 2: Start Apache

  1. Find the Apache module.

  2. Click its Start button.

  3. Wait for its status to change to Running.

Apache is responsible for serving your local website.

Step 3: Start MySQL

  1. Find the MySQL module.

  2. Click its Start button.

  3. Wait for its status to change to Running.

This module starts the MariaDB database service in current XAMPP distributions.

Step 4: Verify Both Services

Check that Apache and MySQL are running.

Your XAMPP Control Panel should indicate that both services have started successfully.

Step 5: Test Localhost

Open your browser and enter:

http://localhost

If the local XAMPP page opens, Apache is responding to your browser request.

Important: Keep Apache and MySQL running while using your local WordPress website. If you stop either required service, WordPress may stop working.


7. Create a Database for WordPress

WordPress needs a database to store its website information.

We will create a new database using phpMyAdmin.

Step 1: Open phpMyAdmin

Open your browser and enter:

http://localhost/phpmyadmin

The phpMyAdmin interface should appear if Apache and the database service are running correctly.

Step 2: Open the Databases Section

In phpMyAdmin:

  1. Find the Databases tab.

  2. Click it.

  3. Locate the Create database field.

Step 3: Enter the Database Name

Enter the following database name:

param_classes_wp

Choose a clear database name so you can identify its purpose later.

Step 4: Select a Collation

If the interface asks for a collation, select a suitable Unicode collation supported by your database version, such as:

utf8mb4_unicode_ci

The exact options can vary between MariaDB and phpMyAdmin versions.

Step 5: Create the Database

Click Create.

Your database should now appear in the database list.

<text>Database created successfully: param_classes_wp</text>

Why Do We Need a Database?

WordPress stores much of its dynamic website information in the database.

For example:

  • When you publish a post, WordPress stores its content and related information.

  • When you create a page, WordPress stores the page data.

  • When you create a user, WordPress stores user information.

  • When you change settings, WordPress stores those settings.

Without a working database connection, a normal WordPress installation cannot operate correctly.


8. Download WordPress

Now that XAMPP and the database are ready, download the WordPress application.

Step 1: Visit WordPress.org

Open:

https://wordpress.org/download/

Step 2: Download WordPress

Click the Download WordPress button.

A ZIP file will be downloaded to your computer.

Step 3: Locate the ZIP File

Open your Downloads folder.

Find the downloaded WordPress ZIP package.

Step 4: Extract the ZIP File

Right-click the ZIP file and select Extract All or use your preferred extraction utility.

You should now have a folder named:

wordpress

Inside it, you will find WordPress files and folders such as:

  • wp-admin

  • wp-content

  • wp-includes

  • index.php

  • wp-config-sample.php

  • wp-login.php

These files make up the WordPress application.


9. Copy WordPress into the XAMPP htdocs Folder

The htdocs directory is the default web root used by XAMPP on Windows.

Apache serves local websites from this directory.

Step 1: Open the XAMPP Directory

Open:

C:\xampp

Step 2: Open htdocs

Find and open:

C:\xampp\htdocs

Step 3: Copy the WordPress Folder

Copy the extracted wordpress folder into the htdocs directory.

Your directory structure should look like this:

C:\
 └── xampp
      └── htdocs
           └── wordpress
                ├── wp-admin
                ├── wp-content
                ├── wp-includes
                ├── index.php
                ├── wp-config-sample.php
                └── wp-login.php

Step 4: Rename the Folder (Optional)

You can rename the folder to a more meaningful project name.

For this practical project, use:

paramclasses

The new path becomes:

C:\xampp\htdocs\paramclasses

Your local website URL will be:

http://localhost/paramclasses

Important: The folder name determines the local URL path. If you rename the folder, use the new name when opening the website.


10. Configure WordPress Database Settings

WordPress needs database connection information to communicate with MariaDB.

You can configure this through the WordPress installation wizard or by manually editing the configuration file.

We will first understand the important database settings.

Database Configuration Details

For this local project, the connection details are:

Database Name

param_classes_wp

Database Username

root

Database Password

Use the password configured for your local MariaDB root account. In a default XAMPP setup, this is often blank, but it may differ if you have changed it.

Database Host

localhost

Table Prefix

wp_

The table prefix identifies the WordPress tables belonging to an installation.

Method 1: Configure Through the WordPress Installer

  1. Make sure Apache and MySQL are running.

  2. Open your browser.

  3. Visit http://localhost/paramclasses.

  4. Select your preferred language.

  5. Continue to the database configuration screen.

  6. Enter the database name.

  7. Enter the database username.

  8. Enter the configured database password.

  9. Keep the database host as localhost.

  10. Keep the table prefix as wp_ for this beginner exercise.

  11. Submit the information.

WordPress will check whether it can connect to the database.

If the details are correct, you can continue with the installation.

Method 2: Configure wp-config.php Manually

If you want to understand the WordPress configuration file, you can edit it manually.

Open:

C:\xampp\htdocs\paramclasses

Find:

wp-config-sample.php

Make a copy of this file and rename the copy to:

wp-config.php

Open wp-config.php using a plain-text editor.

Find the database configuration section and set the following values:

define( 'DB_NAME', 'param_classes_wp' );

define( 'DB_USER', 'root' );

define( 'DB_PASSWORD', '' );

define( 'DB_HOST', 'localhost' );

The empty password above is only an example for a default local XAMPP setup. If you configured a MariaDB root password, enter that password instead.

Save the file.

Important: Do not replace your existing configuration file blindly if you have already configured a working WordPress installation.


11. Complete the WordPress Installation

After configuring the database connection, WordPress will display its final installation form.

Step 1: Select Website Language

Choose English or your preferred language.

Click Continue.

Step 2: Enter Site Information

Enter the following details:

Site Title

Param Classes

Username

Choose a unique administrator username.

Example:

param_manager

Password

Create a strong administrator password.

Email Address

Enter an active email address that you can access.

Step 3: Search Engine Visibility

The installation screen may display an option to discourage search engines from indexing the website.

For a local development project, you can enable this option as an additional precaution.

However, remember that this setting is only a request to search engines. It is not a security mechanism and does not prevent other people with access to your computer or network from opening the local website.

Step 4: Install WordPress

Review all the details.

Click Install WordPress.

WordPress will create the required database tables and configure the website.

Step 5: Installation Success

After successful installation, WordPress displays a success message.

Your local WordPress installation is now ready.


12. Open the Local WordPress Website

After installation, you can open your website using the local URL.

For this project:

http://localhost/paramclasses

You should see your WordPress website.

Open WordPress Admin Dashboard

To access the administration area, open:

http://localhost/paramclasses/wp-admin

Enter the administrator username and password you created during installation.

After successful login, you will reach the WordPress Admin Dashboard.

Understand the Two URLs

Frontend URL

http://localhost/paramclasses

This is the website visitors see when accessing your local project.

Backend URL

http://localhost/paramclasses/wp-admin

This is the administration area used to manage the website.


13. Understand the WordPress Folder Structure

A WordPress installation contains several important files and directories.

wp-admin

Contains files responsible for the WordPress administration interface.

wp-content

Contains themes, plugins, and uploaded media.

Important subdirectories include:

  • themes

  • plugins

  • uploads

wp-includes

Contains core WordPress files and libraries.

wp-config.php

Contains important WordPress configuration settings, including database connection details.

index.php

Acts as an entry point for the WordPress application.

wp-login.php

Handles the WordPress login process.

Important: Do not edit or delete WordPress core files without understanding their purpose. Incorrect changes can break your installation.


14. How to Stop and Restart XAMPP

Your local website depends on the XAMPP services.

To Stop XAMPP Services

  1. Open XAMPP Control Panel.

  2. Click Stop next to Apache.

  3. Click Stop next to MySQL.

The local WordPress website will no longer be accessible until the required services are started again.

To Restart XAMPP

  1. Open XAMPP Control Panel.

  2. Click Start next to Apache.

  3. Click Start next to MySQL.

  4. Open your local WordPress URL again.

You do not need to reinstall WordPress every time you restart your computer.

Your website files and database remain stored locally.


15. Common XAMPP and WordPress Errors

Problem 1: Apache Is Not Starting

Possible reasons:

  • Another application is using port 80.

  • Another application is using port 443.

  • An existing Apache service is running.

  • Configuration files contain errors.

Solutions:

  1. Open XAMPP Control Panel.

  2. Review the Apache error log.

  3. Check which application is using the required port.

  4. Stop the conflicting service if appropriate.

  5. Alternatively, configure Apache to use another available port.

  6. Restart Apache.

If Apache uses port 8080, you may need to access your website using:

http://localhost:8080/paramclasses

Remember that changing Apache ports also changes the URL used to access your local websites.

Problem 2: MySQL Is Not Starting

Possible reasons:

  • Another database service is using port 3306.

  • The MariaDB data directory has a problem.

  • A previous database process is still running.

  • Database configuration is incorrect.

Solutions:

  1. Review the MySQL log in XAMPP.

  2. Check whether another MySQL or MariaDB service is running.

  3. Identify any port conflict.

  4. Stop conflicting services only when safe.

  5. Restart the XAMPP database service.

Do not delete the mysql/data directory as a quick fix. It may contain important databases.

Problem 3: Object Not Found or 404 Error

Possible reasons:

  • Incorrect project folder name.

  • WordPress files are in the wrong directory.

  • Incorrect URL.

  • Apache is serving a different document root.

Solutions:

Verify the folder path:

C:\xampp\htdocs\paramclasses

Then open:

http://localhost/paramclasses

Check the folder name carefully.

Problem 4: Error Establishing a Database Connection

Possible reasons:

  • Incorrect database name.

  • Incorrect database username.

  • Incorrect password.

  • Database server is not running.

  • Incorrect database host.

Solutions:

Check the values in wp-config.php:

define( 'DB_NAME', 'param_classes_wp' );
define( 'DB_USER', 'root' );
define( 'DB_PASSWORD', '' );
define( 'DB_HOST', 'localhost' );

Make sure these values match your actual local database configuration.

Problem 5: phpMyAdmin Is Not Opening

Possible reasons:

  • Apache is not running.

  • MySQL is not running.

  • phpMyAdmin is not installed correctly.

  • A port conflict exists.

Solutions:

  1. Start Apache and MySQL.

  2. Check the XAMPP Control Panel logs.

  3. Confirm the browser URL.

  4. Verify the phpMyAdmin installation.

Try:

http://localhost/phpmyadmin

Problem 6: WordPress Shows a Blank White Screen

Possible reasons:

  • PHP errors.

  • Plugin conflicts.

  • Theme compatibility issues.

  • PHP memory limitations.

Solutions:

  1. Check the Apache/PHP error log.

  2. Temporarily disable recently installed plugins by renaming their folders.

  3. Switch to a default WordPress theme if the dashboard is accessible.

  4. Check PHP compatibility.

  5. Review WordPress debugging information carefully.

Problem 7: WordPress Login Is Not Working

Possible reasons:

  • Incorrect administrator credentials.

  • Wrong local website URL.

  • Browser cookie problems.

  • Plugin-related login issues.

Solutions:

  1. Verify the local website URL.

  2. Confirm your administrator username.

  3. Use the password reset option where email functionality is available.

  4. Clear browser cookies.

  5. Use phpMyAdmin only when you understand how WordPress stores user credentials.

Problem 8: Port 80 Is Already in Use

Possible reasons:

Another application, such as IIS or another web server, may be using port 80.

Solutions:

  1. Identify the application using port 80.

  2. Stop or reconfigure the conflicting service if appropriate.

  3. Alternatively, configure Apache to use a different port.

  4. Restart Apache and test the updated localhost URL.


16. Best Practices for WordPress Localhost Development

  1. Download XAMPP only from the official Apache Friends website.

  2. Download WordPress only from WordPress.org.

  3. Keep your XAMPP and WordPress versions compatible.

  4. Use a separate database for each practice website.

  5. Give each project a meaningful folder name.

  6. Keep a backup of important project files.

  7. Export databases before making major changes.

  8. Do not delete the XAMPP database directory manually.

  9. Avoid exposing phpMyAdmin or an unsecured local database to public networks.

  10. Do not use default database credentials on a publicly accessible server.

  11. Keep your WordPress administrator password strong.

  12. Use a suitable PHP version for the WordPress version you are testing.

  13. Test themes and plugins locally before deploying them to a live website.

  14. Remember that localhost is not the same as a production hosting environment.

WordPress Version Compatibility

WordPress currently recommends:

  • PHP 8.3 or greater.

  • MariaDB 10.11 or greater, or MySQL 8.0 or greater.

  • HTTPS support for a normal public installation.

A local XAMPP package may include older PHP or MariaDB versions. Check the versions included in the package before choosing it for development.

A local learning setup can work in environments that are below the recommended baseline, but you should use supported versions for serious development and deployment.


17. Practical Project: Create a Local WordPress Website

Now create a complete local website using XAMPP.

Project Name: Param Classes Local Website

Objective: Install WordPress locally and access its frontend and backend.

Project Configuration

  • Local Server: XAMPP

  • Web Server: Apache

  • Database Server: MariaDB

  • Database Management: phpMyAdmin

  • CMS: WordPress

  • Project Folder: paramclasses

  • Database Name: param_classes_wp

  • Database Username: root

  • Database Host: localhost

  • Local Website URL: http://localhost/paramclasses

  • Admin URL: http://localhost/paramclasses/wp-admin

Practical Tasks

Task 1: Download XAMPP.

Task 2: Install XAMPP on your computer.

Task 3: Open XAMPP Control Panel.

Task 4: Start Apache and MySQL.

Task 5: Open phpMyAdmin.

Task 6: Create the param_classes_wp database.

Task 7: Download WordPress from WordPress.org.

Task 8: Extract the ZIP file.

Task 9: Copy the WordPress folder into htdocs.

Task 10: Rename the folder to paramclasses.

Task 11: Open the local WordPress installation URL.

Task 12: Enter database connection details.

Task 13: Complete the WordPress installation form.

Task 14: Log in to the WordPress Admin Dashboard.

Task 15: Open the frontend and verify the website.

Expected Result

After completing this project:

  • XAMPP should be installed.

  • Apache and MySQL should run successfully.

  • The WordPress database should exist.

  • WordPress files should be present inside htdocs.

  • Your local WordPress website should open in a browser.

  • You should be able to access the WordPress Admin Dashboard.


18. Frequently Asked Questions (FAQs)

Q1. What is localhost?

Localhost is the hostname used to access services running on your own computer.

Q2. What is XAMPP?

XAMPP is a local web development package that includes Apache, MariaDB, PHP, and other supporting tools.

Q3. What is the full form of XAMPP?

XAMPP represents Cross-platform, Apache, MariaDB, PHP, and Perl.

Q4. What is Apache?

Apache is a web server that handles browser requests and serves website files.

Q5. What is MySQL?

MySQL is a relational database management system used to store and organize website data.

Q6. Does current XAMPP use MySQL or MariaDB?

Current XAMPP distributions use MariaDB as the database server, although the Control Panel may still display the label MySQL.

Q7. What is phpMyAdmin?

phpMyAdmin is a browser-based tool for managing MySQL-compatible databases.

Q8. What is htdocs?

The htdocs directory is the default web root in a standard XAMPP Windows installation.

Q9. Where should I put WordPress files in XAMPP?

Place the WordPress project folder inside the XAMPP htdocs directory.

Q10. What is the default XAMPP installation path on Windows?

A common installation path is C:\xampp.

Q11. How do I open localhost?

Enter http://localhost in your browser while Apache is running.

Q12. How do I open phpMyAdmin?

Enter http://localhost/phpmyadmin in your browser.

Q13. Why does WordPress need a database?

WordPress uses a database to store posts, pages, users, settings, and other dynamic website information.

Q14. What is wp-config.php?

It is an important WordPress configuration file that contains database connection details and other settings.

Q15. What is DB_NAME?

DB_NAME specifies the name of the database WordPress should use.

Q16. What is DB_USER?

DB_USER specifies the database username used by WordPress to connect to the database.

Q17. What is DB_PASSWORD?

DB_PASSWORD specifies the password associated with the database user.

Q18. What is DB_HOST?

DB_HOST specifies the database server hostname. In a standard local XAMPP setup, it is commonly localhost.

Q19. What is the WordPress table prefix?

It is a prefix added to WordPress database table names. The default prefix is wp_.

Q20. Can I install multiple WordPress websites in XAMPP?

Yes. You can create separate project folders and databases for different local WordPress websites.

Q21. Why is Apache not starting?

A common reason is that another application is already using Apache's required port.

Q22. Why is MySQL not starting?

A database port conflict, running database service, or database configuration issue may prevent it from starting.

Q23. Can I use WordPress offline with XAMPP?

Yes. Once the required files and software are installed, you can work on your local website without an active internet connection. Some external services and features may still require internet access.

Q24. Is a localhost website visible to everyone on the internet?

No. A normal localhost installation is intended for access from your own computer. Network exposure depends on your server and network configuration.

Q25. Can I move my localhost WordPress website to live hosting?

Yes. You can migrate the website files and database to a compatible hosting server, then update the domain and URL configuration as needed.


19. Conclusion

In this tutorial, we learned how to install WordPress locally using XAMPP.

We covered XAMPP installation, Apache and MySQL service management, phpMyAdmin, database creation, WordPress file extraction, the htdocs directory, database configuration, and the WordPress installation wizard.

We also learned how to access the frontend and backend, understand the WordPress folder structure, and troubleshoot common localhost problems.

After completing this tutorial, you should be able to create a local WordPress development environment and build websites on your computer without purchasing domain hosting.

Practical outcome: You now have the foundational knowledge to install and test WordPress locally before deploying a website to a live hosting server.

←
Post 8 of 40
→