WordPress Basics

How to Install WordPress Locally

A beginner-friendly, step-by-step guide to running WordPress on your own computer

Installing WordPress locally lets you build, test, and break things on your own computer without paying for hosting or risking a live site. It’s the perfect sandbox for beginners and a fast development lab for experienced users.

In this guide, you’ll learn how to install WordPress on your laptop or desktop using two common approaches: an all-in-one tool like Local, and a more manual setup with XAMPP or MAMP. You’ll end up with a fully working WordPress site that only you can access from your machine.

We’ll cover every step—from installing the local server to running the WordPress setup wizard and fixing common errors—so you can confidently practice WordPress before going live with a real website.

Prerequisites

Before you start, make sure your computer and environment are ready for a local WordPress install.

  • A computer running Windows, macOS, or Linux.
  • Administrator rights so you can install new software.
  • At least 2–3 GB of free disk space for server software, WordPress, and a test site.
  • A stable internet connection (for downloading tools and WordPress).
  • Optional: A code editor (VS Code, Sublime Text, etc.) if you plan to tweak theme or plugin files.
[strong]Note:[/strong] A local WordPress site is only visible on your own machine by default. You still need web hosting later if you want a public website.

Step 1: Decide How You Want to Run WordPress Locally

There are two main ways to run WordPress on your computer. Your choice affects how many moving parts you manage and how easy it is to maintain your setup.

Option 1: Use a dedicated local WordPress tool (recommended)

Tools like Local (formerly Local by Flywheel) are designed specifically for WordPress. They install a complete local server stack for you and provide a simple interface to create and manage sites.

  • Pros: Beginner-friendly, fewer manual steps, quick to create new sites, supports SSL, different PHP versions, and easy site cloning.
  • Cons: Less control over low-level server configuration.

Option 2: Use a general local server stack (XAMPP, MAMP, WAMP)

These tools install Apache, PHP, and MySQL/MariaDB (the same components used by many web hosts). You then install WordPress manually inside that environment.

  • Pros: Very close to a typical hosting environment, more control, useful for learning server basics.
  • Cons: More steps, you must manage databases and WordPress files yourself.
[strong]Pro Tip:[/strong] If you’re new to WordPress, start with Local. You can always move to a manual XAMPP/MAMP setup later once you’re comfortable.

Step 2: Install Your Local Server Software

This step covers installing either a dedicated WordPress tool (Local) or a generic stack (XAMPP/MAMP). You only need to follow one path.

Install Local (beginner-friendly path)

  1. Visit the Local website from your browser.
  2. Download the installer for your operating system (Windows, macOS, or Linux).
  3. Run the installer and follow the on-screen instructions. Accept the default options unless you have a specific reason to change them.
  4. Launch Local once the installation finishes.

When Local opens for the first time, you’ll see its dashboard where you can create and manage sites.

Install XAMPP or MAMP (manual path)

  1. Search for the official XAMPP or MAMP website and download the installer for your OS.
  2. Run the installer and complete the setup wizard. Keep Apache and MySQL (or MariaDB) enabled.
  3. Start the control panel and click “Start” for Apache and MySQL/MariaDB.
  4. Open a browser and visit http://localhost/. If you see the XAMPP or MAMP start page, your local server is running.
[strong]Warning:[/strong] If Apache fails to start, another program may already be using port 80 or 443 (often Skype, Teams, or another web server). Change the Apache port in the control panel or stop the conflicting app, then try again.

Step 3: Create a New Local WordPress Site

Now you’ll create the actual WordPress site. Again, follow the subsection that matches your chosen tool.

Create a site in Local

  1. In Local, click “Create a new site” or the “+ New Site” button.
  2. Enter a site name, such as “my-local-wp”. Local will automatically generate a local domain (for example, my-local-wp.local).
  3. Click “Continue” and choose a preferred environment (the default is usually fine). Advanced users can customize PHP version, web server, and database.
  4. Set your WordPress admin username, password, and email when prompted. Save these details—you’ll use them to log in later.
  5. Click “Add Site” to let Local create the database and WordPress files for you.

Once Local finishes, you’ll see your new site listed in the sidebar with buttons to Start, Admin, and Open Site.

Prepare a site folder in XAMPP/MAMP

  1. Open your local server’s web root:
    • On XAMPP (Windows/macOS): htdocs folder.
    • On MAMP (macOS): htdocs (or the document root directory set in MAMP preferences).
  2. Create a new folder for your site, for example my-local-wp.
  3. This folder will hold your WordPress files in the next step.

Step 4: Add WordPress Files and Create a Database (Manual Setups)

If you’re using Local, it already downloaded WordPress and created a database for you, so you can skip this step. For XAMPP or MAMP, you need to add WordPress files and set up a database manually.

Download WordPress

  1. Download the latest WordPress package as a ZIP file from the official source or follow the detailed instructions in this guide to downloading WordPress.
  2. Extract the ZIP file on your computer. You should see a folder named wordpress with core files inside.
  3. Copy the contents of the wordpress folder into your site folder (for example, htdocs/my-local-wp).

Create a local database

  1. In your browser, go to http://localhost/phpmyadmin.
  2. Click Databases in the top menu.
  3. Enter a database name such as my_local_wp and choose the default collation (usually fine), then click Create.
  4. Optional but recommended: On some setups you may need to create a dedicated database user with a password and grant it all privileges to this database.

Connect WordPress to the database

When you run the WordPress installer (next step), it will ask for your database details. For most local XAMPP/MAMP setups, the defaults are:

  • Database Name: The name you just created (e.g., my_local_wp).
  • Username: root (default for many local setups).
  • Password: Leave blank (if your local server uses no password) or enter the password you set.
  • Database Host: localhost.
  • Table Prefix: wp_ (you can change this if you want).
[strong]Note:[/strong] Always read the notes on your XAMPP or MAMP dashboard—some versions use a password for the root user by default, and you’ll need to use that here.

Step 5: Run the WordPress Installation Wizard

At this point, your local server is running and WordPress files are in place. The installer will complete the setup in just a few screens.

Open the installer in your browser

  • Local: In Local, click Start Site, then click Open Site, and finally go to /wp-admin/ if the installer doesn’t open automatically.
  • XAMPP/MAMP: In your browser, visit http://localhost/my-local-wp/ (replace my-local-wp with your folder name).

Complete the WordPress setup screens

  1. Select your preferred language and click Continue.
  2. Enter the database details if prompted (manual XAMPP/MAMP installs), then click Submit and Run the installation.
  3. Fill in your site details:
    • SEO and UX, and where you will see it in daily work.”>Site Title – for example, “Local Practice Site”.
    • Username – avoid using “admin”; pick something unique.
    • Password – use a strong password, even for local sites.
    • Your Email – used for admin notifications.
    • Search Engine Visibility – you can safely check “Discourage search engines from indexing this site” for a local install.
  4. Click Install WordPress.

When the installer finishes, you’ll see a success message and a button to log in. Use your chosen username and password to access the WordPress dashboard.

Step 6: Tweak WordPress for Local Development

Now that WordPress is running locally, it’s a good idea to adjust a few settings so your environment is easier to use for testing and learning.

Update basic settings

  1. Log in to your local WordPress dashboard at /wp-admin/.
  2. Go to Settings > General and update the site title and tagline to something meaningful.
  3. Go to Settings > Permalinks and switch to Post name for cleaner URLs.
  4. Confirm your timezone, date, and time formats so test content looks realistic.

Enable debugging (optional but helpful)

Debugging helps you see PHP errors and notices while you’re working with themes and plugins. For a local environment, this is very useful.

  1. Open the wp-config.php file in your site folder using a text editor.
  2. Look for the line containing define( 'WP_DEBUG', false );.
  3. Change it to:
define( 'WP_DEBUG', true );

Save the file. WordPress will now display errors and warnings, which can help you catch problems early when developing or testing.

[strong]Pro Tip:[/strong] Treat your local site like a playground. Install themes, try new plugins, and break layouts here first. When you’re ready to go live, you can follow a step-by-step WordPress installation guide for your real hosting account.

Step 7: Common Problems When Installing WordPress Locally

Local WordPress setups are usually straightforward, but a few recurring issues can slow you down. Here’s how to recognize and fix them quickly.

“Database connection error” message

  • Double-check the database name, username, and password you entered in the installer.
  • Make sure the MySQL/MariaDB service is running in XAMPP, MAMP, or your local stack.
  • Verify that the DB_HOST value in wp-config.php is set to localhost unless your stack specifies something else.

“This site can’t be reached” / “ERR_CONNECTION_REFUSED”

  • Confirm that Apache and MySQL are running (or that your Local site is started).
  • Check that you’re using the correct URL:
    • Local: something like https://my-local-wp.local/.
    • XAMPP/MAMP: typically http://localhost/my-local-wp/.
  • Try a different browser or clear your browser cache if you recently changed the local URL.

Port conflicts when starting Apache or Local

  • Look for other software using ports 80 or 443 (Skype, Teams, IIS, other web servers).
  • Change the ports for Apache or Local in their settings (for example, use 8080 instead of 80).
  • Update any bookmarks or shortcuts you use to access the local site after changing ports.
[strong]Warning:[/strong] Never expose a local development site directly to the internet without proper hardening. Local setups are not designed to be production-grade, especially with debug turned on and weak credentials.

Wrap-Up: Your Local WordPress Lab Is Ready

You’ve just installed WordPress on your own computer, set up a working local site, and learned how to tweak it for development. Whether you used an all-in-one tool like Local or a manual XAMPP/MAMP stack, you now have a safe environment to experiment with themes, plugins, and customizations.

Use this local setup to practice building pages, testing layouts, and troubleshooting issues before they ever hit a live audience. When you’re confident in your workflow, you can repeat a similar process on real hosting and move your finished site online.

Further Reading

Frequently Asked Questions

Is a local WordPress site the same as a live website?

No. A local WordPress site runs only on your own computer and is not publicly accessible on the internet. It’s ideal for testing, learning, and development. To make a site public, you’ll still need a domain name and web hosting, then either install WordPress on that host or migrate your local site there.

Do I need a domain name or hosting to install WordPress locally?

You don’t need a domain name or paid hosting for a local installation. Your computer and local server software act as the “host.” Tools like Local or XAMPP create local domains (such as my-local-wp.local or localhost/my-local-wp) that only work on your machine.

Why is my local WordPress site running slowly?

Slow performance can be caused by limited system resources, heavy themes or plugins, or misconfigured local server settings. Close unnecessary applications, disable unused plugins, and keep your PHP version reasonably up to date. For manual stacks, make sure Apache and MySQL have enough memory and aren’t competing with other server software on your machine.

Is it safe to use weak passwords on a local WordPress install?

Even though your local site is private, it’s still best practice to use strong, unique passwords. Malware, shared computers, or accidental exposure of your local environment can turn weak credentials into a security risk, especially if you later migrate that site to a live server without changing them.

How long does it take to install WordPress locally?

Once your server software is downloaded, the actual WordPress installation typically takes 10–20 minutes, including creating the database and running the setup wizard. Tools like Local can be even faster because they automate many of the manual steps involved in configuring the environment.

Related Articles

Leave a Reply

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

Back to top button