Are you new to web development environment and want to learn to install WordPress or you want to learn its features before choosing it to create your website and want no trouble or extra cost of installing it on a web hosting server?
Or you want to
- Create a new theme or test existing theme without getting things messed up
- Test new plugins or explore new features without crashing your live site
- Continue working on your website even when not connected to the internet
In all these situations and many others, it is best to keep WordPress installed locally (on your current computer). But installing WordPress on a local machine might be tricky. You can follow the steps that are mentioned below and you can get it installed in no time. So let’s get started.
Since we already have discussed a few benefits of installing WordPress locally. So I’ll not explain it more. If you want to know more about it, you can check my other article here.
Requirements to install WordPress
In order to install WordPress on local machine, you need to make these things available in your system:
- PHP (Version 7.3 or greater)
- Database (MySQL version 5.6 or greater OR MariaDB version 10.1 or greater)
- Server (Apache or Nginx)
- HTTP or HTTPS
There are many softwares for both Windows and Mac which provide these features. But today we will be focussing on XAMPP for Windows.
Note: While reading to this guide you will find local machine, localhost or locally many time. Here, it is referred to as the computer that is accessible by you on a local network.
What is XAMPP?
Let’s understand XAMPP with its full form.
- X — Cross-platform software. It supports multi-platform installation. You can use it on Windows, MacOS & Linux.
- A — Apache Server. It’s the most widely used web server. It runs almost 2/3rd of the world websites.
- M — MariaDB. Oracle purchased MySQL and they provided an open-source database software called MariaDB. It is a smaller version of MySQL.
- P — PHP. It is a server-side scripting language used to develop static and dynamic websites.
- P — Perl. It is a programming language which is used to develop the web application.
XAMPP provides all the features that are required by WordPress in a single software. It is very easy to use software which includes many other features as well.
How to Download and Install WordPress on XAMPP on Windows
Step 1: Download XAMPP
Visit the Apache Friends website and download the Windows installer file. Here is the link for your ease apachefriends.org. You can find the installer download option on the main page of their website as shown in the screenshot from their website.
Alternatively, you want any other version of the software, you can go to their download page apachefriends.org/download.html. And choose the version you want to download.
Step 2: Install XAMPP
It is a regular .exe file and can be installed like any other software. After your download is complete. Open the installer file.
When you open the file, sometimes it will give you a warning stating “User Account Control (Missing write permission for C:\Program Files)”. If you don’t want to disable UAC, you will have to install XAMPP in a different folder, outside of C:\Program Files (x86). It will work the same on any folder. The warning will look something like this:
Click OK to continue. Also, if you are running antivirus, it will also show a warning regarding that. Just click OK and you are good to go. The antivirus warning will look something like this:
Once you passed all the warnings by XAMPP, it will take you to the installation page. Click on Next for the installation process.
Then it will prompt to select what components you want to install. It includes tons of feature but for WordPress we only require:
- Apache (it is mandate by XAMPP)
- PHP (it is also mandate by XAMPP)
You must select these four options to install. But there is no harm to select all the features. It might come in handy in the future.
Once you have selected the components, click on Next.
At this step, it will ask for the installation folder. By default it will install on C:\XAMPP but you can choose any other folder you want. You can change folder by clicking the folder icon next to the folder path.
Once you have selected the components, click on Next.
The next page shows a link for bitnami.com. If you want to take a look at their website about XAMPP you can check this box and if you do not want, then uncheck this box. Once done click on Next.
On the next page, it will give you a message about installing XAMPP on your computer. To do that, click on Next.
After you click on Next, it will start installing XAMPP files to your computer.
Once it finishes the installation. It will prompt you to open the XAMPP control panel. To do so, check the box and click on Finish. It will open the XAMPP app.
By following this procedure you have successfully installed XAMPP on your computer. Now it’s time to open the XAMPP app and move forward with the settings of XAMPP.
Step 3: Setting up XAMPP for the WordPress
Open the app name xampp-control.exe (XAMPP Control Panel). For the first time when you open this app, It will ask you to set up language preferences. Select the language you want to set as default for XAMPP and click on Save.
Once you have saved your language preference. It will open the main page of XAMPP Control Panel. In order to start localhost, you need to click to start for these two services:
Once you start these services. It will look like this.
Note: In some cases, when you Start XAMPP services, it will pop-up with Windows Security Alert. You need to whitelist Apache HTTP Server from your Windows Defender Firewall by clicking the Allow access button.
In order to verify that everything is working fine. Open any of the below URL in your web browser:
Both links are referring to the same page. The only difference is that one is a text-based path and the other is the IP address path. Once you open this link, it will show a demo page of XAMPP which looks like this:
Now you have a successful running server on your local machine. Now its time to create a MySQL database on this server.
To do so, go to the URL: http://localhost/phpmyadmin or you can click on phpMyAdmin at the home page of the localhost. It will open the phpMyAdmin panel, where you need to create a database for your WordPress.
On this page, take note of the Database server information. It will be required while installing WordPress.
Server: localhost (127.0.0.1)
Click on Databases to create a database for WordPress.
Choose a name for your database and enter it on the space provided. In this case, I’m using the database name as WordPress. Once you have chosen the database name, enter it and click on Create. Also, make a note of this database name as well. This will be required when you are installing WordPress.
Step 4: Download WordPress
To download WordPress, go to website wordpress.org.
Click on Get WordPress and this will take you to the download page of WordPress.
Once you are at the download page, click on any of the following links to start downloading WordPress.
The first file has a .zip format and the second file has .tar.gz format. The content inside these compress zip files is the same.
When the download is finished for WordPress. Open the file and extract these files to the mentioned path. C:\xampp\htdocs\wordpress.
Here you can choose any folder name that you want instead of WordPress. But keep in mind that, the folder name you choose here, is your locally hosted website URL.
For example, since we named the folder as WordPress. So in order to open the website, we have to enter URL: http://localhost/wordpress. And if you wish to keep this name something different than WordPress like mysite. Then, you have to use URL: http://localhost/mysite to access your website.
Note: WordPress can also be installed in the root directory. To do so, you have to delete or move all the files that are already in the folder C:\xampp\htdocs to someplace else. And extract all the WordPress files in this folder. Now you have to open WordPress from URL: http://localhost/. You do not require to enter any suffix to access your website.
Step 5: Install WordPress
After you place all the files on the desired folder. In this case, I have used WordPress folder, so I’ll use the link http://localhost/wordpress to continue installing WordPress. If you have placed this in different folder. Then you have to open http://localhost/your_folder_name.
Select the language you want to install WordPress and click on Continue.
Click on Let’s go.
Enter the database information that we have created in Step 3.
Database Name: wordpress
Password: -leave it blank-
Database Host: localhost
Table Prefix: wp_
Leave the password blank, as we have not created any password for Apache XAMPP.
After filling in all the details, click on Submit
WordPress will verify all the information in the background. If there is any error, it will ask to input the correct information. Since no error found by WordPress, so it will show this option. Now click on Run the installation.
You will be asked for your site information. Here you need to input your Website Name and admin account details.
- Site Title: This is your website name
- Username: This is your admin account username which will be used in future to log in as admin to your website
- Password: Password to your admin account
- Your Email: Admin account email
- Search Engine Visibility: This option creates a rule in .htaccess file of “nofollow by search engines”. Since we are using this setup on local machines, so setting this up does not make any sense.
Note: Make sure to use a strong password to reduce probability of hack. Bar below is the password field gives an indicator of password strength. In case you are using weak password. WordPress will ask for confirmation from you.
Click on Install WordPress
Hurrah!!! You have successfully installed WordPress on your computer.
In order to access your admin panel of WordPress, click on Log In.
You have successfully installed WordPress using XAMPP. Now you can spin your site for some testing. Even the most experienced developers install WordPress locally before moving it online.
Keep a note or bookmark your admin panel login path:-
Website home page: http://localhost/wordpress
It is important to note that XAMPP uses the same port 80 and 443 as Skype and sometimes creates the conflict between the two. You can solve this by changing the Skype port or XAMPP from their settings. Here’s a link to change the XAMPP port on stackoverflow.
If you having any trouble while installing or any other issue related to WordPress or XAMPP, please leave a comment below. I’ll definitely help you with it.