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

How to Create a Local WordPress Site Using XAMPP

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 WordPress.org 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:

https://localhost/website1/

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

182 CommentsLeave a Reply

  1. André Bruwer

    Hi there WPBEGINNER SUPPORT

    Great article thank you :)

    I was wondering… is it better to develop a wp website for a client live or better to build it locally then transfer it to the hosted wp site with duplicator or something similar?

    Any advise would be greatly appreciated. Can’t figure this one out.

    Thanks
    André

      • demola

        pls i want to move my wordpresite from my laptop to another laptop i use xamp as a local server

  2. Thomas James Keely

    I was up and running within minutes. Thank you so much!!!

  3. Chaitra

    Hi, I am getting following error when I connect to localhost/website1
    You don’t have permission to access /website1/ on this server.
    Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.

  4. Chaitra

    Hi, I get the following error when I access localhost/website1 –
    You don’t have permission to access /website1/ on this server.
    Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.

  5. Jay

    your article is very helpful for wp beginner.

  6. rocky

    Thanks for the Knowledge but how can i make it live through Xampp. Let us know if theres any tutorial

    • bala

      yes there is a way to put your localhost online, you should redirect your domain name to your computer’s ip address

  7. Jojo

    Hi,
    I followed your tutorial and created a wordpress site. How can I create another local wordpress site with this setup?

  8. sekar ramu

    Thanks. Simple and Straightforward

  9. Eleazar

    Hi Guy. Your tutorial is very straightforward. I liked it. Very clear and easy to follow. Tkanks

  10. Jerry

    Very straight forward tutorial! Thank you.

  11. krishan pal singh

    Very helpful tutorial for me… Thank you so much :)

  12. paul

    hi, i have been able to login to wordpress using xampp, but when i click on the themes area i only see three themes. when i try to install a new theme, im notified that there is an error. please i need your help.

  13. Shamrat Hossain

    This article was really helpful for me . Hope You will be doing good works like this for us in future ..

    Thanks

  14. Abhijith

    Hi Team

    I have problem with xampp server once installation itz working fine after shutdown if am going to using again in the xamm server buttons not working
    it asking again and again tomcat file….please let me know how to fix it

  15. Suraj Barthwal

    you’r article was really helpful. i do have a query for you though, what should i do if i wanted to extract my wordpress live website so i could use it in future.

  16. Mario Bergeron

    Hi,

    Thanks for your article really helpful. Everything works fine, installation etc., but I try to install a theme on my WP and i got this message ”The uploaded file exceeds the upload_max_filesize in php.ini.” What can I do to install my theme??

    Thank you to help me.

    Mario Bergeron

  17. JERSon

    Hi ALL,

    im stuck at localhost/website1 …it will give the error page

    This site can’t be reached
    localhost refused to connect.
    Search Google for localhost website1
    ERR_CONNECTION_REFUSED

    Please help

    • Innocent

      Make sure your apache and mysql is running. Then try again

  18. Emmanuel

    Hello WordPress, I have installed and used Xampp yesterday and it worked very fine but whike trying to open and use it today, its taking back to the installation process and asking for a new storage location. How do I go about this?

  19. ayush singh chauhan

    Sir , when i try opening localhost/website1
    then something else opens which is not similar to yours.
    that is showing index of website ..
    what should i do now

  20. Stanley

    When I finish with a website and wish to build another different website, how do I go about it? Thanks.

    • WPBeginner Support

      Hi Stanley,

      Create a new folder for your website inside htdocs folder and repeat all the steps mentioned under ‘Creating a Local WordPress Site with XAMPP’ section.

      Admin

  21. Jonathan Pienaar

    Great tutorial, and works 99% for Linux. (I had to create wp-config.php manually for some reason).

    Only other issue: trying to use the Elementor Page Builder plugin, but it requires an FTP login/password. Tried starting FTP server, but can’ figure out how to configure it so that I can give Elementor FTP access/download the plugin.

    (Hope this makes sense).

  22. Bhagwat Pawar

    nice and practically perfect. can i add email functionality here installing gmail smtp or wp smtp plugin

  23. Jane

    This was so easy to follow. Thank you very much,

    When I want to upload a theme in my new wordpress I get this error: ‘The uploaded file exceeds the upload_max_filesize directive in php.ini.’

    Can I do anything about this?

  24. Kumar

    Thank you! Wonderfully detailed step-by-step instructions. Was able to install Wordpress on my local machine without a problem. Much appreciated.

  25. Julie

    I am having the same problem James had:
    Hi! I have successfully installed my xamp server, wordpress and database. My question is, after logging in to wordpress, I cannot see any dashboard panel wherein I can edit my themes and install plugins. Please help! Thanks.

    Has anyone found a solution?
    Thanks!

  26. Eleonro

    Hi, I have issues at login, when I try to log on, wp server says its invalid, what can I do?

  27. James

    Hi! I have successfully installed my xamp server, wordpress and database. My question is, after logging in to wordpress, I cannot see any dashboard panel wherein I can edit my themes and install plugins. Please help! Thanks.

  28. Ruma

    when I am submitting my data base name,username and password it is saying try again i have written each and every thing right name

    • Kenny

      Leave the password space blank

  29. Dani

    To anyone having an issue with the localhost/website1 link not working, how I got it to work (on mac, might work for windows) was heading over to the Network tab in XAMPP and pressing enable. Then I took the port number (in my case it was localhost:8080) and then added that to the url. It looked like localhost:8080/website1.

    Good luck!

    • Maria

      Dani, Thanks so much for your post. I was having the same issue. After reading your post, I was able to get to the next step. few!

  30. Hillary

    I have set up the WordPress website, but yet i am still having issues upload some plugins that come with the themes i want to use. How do i get to correct this?
    Thanks

  31. Maheshwaran

    Thanks you so much.. Your step by step contents helps me lot.

  32. Nicholas

    Thanks you so much ..
    But i have faced one problem, after putting WordPress files into htdocs, i went to my browser and searched for “localhost/WordPress ” and i got ” error 404 Object not found ” how can i please fix that problem?
    Thanks

    • Amokola Stephen

      Did you start services in your local server(xamp)? if not please navigate xamp control panel and make sure that you start apache and mysql services

  33. Alexander

    I really like your post, thank you for sharing such a great post. Setting up wordpress website on localhost using XAMPP is the best solution you have. It gives you an option to explore themes and plugins as well. When i was researching how to work on localhost i have found two great resources through which anyone can easily learn to launch wordpress using localhost.
    https://www.wpbeginner.com/wp-tutorials/how-to-create-a-local-wordpress-site-using-xampp/

  34. Aligo

    Thank you very much for this article.. I really followed it and was successful in creating the website

  35. DavidA

    Thank you for this article — it is great to be able to work at the website locally before exposing it to the world.

    Is it possible to have more than one website locally? I have another site that I need to modify/see locally. How would I add this to the other without getting them mixed?

    Thank you

      • DavidA

        Thank you – the WPBeginners site/articles/support team have been a God-send.
        Please keep doing what you are doing!(:0)!

      • Stanley

        Thanks at WP team. I added another WordPress folder and it’s not working. I named this second folder Wordpress1 since the first site database is WordPress and it didn’t work. Please, do help. Thanks.

        • WPBeginner Support

          Hi Stanley,

          Do you see an error when you visit the website in your browser?

  36. Trifina

    For Mac users you recommended:

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

    Can you elaborate? Where can i find this folder?

    • WPBeginner Support

      Hey Triffina,

      Normally, your XAMPP website folders are stored in /Applications/XAMPP/xamppfiles/htdocs/ folder.

      Admin

  37. Ann

    followed all the steps but when i put “localhost/website1”, it shows an error saying “Error establishing a database connection”, also tried restarting my xampp, yet still the same problem exist.

  38. Mike

    Get an Object not found message when I put the localhost/website1 in my browser. It reads the following:

    Error 404

    localhost
    Apache/2.4.25 (Win32) OpenSSL/1.0.2j PHP/5.6.30

    Any ideas guys?

    Thanks

  39. Chris

    good afternoon,
    thank you for your article. It was easy to follow. I have managed to install WP offline on my pc but I cannot figure out how to login to wp-admin and start working offline.
    I know you mentioned that we should login at /localhost/etc…. but where do I enter that? do I open it on my browser?

    thank you

  40. Amy

    Hi, thanks for this great tutorial.
    I need to update the php.ini as I am getting the error ‘The uploaded file exceeds the upload_max_filesize directive in php.ini.’ how do I find this on localhost ?
    Thanks!

  41. Ratnesh Tripathi

    Great article sir, but I am not able to login into WordPress admin panel.
    Please provide solution

  42. Mike

    am not getting the welcome to word press page what’s wrong, it’s got — Index of /website1 —at the top

  43. abdulmuluq

    please it showing me database not found when I try to input database name in my wp

    • sam

      Yeah, It happened to me too. You’ve gotta create your database name in the localhost/phpMyAdmin section in your browser before going back to fill the pieces of information and also the username will be root and the password will be empty. You’re good to go

  44. divp

    Good one thanks for sharing

  45. Raymart

    Which is much faster, XAMPP or WAMP?

  46. Shaedar

    Thanks for the detailed guide… i followed the steps as outlined above an it all worked out well until i tried to launch wordpress on my browser by entering “localhost/website1” Instead of launching, its showed “Index/website1”
    please what could be the problem?

    • WPBeginner Support

      Hi Shaeder,

      Try to restart XAMPP, make sure you copied the WordPress folder and the website1 folder actually contains your WordPress files.

      Admin

      • Shaedar

        Thanks so much… working perfectly now.

  47. Rodney Lacambra

    Having a local WordPress site is great hence testing functionality, plugins, and themes before making it live.

    It’s also much faster compare to live.

    Thanks, great article.

  48. Paul Guzman

    This worked to perfection. Can’t believe I actually did this. Instructions were “Right On”. This made my day!

  49. Soham Pratap

    Much creative way to just design put up the content … experiment and when you are done!! get your site online

  50. Om

    What about Wampserver is it the same ?

    • WPBeginner Support

      WAMPserver is also an Apache distribution maintained by different folks. But yes it also allows you to create local WordPress sites on your Windows computer.

      Admin

Leave A 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.