How to Install WordPress Using XAMPP on Windows and Mac

WordPress powers over 43% of all websites on the internet, making it the most popular content management system (CMS). With its ease of use, flexibility, and extensive plugin ecosystem, WordPress is an excellent choice for bloggers, businesses, and developers. In this guide, you'll learn how to install WordPress locally using XAMPP on both Windows and Mac.


Why Use WordPress?

Statistics on WordPress Usage

  • 43% of websites run on WordPress.

  • Over 500 new WordPress sites are built daily.

  • WordPress has over 55,000 plugins available.

  • More than 70 million new posts are published monthly on WordPress.

Benefits of Using WordPress

  • Open-source & Free – No licensing costs.

  • SEO-Friendly – Built-in SEO features.

  • Highly Customizable – Thousands of themes and plugins.

  • User-Friendly – No coding required for basic use.

  • Strong Community Support – Large developer and user base.


Step-by-Step Guide to Installing WordPress with XAMPP

Step 1: Download and Install XAMPP

  1. Visit the XAMPP website.

  2. Download the XAMPP version for Windows or Mac.

  3. Run the installer and select the required components: Apache, MySQL, PHP.

  4. After installation, open the XAMPP Control Panel and start Apache and MySQL.

Step 2: Download WordPress

  1. Go to WordPress.org.

  2. Download the latest WordPress ZIP file.

  3. Extract the ZIP file to a folder on your computer.

Step 3: Setup WordPress in XAMPP

  1. Open the command line on your computer.

  2. Navigate to the XAMPP htdocs directory:

     cd /Applications/XAMPP/xamppfiles/htdocs  # Mac
     cd C:\xampp\htdocs  # Windows (use File Explorer if needed)
    
  3. Create a new directory for your WordPress site:

     mkdir mywordpresssite
    
  4. Copy the WordPress core files to your new site folder:

     cp -r ~/Downloads/wordpress/* mywordpresssite/  # Mac
     xcopy C:\Users\YourUsername\Downloads\wordpress\* C:\xampp\htdocs\mywordpresssite /E /I # Windows
    

Step 4: Create a Database

  1. Open http://localhost/phpmyadmin in your browser.

  2. Click Databases and create a new database (e.g., wordpress_db).

Step 5: Run the WordPress Installer

  1. Open your browser and go to:

     http://localhost/mywordpresssite
    
  2. Select your language and click Continue.

  3. Fill in the required database details:

    • Database Name: wordpress_db

    • Username: root

    • Password: (leave empty by default for XAMPP)

    • Database Host: localhost

  4. Click Submit and proceed with the installation.

  5. You will be prompted to create a wp-config.php file.

  6. Copy and paste the generated configuration code as instructed.

  7. Click Install WordPress.

  8. Login at http://localhost/mywordpresssite/wp-admin.


Final Thoughts

Now you have WordPress installed locally with XAMPP on both Windows and Mac! This setup allows you to develop, test, and customize your WordPress website before deploying it online.

Why use a local WordPress setup?

  • Safe Testing Environment – Experiment without affecting a live site.

  • Offline Development – No internet required.

  • Faster Development – Instantly apply changes without delay.

When you're ready to go live, consider using a web hosting provider to deploy your WordPress site.