Do you want to learn to make websites using WordPress without actually installing it on a web hosting server?
As a beginner, do you feel like trying WordPress and creating a local WordPress website before you start working on your actual one?
In this article you will learn how to create a local WordPress website using XAMPP.
Why Install WordPress Locally?
You might be thinking, whether installing a WordPress website locally is worth the effort? The answer is YES!. Localhost here refers to your Windows or MAC machine.
Locally installing WordPress can help beginners improve their skills and try new features without any hesitation. Professional developers use this to test the compatibility between plugins, themes, and WordPress core files before implementing them on the server.
You can also create a local copy of your hosted website in case you need to test new features in it. Once the testing is successful you can migrate it back to the server. Using a locally hosted WordPress also has monetary benefits as it saves your hosting cost while you are in the learning and development process.
For WordPress to work, we need a server-side programming language (PHP), a web server app (Apache), and a database management system (MySQL). Installing all these things separately can get out of hands sometimes even for experienced users. This is where XAMPP comes into play.
XAMPP is a software package developed by Apache Friends. XAMPP was developed to build an easy to install distribution for developers to get into the world of Apache.
XAMPP is an abbreviation for cross (X) platform, Apache HTTP Server, MariaDB (previously known as MySQL), PHP, and PERL.
XAMPP also supports other useful tools such as Mercury mail server, phpMyAdmin for database administration, Webalizer for web server log analysis, OpenSSL, Apache Tomcat for running Java code, and FileZilla FTP server. It is available for all major operating systems.
Let’s get started to setup up your WordPress local environment.
Visit Apache Friends website and click on the download button in front of your operating system.
Note: We shall illustrate the process of installing WordPress locally on windows, although the process for other operating systems is quite similar.
Launch the XAMPP software by running the downloaded setup file.
If a UAC Warning dialog box pops up while installing XAMPP, click YES to continue. If that doesn’t work, then you need to disable UAC in your machine and then start the installation process.
Get through all other prompts to start the standard installation process.
XAMPP will ask a few straightforward questions like which packages you would like to install and the location directory for your XAMPP installation. Continue by clicking on Next as the default settings work most of the time.
Once the whole process is completed check the ‘Start the control Panel now’ followed by clicking on the Finish button.
Once the XAMPP control panel is launched, start Apache and MySQL by clicking on the start buttons next to them.
Install WordPress Locally
Download the WordPress file from the WordPress.org website and download the latest version by clicking on the download button.
We, then create a new folder in htdocs file of XAMPP (We shall name it ‘trialsite’). To create a new folder for your local website you need to locate the XAMPP folder. The XAMPP folder will be located in your Windows drive (C drive) mostly unless you have downloaded it any other location. Once located, go to XAMPP >> htdocs and create a new folder.
The content of the WordPress file we downloaded will be in zip format. Extract the zip file and the folder name “WordPress” will be created. Copy the contents of the folder to the ‘trialsite’ folder you created in htdocs.
The next step is to create a database for your WordPress website.
For creating a database go to the XAMPP control panel and click on the ‘Admin’ button in front of MySql and create a database or simply go to https://localhost/phpmyadmin/.
Assign a name to your database and click on the Create button next to it. The name of the database should be exactly same as the name of the folder we created in the previous step.(trialsite)
Once you have all your files in place it’s time to establish a connection between them.
Go to any browser and type http://localhost/FOLDERNAME/ (trialsite in our case)
This will get you to the WordPress installation page where you will be asked to select a language. After selecting your preferred language, press the continue button.
After which you will be asked “Database Connection Details”.
Remember the following points while filling those details :-
- Enter the name of database, the same name you have entered before.(‘trialsite’ in our case)
- The user name should compulsorily be ‘root’.
- Password should be left blank. Leave the rest of the things as it is.
Once you click on “Submit” button, you will see the installation screen. Click on “Run the Installation”.
The final step is to fill the site details and create your WordPress website user id and password. Once done, click on Install WordPress.
On successful installation you will see a similar screen.
Click on the Login button and you will be redirected to your website’s dashboard login page. You can also type http://localhost/YOURFOLDERNAME/wp-login.php to open your login page. You can now login to your WordPress dashboard with the username and password you entered in the site details page.
This will now take you to your WordPress dashboard. Now your WordPress website has been successfully installed locally. You can have multiple locally installed WordPress websites on your machine.
You can also create a local version of your hosted website using this method. Also, you can create migrate your locally developed website to a live server.
We hope this article helps you to install WordPress locally on your machine. In case of queries, please leave a comment and we will get back to you as soon as possible.
Also, if you want us to cover a specific topic you can leave a comment for that as well.