How to Install WordPress Step by Step Locally with XAMPP

Contents

How to Install WordPress Step by Step Locally with XAMPP

Installing WordPress on your local computer is an excellent way to create a sandbox for development, testing, or learning how WordPress works—without affecting a live site. In this comprehensive guide, we’ll walk you through each step of setting up XAMPP on Windows, Mac, or Linux, configuring a database, and installing WordPress locally.

Prerequisites

  • Basic familiarity with file systems and running installers.
  • Administrator (or sudo) access to install software.
  • Internet connection to download required packages.

1. Download XAMPP

Visit the official XAMPP website to ensure you get the latest stable release:

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

Platform PHP Versions Size
Windows 7.4, 8.0 150 MB
macOS 7.4, 8.0 170 MB
Linux 7.4, 8.0 140 MB

2. Install XAMPP

  1. Run the installer you downloaded.
  2. Select components Apache, MySQL, phpMyAdmin, and PHP. Others are optional.
  3. Choose an installation path (default is usually C:xampp on Windows or /Applications/XAMPP on macOS).
  4. Allow firewall permissions if prompted.
  5. Finish the setup and launch the XAMPP Control Panel.

3. Start Apache and MySQL

In the XAMPP Control Panel, click Start next to Apache and MySQL. Both modules should turn green, indicating they’re running.

4. Create a Database for WordPress

WordPress requires a MySQL (or MariaDB) database.

  1. Open your browser and go to http://localhost/phpmyadmin.
  2. Click Databases at the top.
  3. Under Create database, enter a name like wordpress_db.
  4. Select utf8mb4_unicode_ci as the collation for full Unicode support.
  5. Click Create.

5. Download WordPress

Get the latest WordPress package from the official source:

https://wordpress.org/download/

Save the ZIP file to your computer and extract it.

6. Move WordPress Files into XAMPP

  1. Locate your XAMPP installation’s htdocs folder (e.g., C:xampphtdocs or /Applications/XAMPP/htdocs).
  2. Create a new folder, e.g., mywp.
  3. Copy all extracted WordPress files into this mywp folder.

7. Configure wp-config.php

  1. Inside mywp, rename wp-config-sample.php to wp-config.php.
  2. Open wp-config.php with a text editor.
  3. Update the following lines with your database info:
    define(DB_NAME, wordpress_db)
    define(DB_USER, root)
    define(DB_PASSWORD, )     // default is empty for XAMPP
    define(DB_HOST, localhost)
          
  4. Save and close the file.

8. Run the WordPress Installer

  1. In your browser, navigate to http://localhost/mywp/.
  2. Select your language and click Continue.
  3. Fill in the Site Title, Username, Password, and Email.
  4. Click Install WordPress.
  5. Upon success, click Log In to access your local WordPress dashboard.

9. Post-Installation Tips

  • Permalinks: Go to Settings → Permalinks and choose a friendly structure (e.g., Post name).
  • Debug Mode: For development, enable WP_DEBUG in wp-config.php:
    define(WP_DEBUG, true)
          
  • Backups: Even local sites benefit from periodic backups of wp-content and the database.

10. Useful Resources

Conclusion

Following these steps, you now have a fully functional WordPress installation running locally via XAMPP. This environment is ideal for theme and plugin development, testing updates, or practicing WordPress management in a safe, offline setting. Happy building!



Acepto donaciones de BAT's mediante el navegador Brave 🙂



Leave a Reply

Your email address will not be published. Required fields are marked *