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.
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.
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 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.
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.
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.
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.
After downloading WordPress, you need to extract the zip file, and you will see a wordpress
folder.
You need to copy this 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.
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.
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.
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.
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.
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.
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.
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.
- Glossary: Localhost
- How to Install WordPress Locally on Mac (2 Easy Ways)
- How to Install WordPress on a Windows Computer (2 Methods)
- How to Move WordPress From Local Server to Live Site (2 Methods)
- How to Move a Live WordPress Site to Local Server
- How to Receive WordPress Emails from Localhost with SMTP
- How to Reset WordPress Admin Password on Localhost
- How to Easily Create a Staging Site for WordPress (Step by Step)
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.
Olaf
I really enjoy using XAMPP because it provides a perfect offline environment where you can develop an entire website, and after completion, you just need to migrate it to a live domain. Sometimes, I take my laptop to presentations to show clients the website directly in the localhost environment. It’s also great for basic learning with WordPress. You don’t need a domain, you don’t need hosting, just a computer and an operating system, and you can spend hours learning to work with WordPress completely free. And if someone can build a website on localhost, they’ll be able to handle the migration as well.
ran
hi im stuck in installing wordpress
Not Found
The requested URL was not found on this server.
Apache/2.4.58 (Win64) OpenSSL/3.1.3 PHP/8.2.12 Server at localhost Port 443
please help
WPBeginner Support
That error most commonly would be if you have a typo in your URL for the site. Please be sure to double check that you are using the correct name for your folder if you named it something other than what we have in our article.
Admin
kzain
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
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.
Admin
Moinuddin Waheed
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
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.
Admin
Jiří Vaněk
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.
Donatas
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!
WPBeginner Support
You’re welcome, glad our guide was helpful!
Admin
Paul
After having created the database and entered the database connection details, hitting submit gets me this message “There has been a critical error on this website”. Checked everything twice, what should I do?
Thank you for your attention.
WPBeginner Support
For a fresh install, you would want to check the error log for XAMP to help narrow down the specific reason.
Admin
John
Error logs didn’t help. But, as it turns out, for some reason, the most recent version of Xampp caused the same “critical error” response to happen for me too. I ended up uninstalling that version and went with the previous version of Xampp and presto! It works.
lee kent
Hello. If I were to follow these steps and then decide i wanted to make another site, How would you create a new website locally?
WPBeginner Support
You would create a new folder and database and install the site in the new folder.
Admin
Smita
Thanks for detailed steps. Very useful.
WPBeginner Support
Glad our guide was helpful
Admin
Tife
Can I use local Host to develop my custom wordpress theme also.
WPBeginner Support
You can if you would like.
Admin
priyanka
I’m getting this error
Your server is running PHP version 5.6.3 but WordPress 5.5.3 requires at least 5.6.20.
p/lease help
WPBeginner Support
It is saying you want to upgrade the PHP you are using for your site to remove that error.
Admin
tarun
I get the following error, when I run http://localhost/mysite/wp-admin/setup-config.php
One or more database tables are unavailable. The database may need to be repaired.
I tried to do global search for “WP-config” file in my xampp folder but just found “wp-config-sample”. though I added the below line in
“wp-config-sample.php” file
// define(‘WP_ALLOW_REPAIR’, true);
not really sure what to do after that.
WPBeginner Support
You would want to open phpMyAdmin and run the repair on all of your tables and if that does not work you would need to reach out to XAMPP’s support
Admin
tarun
I am not able to figure out why I am getting this strange error, though I tried to reinstall and connect several times, all I did was I tried to drop my existing database and tried to create a new wrodpress login but All I can see is the following error
One or more database tables are unavailable. The database may need to be repaired.
WPBeginner Support
You would want to try to repair your database, you can also use method 3 in our article below:
https://www.wpbeginner.com/wp-tutorials/how-to-fix-the-error-establishing-a-database-connection-in-wordpress/
Admin
Mohsin Zubair
Hi Sir, I hope you are doing well. I am facing this error while creating data base.
Error
MySQL said: Documentation
Cannot connect: invalid settings.
phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server.
WPBeginner Support
You would want to check your configuration settings to see if it is set incorrectly.
Admin
David
This is exactly what I have been looking for: a local testing server to develop a website without signing up to a plan/paid service first.
The explanations are brilliant and easy to follow. It’s genius! Many thanks.
WPBeginner Support
You’re welcome, glad our guide was helpful
Admin
Ray Silva
I installed wordpress. Then I put the wordpress folder in xampp’s htdocs folder. When I go to localhost on my browser, I get sent to the xampp dashboard and welcome to xampp page.
WPBeginner Support
You may want to try localhost/foldername where foldername is the name of the folder where you placed WordPress to see if that is how it is currently set up.
Admin
Hussain Abbas
Hi
My url to login to Wordpress dashboard is coming as “/localhost/sitename/wordpress/wp-admin” whereas as per the above instructions it should be “/localhost/sitename/wp-admin” .
Would request your help to know how can I remove “wordpess” from the link.
Thanks
WPBeginner Support
For that, you installed the site in a folder named WordPress, if you are just starting out you can reinstall the site without the WordPress folder.
Admin
muhammad waqar
easy and good tutorial for beginners
WPBeginner Support
Glad you found our guide helpful
Admin
Darren Howes
Hi,
Great instructions, complete novice, everything is working apart from when I try to add/upload images I get the the message
Unable to create directory wp-content/uploads/2020/09. Is its parent directory writable by the server?
I am working on a mac, any ideas on how to solve this?
Regards
Darren
WPBeginner Support
You would need to navigate to your XAMPP folder, right-click, and modify your sharing for that folder so that it can be updated.
Admin
marni
When setting up Wordpress I used “admin” as the user name and changed the password supplied by Wordpress. As a precaution I copied the supplied password. I cannot log in with either password (no typing errors).
WPBeginner Support
You should be able to force reset the password using the database method in our guide below:
https://www.wpbeginner.com/beginners-guide/how-to-change-your-password-in-wordpress/
Admin
gaurav sachan
everything is done but database is not created so please me that why are not creting database in my php
WPBeginner Support
You would need to manually create the database in the phpMyAdmin interface
Admin
Dimitris
Hello after following the procedure after the following step:
Next, you need to open your favorite web browser and visit localhost/website1. You will see a page like this:
I get this message on the screen.
Warning: require_once: failed to open stream: No such file or directory
WPBeginner Support
You may need to try unzipping the WordPress files again, the most common reason for this issue is covered in our article below:
https://www.wpbeginner.com/wp-tutorials/how-to-fix-the-wordpress-failed-to-open-stream-error
You can follow our guide for manually updating your site and you wouldn’t need to use FTP to readd the files, our guide on this can be found below:
https://www.wpbeginner.com/beginners-guide/ultimate-guide-to-upgrade-wordpress-for-beginners-infograph
Admin
Muhammad Kamran Khan
after all these setting localhost/website1 started working. after shut down and restarted my laptop now when i go to localhost/website1/wp-admin/ error message came : This site cant be reached. localhost refused to connect.
WPBeginner Support
You would want to ensure XAMPP is running to be able to see your site
Admin
dilshan
This is really helpful because sometimes I want test some plugins but i dont want to install them to my website. I can try them in this local host site thanks to you
WPBeginner Support
Glad our guide was helpful
Admin
Osazuwa
A very helpful tutorial.
I have implemented them
But on loading
Localhost/website1
it displays
Parse error: syntax error, unexpected’.’ expecting ‘&’ or variable (T_VARIABLE) in C:\xampp\htcdocs\website1\wp-includes\functions.php on line 1081
Thanks
WPBeginner Support
You would want to ensure the PHP you are using is up to date for the most common reason for that error.
Admin
Julio Talaverano
Hi,
Yesterday I installed XAMPP and WordPress and I worked a bit on a new page using localhost/wordpress.
I also installed some Plugins in WordPress.
But today when put into the browser localhost/wordpress I just get the Page I created yesterday.
Could you please tell me how I can continue editing my page with WordPress?
Thanks
WPBeginner Support
If we’re understanding your question correctly, you would want to ensure XAMPP is running for your site to be visible when visiting the page.
Admin
Ronny
Hello,
As always your tutorials are great. One question though. How do I make multiple localhosts using Xampp.
Think of me as a noob the this. I’ve read a few other tutorials on the subject, but it seems they assume one would have some deeper understanding of processes.
WPBeginner Support
You would create a folder with a different name in the htdocs folder and follow the steps under the ‘Creating a Local WordPress Site with XAMPP’ section and navigate to the new site’s folder when you want to see the other site rather than your first site.
Admin
Calvin Mutashu
Thanks 4 a clear step by step guide. Keep the good work.
WPBeginner Support
You’re welcome, glad you liked our guide
Admin
Anjuli
Hello! My browser cannot open to localhost after putting the Wordpress folder to htdocs and renaming it to website1. What should I do? Thank you.
WPBeginner Support
If you’re returning to the site after a day, please ensure XAMPP is running on your computer for it to load porperly.
Admin
SANTOS
Hi, how do I take my local wordpress site to a live wordpress site with a domain name?
WPBeginner Support
Once you purchase hosting with a domain name, you would follow our guide here:
https://www.wpbeginner.com/wp-tutorials/how-to-move-wordpress-from-local-server-to-live-site/
Admin
Zaid
I have a question if i am customizing my localhost wordpress site and my pc turned off. I will loss my site..?
WPBeginner Support
No, as long as you save your changes those saved changes will remain the next time you pull up your local installation
Admin
Carla
Guys, Just wanted to say thank you for this post! I successfully implemented a localhost on my computer thanks to your clear, step-by-step process outlined in the post! So excited to get practising my wp skills on this new installation!
WPBeginner Support
Awesome, glad our guide could help get you set up
Admin
Victor
Great job!! Is there a way, or a tutorial to transfer an existing website to this service ? This one deals with a brand new one. I have a website, and I’d love to add it to XAMPP! Thanks !
WPBeginner Support
For that, you would want to take a look at our article here:
https://www.wpbeginner.com/wp-tutorials/how-to-move-live-wordpress-site-to-local-server/
Admin
Blessings Chibisa
Guys I installed WordPress on a local machine. Am using xamp server I created a database but they is a problem in connection of WordPress and the database…. What should I do ?
Help me pliz
WPBeginner Support
For an error with your database connection, you would want to take a look at our article here: https://www.wpbeginner.com/wp-tutorials/how-to-fix-the-error-establishing-a-database-connection-in-wordpress/
Admin
Vikas
Great artice. It worked perfectly. I am a new learner. Sir could you guide me about How I could run multiple local sites using xampp.
Any help will be aporeciated.
WPBeginner Support
You would want to create a new folder for the next site and then you should be able to follow the directions in the article to create a new database and site.
Admin
AASIMA
SIR.
I successfully followed your instructions to make a website on the localhost. but the next day it doesn’t open and showing some error?
WPBeginner Support
You would want to be sure XAMPP is running to see your local site
Admin
Mate
Good guys
I have my website running on local xampp server on windows 10 system I want to move to my new Mac pro computer how do I do it? thanks.
WPBeginner Support
You would follow the steps in our article here: https://www.wpbeginner.com/wp-tutorials/how-to-move-live-wordpress-site-to-local-server/
Admin
Keith
I followed your directions and it was great, thanks.
I am trying to upload the AVADA theme that I have install previously on Hostgator and it worked.
It is 6mb and a zip file.
When I try to add this theme I get this message: “The uploaded file exceeds the upload_max_filesize directive in php.ini”.
Where am I going wrong? Thank You,
WPBeginner Support
You may want to ensure that there isn’t the theme files in what you’re uploading. If it’s only the theme’s files then you can update your upload size on your XAMPP site using the methods in our article here: https://www.wpbeginner.com/wp-tutorials/how-to-increase-the-maximum-file-upload-size-in-wordpress/
Admin
Deepak Singh
Very helpful post, thanks for this..
WPBeginner Support
You’re welcome
Admin
Mary
Good evening, thanks for the great work done here. I have followed these steps and I am unable to log in to my website. All I am getting is this. I am feed up already. Connection for controluser as defined in your configuration failed.
WPBeginner Support
You would want to reach out to XAMPP’s support as there are multiple possible reasons from mysql not running to needing to reinstall xampp
Admin
Sam Arora
Your site is so much helpful, had a great lesson here
WPBeginner Support
You’re welcome, glad our site could be helpful
Admin
Kashif Ch
Assalam o Alikum Sir!
Currently, I am learning Wordpress and want to build different websites like membership website, LMS, e-commerce store for learning best practices.
Can we create two different websites using localhost or any other free hosting?
WPBeginner Support
For a local installation, you should only need to create a new database and folder for the second site, for free hosting you may want to first take a look at our page and the warning at the beginning here: https://www.wpbeginner.com/showcase/best-free-website-hosting-compared/
Admin
Xander
I followed the steps and it worked perfectly yesterday.
This morning, trying to connect to the localhost I received the following error:
“This site can’t be reached localhost refused to connect.
Search Google for localhost wordpress jack admin
ERR_CONNECTION_REFUSED”
WPBeginner Support
Is your XAMPP running when you try to connect to your localhost?
Admin
Samar Jamil
Thanks for sharing!
WPBeginner Support
Glad you liked the article
Admin
Daniyal
Hello there,
I’ve followed all the steps given in the article but stuck when I click “Install Wordpress”, it gives me an error > “The site is experiencing technical difficulties”
after setting Site Title, username, password, email.
Can you help me, please
WPBeginner Support
There are a few possible reasons for that error message. To start resolving it you would want to go through the options in our article here: https://www.wpbeginner.com/wp-tutorials/how-to-fix-the-wordpress-white-screen-of-death/
Admin
haley
Thank you for this article. I am on the step where I need to open up the local site in a web browser but when I do, I get an error page saying “the local host has refused to connect.” I’m guessing I messed up on one of the former steps but I don’t know which one. I’m working on a Mac.
Any guidance would be appreciated!
WPBeginner Support
If you are returning to the site you would want to ensure xampp is running when trying to view your local site
Admin
Charlie McCormack
Hi
Thanks for this. Installation went 100%
I am trying to test Divi which has to be loaded from a zip file
I get this when I try to install it from aperance/upload theme
The uploaded file exceeds the upload_max_filesize directive in php.ini.
Any solutions would be great
Charlie
WPBeginner Support
You could increase the maximum upload size using:
https://www.wpbeginner.com/wp-tutorials/how-to-increase-the-maximum-file-upload-size-in-wordpress/
Another option would be to add the unziped theme folder where your themes are:
https://www.wpbeginner.com/beginners-guide/how-to-install-a-wordpress-theme/
Admin
Charlie McCormack
Thanks for your reply
I cannot log in on the FTP maybe because its on a local drive
I am trying to load the theme the way you say
and still get the error.I
I bought a new domain name so will try to load it live and work on it like that
Thanks again
Charlie
WPBeginner Support
On a local site, you can use your built-in file manager rather than FTP to add the folder to your WordPress site
YINGLI
Hi, thanks for writing this article!
I have a question though:
I am at the step where I have to fill in a site title, username, password and email address for my admin account for Wordpress. May I know whether the information that I use here should be the same as the information that I would use for my actual online Wordpress account? I have an existing unlaunched Wordpress site through Bluehost.
Thanks so much!
WPBeginner Support
It is not required but if you’re creating a local site to test then it may be a good idea to set that as the same.
Admin
Pooja
Thanks for help , best artical
WPBeginner Support
You’re welcome
Admin
Karen
thanks for the great video. question. am i understanding the process correctly? 1) set up a test site (mysite1) But should i also set up a database/wp install for each client website that I build (and maintain)? I’m guessing yes.
WPBeginner Support
Yes, you would want a different install and database for each local site
Admin