Skip to main content

Installing WordPress Locally

· 2 min read
Shashi K
Depp Web @ Internet

Setting up WordPress on a local machine allows you to test and develop in a private environment before going live. Here’s a step-by-step guide.


Prerequisites

  1. Download XAMPP or MAMP:
    • For Windows/Linux: Use XAMPP.
    • For Mac: Use MAMP.
  2. Download WordPress:
    Go to wordpress.org and download the latest version.

Step 1: Install XAMPP or MAMP

  1. Run the installer and follow the prompts to install.
  2. Start the Apache and MySQL services from the XAMPP/MAMP control panel.

Step 2: Create a Local Database

  1. Open a browser and go to http://localhost/phpmyadmin.
  2. Click on Databases.
  3. Enter a database name (e.g., wordpress_db) and click Create.

Step 3: Setup WordPress Files

  1. Unzip the WordPress download.
  2. Move the WordPress folder to:
    • For XAMPP: C:/xampp/htdocs/wordpress
    • For MAMP: /Applications/MAMP/htdocs/wordpress

Step 4: Configure WordPress

  1. Open http://localhost/wordpress in your browser.
  2. Select your language and proceed.
  3. Fill out the database details:
    • Database Name: The name you created (e.g., wordpress_db)
    • Username: root
    • Password: (Leave blank for XAMPP, use root for MAMP)
    • Database Host: localhost
  4. Click Submit and then Run the installation.

Step 5: Complete the Installation

  1. Enter your Site Title, Username, Password, and Email.
  2. Click Install WordPress.

Step 6: Access Your Local Site

To view your site, open http://localhost/wordpress in a browser. For admin access, go to http://localhost/wordpress/wp-admin.


Troubleshooting Tips

  • If XAMPP/MAMP doesn’t start, make sure no other programs are using port 80 (Apache) or port 3306 (MySQL).
  • If you encounter a blank screen, try renaming the wp-config-sample.php file to wp-config.php and manually enter your database details.