Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
25 Million+
Websites using our plugins
Years of WordPress experience
WordPress tutorials
by experts

How to Create a Local WordPress Site Using XAMPP

Editorial Note: We earn a commission from partner links on WPBeginner. Commissions do not affect our editors' opinions or evaluations. Learn more about Editorial Process.

The WPBeginner team regularly creates local WordPress sites on their computers to test themes, plugins, and website functionality without impacting a live site.

XAMPP is a free and open-source software package that provides a user-friendly platform for setting up a local WordPress instance.

In this article, we will show you how to easily create a local WordPress site using XAMPP so you can experiment with WordPress and refine your development skills in a secure environment.

Creating local WordPress install using XAMPP

Why Create a Local WordPress Site?

Creating local WordPress sites is a common practice among developers and site owners. It allows you to test WordPress without creating an actual website on the internet.

Local websites are only visible to you on your computer. You can try different WordPress themes and plugins, test their features, and learn the WordPress basics.

If you already have a WordPress website, then you can create a local copy of your website on your computer to try out new plugin updates before implementing them on your live website.

Important: A local website will only be visible to you on your computer. If you want to make a live website, then you’ll need a domain name and WordPress hosting.

Follow the step-by-step instructions in our guide on how to start a WordPress blog when you are ready to create a live website.

Having said that, let’s check out how to install WordPress locally on Windows, Mac, or Linux using XAMPP.

What Is XAMPP?

XAMPP is a software package that includes all the things you need to set up a local server environment on your computer.

In order to create a local WordPress site, you need to set up a web server software (Apache), PHP, and MySQL on your computer.

PHP is a programming language, and MySQL is a database management software. Both of them are required to run WordPress.

Installing them separately is quite difficult for beginners. This is where XAMPP comes in.

XAMPP makes it easy for you to build WordPress websites locally. It is available for Windows, Mac, and Linux-based computers.

Let’s get started by installing XAMPP and setting it up to run your local WordPress site.

Installing XAMPP on Your Computer

First, you need to visit the XAMPP website and click on the ‘Download’ button for your operating system.

Download XAMPP to your computer

Depending on your operating system, your installation wizard and the application interface may differ from the screenshots here. For the sake of this article, we will show you the Windows version of the software.

After downloading XAMPP, you will need to click and run the installer.

XAMPP set up wizard

XAMPP will ask where to install the software and which packages you’d like to install. The default settings will work for most users. Keep clicking on the ‘Next’ button to finish the setup wizard.

After finishing the wizard, check the ‘start the control panel now’ option and then click on the ‘Finish’ button.

Finish set up and launch XAMPP control panel

This will launch the XAMPP Control Panel app.

Using the XAMPP app, you can run Apache web server as your local server and MySQL as your database server. Go ahead and click on the ‘Start’ button next to both Apache and MySQL.

Start Apache and MySQL to launch your local server

XAMPP will now start Apache and MySQL.

You may see a Windows firewall notification. It is important that you click on the ‘Allow Access’ button for both applications to run on your computer.

Allow firewall access to Apache and MySQL

Once both applications are started, their names will be highlighted in green.

Now, you are ready to create a local website and install WordPress using XAMPP.

Creating a Local WordPress Site With XAMPP

First, you will need to download WordPress. Visit the website and click on the ‘Download WordPress’ button.

Download WordPress

After downloading WordPress, you need to extract the zip file, and you will see a wordpress folder.

You need to copy this folder.

WordPress folder

Next, head over to your XAMPP installation folder.

On Windows, it will be C:/Program Files/XAMPP/htdocs or C:/Xampp/htdocs.

On Mac, it will be /Applications/XAMPP/htdocs.

Paste the wordpress folder you copied earlier inside the ‘htdocs’ folder.

We recommend renaming the ‘wordpress’ folder to ‘website’ or anything else. This will help you easily identify your local site.

Rename WordPress folder

Next, you need to open your favorite web browser.

You can enter the following URL into your browser’s address bar:


If you renamed the WordPress folder something else, then make sure you replace ‘website1’ with your own folder name.

This will load the WordPress installation wizard, and you’ll be asked to select a language. After selecting a language, click on the ‘Continue’ button.

Select language

On the next screen, you will see the WordPress welcome screen.

It includes a notice that WordPress needs a database name, database username, password, and host information.

WordPress installation requirements

Let’s create a database for your WordPress site.

You’ll need to open a new browser tab and visit https://localhost/phpmyadmin/.

This will launch the phpMyAdmin app that comes pre-installed with XAMPP. It allows you to easily manage your databases using a simpler interface.

You need to click on ‘Databases’ and provide a name for your new database. After that, click on the ‘Create’ button to continue.

Creating a database for your local WordPress site

Now that you have created a database, you can use it for your WordPress site.

Switch back to the /localhost/website1/ browser tab and click on the ‘Let’s Go’ button.

On the next screen, you will be asked to provide your WordPress database information.

Enter the database name you created earlier. Your username is ‘root’, and you should leave the password field blank. For the database host field, you need to use localhost.

Enter your WordPress database information

Once you are done, click on the ‘Submit’ button to continue.

If you are on Windows or Linux, WordPress will now store these settings in your WordPress configuration file called wp-config.php.

However, if you are on a Mac, then it will show you the contents of the file and will ask you to create it.

You will need to create this file in your website’s root folder.

After creating the file, paste the text you copied earlier inside it. Next, you need to save the file and return back to the WordPress installer to continue.

In the next step, WordPress will ask you to provide information about your website. First, enter the title you want to use for this site.

After that, you need to enter a username, password, and email address for your admin account.

Enter your local site information

Once you have filled in all the information, click on the ‘Install WordPress’ button to continue.

WordPress will now run the installation and prompt you to log in once it’s done.

You can log in to your website by going to the /localhost/website1/wp-admin page and using the username and password that you entered during installation.

WordPress login page

Things to Try After Creating a Local WordPress Site

Now that you have created your local WordPress site using XAMPP, you can work on it like you would on a live WordPress site.

Head over to the Appearance menu in the WordPress admin sidebar to customize your site’s appearance or install a new theme.

Here are some great free themes that you can try.

The next thing you would want to try is installing some WordPress plugins.

Plugins are like apps for your WordPress site and allow you to add cool features like a contact form, social media buttons, an eCommerce store, and much more.

Need help installing plugins? See our step-by-step guide on how to install a WordPress plugin.

Bonus: Moving Local WordPress Site to Live Server

After working on your local WordPress site, you may want to move it to a live server to make your first WordPress blog or website.

To do that, you’ll need a domain name and web hosting account. Normally, a domain name costs $14.99, and website hosting starts at $7.99 per month.

That’s too much if you are just starting out.

Luckily, Bluehost is offering WPBeginner users a free domain name with a generous discount on hosting. Basically, you can get started for $1.99 per month.

For more hosting recommendations, take a look at our complete WordPress hosting guide.

Once you have signed up for hosting, you can follow our step-by-step guide on how to move WordPress from a local server to a live site.

You may also want to look at alternate ways to create local WordPress sites on Windows using Wampserver and on Mac using MAMP.

Expert Guides on Local WordPress Sites

Now that you know how to create a local WordPress site using XAMPP, you may like to see some other guides related to local WordPress installations.

We hope this article helped you learn how to create a local WordPress site using XAMPP. You may also want to see our guide on why you should use WordPress for your website or our expert picks for the best free website hosting.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us. Here's our editorial process.

Editorial Staff

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

The Ultimate WordPress Toolkit

Get FREE access to our toolkit - a collection of WordPress related products and resources that every professional should have!

Reader Interactions

180 CommentsLeave a Reply

  1. Syed Balkhi says

    Hey WPBeginner readers,
    Did you know you can win exciting prizes by commenting on WPBeginner?
    Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
    You can get more details about the contest from here.
    Start sharing your thoughts below to stand a chance to win!

  2. kzain says

    Wow! Setting up a local WordPress site seems much easier now!
    Got a quick question though. If I encounter any common issues during the setup process what’s the best way to troubleshoot them?

    • WPBeginner Support says

      It would depend on the error if it is coming from XAMPP or WordPress as there are different common issues for either. We do not have an overall troubleshooting guide for that at the moment.


  3. Moinuddin Waheed says

    I have been using xampp for a long time and first time when I installed it , it was for running php code.
    I have also used it for wordpress local environment for understanding and developing websites locally.
    one thing that has bother me regarding wordpress installation is username and password.
    why we keep user as root and password blank?
    this is not the case for live servers though?

    • WPBeginner Support says

      It is not something that you would use for a live site but the username being root and the password being blank is the defaults for XAMPP. As your local site would only be active on your computer you do not need to change it for your local XMPP installation.


  4. Jiří Vaněk says

    Sometimes I use XAMPP. The only problem I sometimes encounter is shared hosting, to which the website is migrated from localhost. The problem is that the PHP limits are not always set in the same way on the shared server, or even the PHP version does not match (on the local 8.x and on the server, for example, the old version 7.x). This can often cause a problem in the functionality of the website, which was debugged on a different PHP than the one on the server. That’s probably the only flaw.

  5. Donatas says

    Hi, I have used these Xampp instructions to create a server on a PC (Windows 10 Education N). Everything worked perfectly fine and it’s a very useful article. I stuck in one place because I thought the database credentials folder had to be manualy created on Windows the same way it has to be on a Mac but these steps were exclusively for Mac. Thanks a lot!

Leave a Reply to WPBeginner Support Cancel reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.