Want to try WordPress (WP) in a local environment? We’ve compiled simple setup steps using XAMPP for you. To keep first-timers from getting lost, we’ll explain each step in order.

1. Installing XAMPP and initial setup

First, install “XAMPP,” the environment for running WordPress. Installation is explained in this article. It also covers how to display a site in your local environment, so please complete those settings first.

2. Creating a database (DB)

To run WordPress, you need a “database.” The database stores posts, user information, and settings. XAMPP includes a database management tool called “phpMyAdmin,” so let’s use it to create a new database.

Step 1: Access phpMyAdmin

  1. Open your browser and enter http://localhost/phpmyadmin/ in the address bar.
  2. When the page appears, click “New” or “Create database” in the left menu.

Step 2: Choose a database name and create it

  1. In the “Database name” field, enter a name you like.
    Example: wp_test
    Note: Use only ASCII letters, numbers, and underscores ( _ ). Avoid Japanese characters and symbols.
  2. For the character set (collation), we recommend “utf8mb4_general_ci.”
    Note: If you can’t select it, “utf8_general_ci” is fine.
  3. When you’re done, click the “Create” button.

Step 3: Confirm creation

  • If the database list shows the name you entered (e.g., wp_test), you’re good.

Notes

  • You’ll use the database name later in WordPress settings (wp-config.php), so be sure to remember it.
  • If you run multiple WordPress sites on a single XAMPP, you can create a separate database for each one.

3. Placing the WordPress core files

  1. Download the latest WordPress from the official WordPress site.
  2. Unzip the downloaded ZIP file, then place the entire extracted folder into the folder you created in “1. Installing XAMPP and initial setup.”

Folder structure after placement

htdocs
 ├─ wp-site(folder)
     └─ wp-admin
     └─ wp-content
     └─ wp-includes
     └─ many configuration files

4. About the WordPress core file hierarchy (files you may edit vs. must not edit)

To understand how WordPress works, it’s important to know “where files and folders are” and to distinguish between what you can edit and what you shouldn’t. Knowing this helps prevent mistakes and trouble.

Main WordPress folder structure

After installing WordPress, you’ll see folders and files like the following:

/wp-admin
/wp-content
/wp-includes
index.php
wp-config.php
.htaccess
... (other files and folders)

Main files and folders you may edit

When customizing as a beginner, basically just remember these three.

  • wp-content/
    This is where themes, plugins, and uploaded files (images, etc.) go.
    Most customization happens here.
    Example: Put your custom or downloaded theme in wp-content/themes/.
  • wp-config.php
    This contains important settings for running WordPress, such as the database name, username, and password.
    Adjust it slightly to match your XAMPP environment at the start.
  • .htaccess
    A special file used for settings like “Permalinks” (clean URLs) and security.
    You’ll edit it directly less often, and it may be overwritten automatically by the Permalink settings.

Files and folders you should not edit (as a rule)

Editing these can stop WordPress from working or cause errors.
When customizing or building a site, do not edit them as a general rule.

  • wp-admin/
    Contains files related to the WordPress admin screen. Never edit directly.
  • wp-includes/
    Contains WordPress’s core functions and processes. Do not touch this either.
  • Other core files
    Files like index.php should basically be left as-is.

Why shouldn’t you edit them?

These files and folders are the “heart” of WordPress, and they’re often overwritten automatically during updates or when installing plugins.
If you edit them directly, your changes may be lost with each update, or in the worst case, the site may break.

5. Editing wp-config.php

When you first set up WordPress, copy and rename wp-config-sample.php to wp-config.php.

  1. Rename wp-config-sample.php to wp-config.php.
  2. Open it in an editor and adjust the following to match your environment.
// Example
define( 'DB_NAME', 'wp_test' );     // DB name you created in “2. Creating a database (DB)”
define( 'DB_USER', 'root' );        // Default in XAMPP is "root"
define( 'DB_PASSWORD', '' );        // Default is blank
define( 'DB_HOST', 'localhost' );
define( 'DB_CHARSET', 'utf8mb4' );
define( 'DB_COLLATE', '' );
  1. Save and close.

6. Editing .htaccess

.htaccess is an important file that controls permalinks, redirects, and more.

  • If you change the Permalink settings in the WordPress admin, it will be generated automatically. If you don’t need special tweaks, just use it as-is.
  • If you see “Cannot write to .htaccess,” then:
     1. Create an empty text file in Explorer/Finder and save it as .htaccess
     2. Place it in the root of your WordPress directory
     3. Copy and paste the required content from the admin screen

7. How to access your local site & initial setup

After setting up WordPress with XAMPP, access it from your browser and complete the initial setup.
Here we’ll walk through the flow step by step so first-time users won’t get confused.

Step 1: Access WordPress

  1. Open your browser
    Launch your usual browser such as Google Chrome, Edge, or Safari.
  2. Enter the URL
    In the address bar, specify the folder name where you installed WordPress and the port number. http://localhost:port-number

Step 2: Fill out the first-time setup screen

On your first visit, the WordPress setup (installation) screen will appear.

  1. Site title
    Enter the name of your WordPress site (you can change it later).
  2. Username and password
    Choose and enter the admin username and password.
    Note: You’ll need these every time you log in, so don’t forget them.
  3. Email address
    Enter an admin email address.
    Since this is a local environment, your regular email address is fine.
  4. Then click the “Install WordPress” button.

Step 3: Log in to the admin

After installation completes, you can log in to the WordPress admin (Dashboard) from the following URL:

http://localhost:port-number/wp-admin/

Log in with the username and password you set during setup.

Notes

  • Once you’re in the admin, you can publish posts, add themes and plugins, and change various settings.
  • Sites created in a local environment aren’t visible from other computers or the internet.
    It’s perfect for practice and testing!

8. Common errors and fixes

  • Error establishing a database connection
     → Check wp-config.php for DB name, username, password, and host.
  • Permalink settings don’t take effect
     → Recheck the write permissions and contents of .htaccess.
  • Can’t access the admin
     → Clear cookies, clear cache, or try a different browser.

Summary

Once you experience setting up WordPress locally with XAMPP, you’ll get used to it quickly.
Even if you run into questions or errors, don’t panic—review things one by one.
Make the most of your own test environment and freely practice and customize!