Site icon Rashed Hossain

How to Install WordPress on Localhost (XAMPP/MAMP)

If you’re just getting started with WordPress and want to build or test a site without buying a domain or web hosting, installing WordPress on your local computer is a great option. This is known as using localhost.

To do this, you’ll need to use software like XAMPP (for Windows/Linux) or MAMP (for macOS). These tools create a local server environment on your computer, which is necessary for running WordPress.

Let’s go through the steps one by one.


Step 1: Download and Install XAMPP or MAMP

For Windows or Linux users:

  1. Go to https://www.apachefriends.org
  2. Download XAMPP for your operating system.
  3. Open the installer and follow the installation steps.
  4. Once installed, launch the XAMPP Control Panel and start both Apache and MySQL.

For macOS users:

  1. Go to https://www.mamp.info
  2. Download MAMP.
  3. Install it and open the application.
  4. Start the servers (Apache and MySQL).

Step 2: Download WordPress

  1. Visit https://wordpress.org/download/
  2. Download the latest version of WordPress as a zip file.
  3. Extract the folder after downloading.

Step 3: Move WordPress Folder to the Server Directory


Step 4: Create a Database

  1. Open your web browser and go to http://localhost/phpmyadmin
  2. Click on Databases at the top.
  3. Under “Create database”, type a name like mywordpress and click Create.
  4. That’s it—you’ve created a database for WordPress.

Step 5: Start the WordPress Installation

  1. Now, open your browser and go to http://localhost/mywebsite (replace mywebsite with the folder name you used).
  2. You’ll see the WordPress setup screen.
  3. Choose your language and click Continue.
  4. On the next screen, enter the following database info:
    • Database Name: the name you just created (e.g., mywordpress)
    • Username: root
    • Password: leave this blank (for XAMPP and most MAMP setups)
    • Database Host: localhost
    • Table Prefix: leave as is (wp_)
  5. Click Submit, then click Run the Installation.

Step 6: Set Up Your WordPress Site

  1. Fill in the site title, username, password, and email address.
  2. Click Install WordPress.
  3. After installation, click Log In.
  4. Enter the username and password you just created, and you’ll be taken to your WordPress dashboard.

You’re Done!

Now you can use WordPress on your local computer, create pages, test themes and plugins, or build a complete website—all without needing an internet connection.

This is great for learning WordPress, developing websites, or trying out changes before going live.

Exit mobile version