How to install wordpress on localhost by using xampp

How to Install WordPress on Localhost Using XAMPP
Setting up WordPress on your local computer using XAMPP is an excellent way to test websites, learn WordPress development, or experiment with themes and plugins without affecting a live site. XAMPP provides an easy-to-use environment that includes Apache, MySQL, and PHP—the essential components needed to run WordPress locally.
In this tutorial, we’ll guide you through installing WordPress on your localhost using XAMPP, step by step. By the end of this guide, you’ll have a fully functional WordPress site running on your computer.

1. What You Need to Install WordPress on Localhost
Before you begin, ensure you have the following prerequisites:
- Windows, macOS, or Linux (XAMPP supports all major operating systems).
- XAMPP (latest version for your OS).
- WordPress (latest version as a ZIP file).
- A web browser (Chrome, Firefox, Edge, or Safari).
Why Use XAMPP?
XAMPP is a free, open-source platform that simplifies the process of setting up a local web server. It includes:
- Apache (Web server)
- MySQL (Database management system)
- PHP (Server-side scripting language)
- phpMyAdmin (Database management tool)
These components allow you to run WordPress locally without the need for external hosting.

2. Installing XAMPP on Your Computer
The first step is to install XAMPP on your system.
Step 1: Download XAMPP
- Visit the official XAMPP download page.
- Choose the correct version for your operating system (Windows, macOS, or Linux).
- Save the installer file to a convenient location.
Step 2: Run the XAMPP Installer
- Locate the downloaded XAMPP installer and double-click it.
- Follow the on-screen instructions.
- When prompted, uncheck unnecessary components (only Apache, MySQL, and phpMyAdmin are needed).
- Choose the installation directory (default is recommended for beginners).
- Complete the installation.
Step 3: Launch XAMPP
- Open the XAMPP Control Panel.
- Start Apache and MySQL by clicking the Start buttons.
- If these services don’t start, check for port conflicts (e.g., Skype or another web server may be using port 80).
Step 4: Verify XAMPP Installation
- Open a web browser and go to
http://localhost
. - You should see the XAMPP welcome page, confirming that Apache and MySQL are running correctly.

3. Downloading and Preparing WordPress
Now that XAMPP is running, you need to download WordPress.
Step 1: Download WordPress
- Visit the official WordPress download page.
- Click Download WordPress.
- Extract the ZIP file to a folder (e.g.,
C:\xampp\htdocs\wordpress
).
Step 2: Create a Database for WordPress
WordPress requires a MySQL database to store content.
- Open a web browser and go to
http://localhost/phpmyadmin
.- A username: root, no password (default for XAMPP).
- Click New to create a database.
- Name it
wordpress
(or any name you prefer). - Select UTF8_general_ci as the encoding.
- Click Create.

4. Installing WordPress on Localhost
Now that you have XAMPP and WordPress ready, it’s time to install WordPress.
Step 1: Set Up WordPress
- Open a web browser and go to
http://localhost/wordpress
(replacewordpress
with your folder name). - You should see the WordPress installation screen.
- Select your preferred language and click Continue.
Step 2: Enter Database Details
- On the next screen, enter the following database details:
- Database Name:
wordpress
(or the name you chose earlier) - Username:
root
- Password: (leave empty by default in XAMPP)
- Database Host:
localhost
- Table Prefix:
wp_
(or any prefix you like)
- Database Name:
- Click Submit.
Step 3: Complete the WordPress Installation
- On the next screen, fill in the site details:
- Site Title: Your website’s name
- Username: Your admin username (avoid using
admin
for security) - Password: Choose a strong password
- Your Email: Your email address
- Check "Discourage search engines" if you don’t want search engines to index your local site.
- Click Install WordPress.
Step 4: Log In to WordPress
- After installation, you’ll see the Success! screen.
- Click Log In (or go to
http://localhost/wordpress/wp-admin
). - Enter your username and password to access the WordPress dashboard.
5. Final Steps and Troubleshooting
Accessing Your WordPress Site
- Frontend:
http://localhost/wordpress
- Admin Panel:
http://localhost/wordpress/wp-admin
Common Issues & Fixes
-
"Error Establishing a Database Connection"
- Ensure MySQL is running in XAMPP.
- Verify the database name and credentials in
wp-config.php
.
-
White Screen of Death
- Increase PHP memory limit in
php.ini
(find and modifymemory_limit = 256M
). - Disable all plugins via FTP.
- Increase PHP memory limit in
-
Port Conflicts
- Stop services like Skype or other web servers using port 80.
-
Mismatched Database Credentials
- Double-check
wp-config.php
for correct database details.
- Double-check
Conclusion
Congratulations! You’ve successfully installed WordPress on your localhost using XAMPP. You can now start building and testing your WordPress site locally before deploying it to a live server.
This setup is ideal for developers, designers, and beginners who want to experiment with WordPress without server costs. If you encounter any issues, refer to the troubleshooting section or check the official WordPress documentation.
Happy WordPressing! 🚀
0 Comments
Please login or register to leave a comment.