How to Install WordPress on Localhost using XAMPP?- How To Move WordPress From Localhost To Live Host Server?
If you are a complete beginner to WordPress, you might not know that it is possible to install WordPress locally in your computer. You can create fully functional WordPress sites in your computer and test the site without any internet connection.
There are numerous advantages of setting up a local server (localhost) and installing WordPress on localhost. If you are a theme/plugin developer or need to test different themes and plugins on a regular basis, installing WordPress on localhost could be a very effective solution for you.
The WordPress site you create in localhost will load almost instantly. As the site is not connected to the internet, you can rest assured about its security. Some WordPress developers like to develop the site in localhost first and then move it to a live server.
In today’s post, I will show you how to install WordPress on localhost using XAMPP server.
What is XAMPP?
The full elaboration of XAMPP is cross-platform, Apache, MySQL, PHP and Perl. This simple and convenient solution lets you create local web servers on your computer. XAMPP works perfectly on Windows, Linux, and Mac.
XAMPP comes with two components that are essential for installing WordPress – Apache and MySQL. Apache is used to create the local server. And MySQL lets you create the database for your WordPress site.
Installing XAMPP Server on Localhost
To install XAMPP on localhost, Download it first from the Apache Friends website. There are separate download links for Windows, Linux and OS X. There is no 64-bit version for Windows. But the 32-bit version works perfectly for the 64- bit too. I have used and tested it personally.
Download the installer file. Once the download finishes, click the downloaded file. Depending on your operating system, you might need to allow the software to be installed.
While you should be cautious about installing unknown applications, you can safely install XAMPP. Allowing it to install will take you to the setup wizard. Click ‘Next’.
The next window lets you customize which components you want to install. Options like Apache and PHP are required. Therefore, you can’t deselect them. But you can uncheck the other options. For installing WordPress, the necessary components are Apache, MySQL, PHP, and phpMyAdmin. Once you have selected these, click ‘Next’.
In the next page, you will be asked to select the folder where you want to install XAMPP. Click the folder icon to open the file browser and to select a custom folder. After making the choice, click ‘Next’.
In the next screen, you will be asked to install Bitnami for XAMPP. Bitnami makes it simpler to install third-party CMS like WordPress, Joomla and Drupal in XAMPP.
Since we will be installing WordPress manually, we won’t need this option. Therefore, you can simply uncheck the box and click ‘Next’.
Now, XAMPP is ready to be installed. Click ‘Next’ to start the installation process. It will take some time to finish installing.
While installing XAMPP, if your computer provides a security notice like the following, uncheck the ‘Public networks …’ box and check the ‘Private networks…’ box and click ‘Allow access’. This will create a rule for XAMPP in your security system.
In the final installation window, you will find a checkbox to start the XAMPP control panel. Leave it checked and click ‘Finish’.
At this point, the control panel will be started. You can also open the control panel from your programs list or from the directory where you installed it. The control panel will look like this –
Before using XAMPP, make sure that you don’t have any other application running that also uses the same ports. Skype is a common example in this regard. Quit any such application and restart XAMPP.
In the XAMPP control panel, you will find different components listed – Apache, MySQL, FileZilla, Mercury, Tomcat etc. All of them have separate start/stop, Admin, Config and Logs buttons. Fire up Apache and MySQL by clicking the respective Start buttons. If they have started successfully, you will notice a light green background behind the component names.
If both Apache and MySQL are running successfully, you can congratulate yourself. You have successfully installed XAMPP server in your computer. To test your local server, open your favorite browser and enter the following URL – http://localhost/
The page should look like the following –
Creating a Database
Now that you have installed XAMPP let’s see how to install WordPress. First of all, you have to create a database to install WordPress. To do that, get back to the XAMPP control panel. Click on the ‘Admin’ link of the MySQL section. This will take you to the phpMyAdmin page.
You can also get to this page by entering the following URL into your browser –
http://localhost/phpmyadmin/
There is a menu on top of the page. Click the ‘Databases’ link. This will bring a page like the following –
Right under the big ‘Databases’ title, you will find a section titled ‘Create database’. Provide the database name and click ‘Create’. This will create the database for you. Note down the database name, we will need it for installing WordPress.
Installing WordPress on XAMPP
Now, to install WordPress on XAMPP, Download the latest version of WordPress from the official site. Extract the zipped archive to your desktop. Open the folder where you have installed XAMPP. Locate the folder titled ‘htdocs’. Copy the extracted WordPress folder into the htdocs folder. If you haven’t changed the default installation settings, the htdocs folder should be located at the following address –
C:/Program Files/XAMPP/htdocs
In your browser, open the following URL – http://localhost/wordpress/
In the resulting screen, you will be asked to select the language. Choose your preferred language and click ‘Continue’.
In the next screen, you will be told that some information is needed for installing WordPress. These are the things we will need –
- Database Name
- Database Username
- Database Password
- Database Host
You might not know all the information. Don’t worry, I will provide you with the necessary information. Click the ‘Let’s go!’ button at the bottom.
At this point, you should be on this page –
Provide the following information in the boxes –
- Database Name: Write the name of the database you created a while back.
- User Name: root
- Password: Don’t put anything in this field. Clear any default text and leave it empty.
- Database Host: localhost
- Table Prefix: wp_
Once you have provided the necessary information, click ‘Submit’. In the next page, click the ‘Run the install’ button. You will be taken to a page like the following –
In the ‘Site Title’ field, provide the title of your test site. Then, the ‘Username’ and ‘Password’ fields will let you create an admin account for your site. As you will need this information to log into your website, save or memorize these.
In the ‘Your E-mail’ field, provide an email address. Lastly, the ‘Privacy’ could be used to hide the site from search engines. After making the necessary changes, click ‘Install WordPress‘. If everything is okay, you will be provided with a success page. Click the ‘Log In’ button at the bottom.
This will take you to the login page of your website. Provide the username and password you just provided and click ‘Log In’. If they are correct, you will be taken to the admin dashboard of your WordPress site.
If you can view the dashboard, then WordPress is successfully installed.
What to Do Now?
Now that you have installed WordPress on XAMPP locally, you can start exploring the available options.
You can install new themes, plugins, publish new posts, pages, etc.
A WordPress site in localhost and a WordPress site on the live server are exactly the same, except the difference in their locations. We wrote a detailed post about exploring the WordPress dashboard a while back, feel free to check it out.
It is possible to create a fully functional website in your localhost. And then, you can move the site from localhost to your hosting. Check out this in-depth guide to know how to move a WordPress site from localhost to a live server.
Install Multiple WP Blogs on XAMPP
If you want to create multiple blog installations of WordPress on your computer, there are two ways to do that –
- Using WordPress multisite or
- By installing WordPress in separate folders.
You will get detailed instructions about setting up WordPress Multisite here.
Conclusion
Software like XAMPP provides simple and easy ways to set up local servers in our computers and to test various applications in it. You can use XAMPP to install WordPress on your computer and save a lot of time in the development process.
I hope I have made the process clear enough for you. However, if you still have any question about the things discussed above, please let me know by leaving a comment below.
Anuj
I found this tutorial awesome and it is very helpful for beginners working on XAMPP and starting to work on WordPress.
If I get a chance, I will definitely suggest it to my friends.
Thanks for providing this step by step process along with screenshots.
Pratik Sah
thanks a lot for your tutorial…
my xampp got done.
Joseph Wolf
This is gold! thank you so much!
Ben
hi!thank you for tip.i did what you have said bt when i try to log in it says invalid details.i did it twice writing down the password so that i wont forget bt its itill not working
hop you will help
Pratik
Thanks for this article
It help a lot ,
Abdul
I have been struggling with Xampp. This tutorial proved to be very helpful. I really appreciated your hard work.
Abu
Thanx a lot. it was very helpful
Charnell
Thank you so much for this tutorial. The instructions are simple and clear. Good job!
Demola
thank you very much for this step by step………it really help
Pratik
really helpfull to creating wordpress environment on local system…
Haseeb
superb and awesome instructions. thanks a lot
Argha Bhattacharjee
After creating a website on local host, will it be live on internet??
WPDean
No,
Please read our other tutorial for migrating a site from local host to live server.
Eleanor
At last! Someone who teaches an easy route to this installation with advice on how to avoid the “potholes!” I really appreciated the help and only wish that I had found this sooner and saved hours of time and frustration. Many thanks!
lokesh kumar
This is tutorial very helpful for me .
Thanks you so much.
Bilal
I found this tutorial very very helpful for me. Thank you so much for creating and publishing such a great efforts.
May GOD Bless You !
Daniel
thank you so much this step by step tutorial helped me to know how to insatll WordPress. it is the first to to install WordPress. please if you have other topic about wordpress let me know.Thank you
Fred
A very big thank you, it took some time but step by step I made it and certainly could not have done it without this help and guidance. would recommend anyone to use it
Veronica
Thank you! Great tutorial. Much appreciated.
Umi
This tutorial clearly explains every single step. Was so confused before I found this tutorial! Thank you so much!!!!
Kingsley
this is by far the best explaination…I really do appreciate it but I would also want to know how to start inserting other functions like preferences, pages, tags etc
Negar
Hi
I cant get access to phpmyadmin I see this error: Access forbiden you dont have permition to access the requestef directory.There is either no index document or the directory is read-protected.
Can you help me?
Naomi Ibrahim
thank you so much for this information, now am able to install xamp and word press on my computer.
i will recommend your post to as many as i meet that has the need
thank you.
Onu Daniel Emeka
Thanks. Finally worked it out. I deleted and recopied the WordPress folder to htdocs, created another database and voila, it worked. Though I tried upto four (4) times.
Anu Saxena
Thank you so much, it is very helpful.. Keep posting!!!