To host your website on the web requires you choose a hosting provider which will provide you with a server to store your website files. However, you can host “websites” locally, on your own computer. Unlike the aforementioned, with this method, only your computer and those in connected in its network (if any) would be able to access the web pages.
In this article, we would follow these three main steps to accomplish our task:
- Download and install XAMPP
- Configure the local environment with XAMPP
- Download and run WordPress
What is XAMPP?
XAMPP is an abbreviation, which stands for Cross-platform (X), Apache (A), MariaDB (M), PHP (P) and Perl (P). A typical web server needs a web server application, a database and a scripting language to function. Hence, XAMPP’s Apache (web server application), MariaDB (a database) and PHP (scripting language) makes it easy for you to set up a local server.
Downloading and Installing XAMPP
Visit Apache Friends and download the one which is relevant to your computer’s operating system. In this tutorial, we would download and use the Windows version.
After download is complete, run the installer.
The next screen makes you select which components of XAMPP you would want to install. We would need only Apache, MySQL and PHP. However, you may choose to install all the components, hence leaving all the boxes checked.
Choose a location for the installation files. You can select a different location and a different folder name. Here, we would use the default location and folder name “xampp.”
Click “Next” and keep the “English” in the Language drop down list. Click “Next” again and uncheck the box “Learn more about Bitnami for XAMPP.” Click “Next” again and wait while installation of XAMPP takes place.
After installation is complete, you can open the XAMPP control panel by keeping the respective box checked as seen below. Then click on “Finish”.
Configure the Local Environment with XAMPP
As you open the XAMPP control panel, start the Apache and MySQL modules.
When prompted by Windows Security, tick the “Private Networks…” box and on “Allow Access.”
Download and Run WordPress
Extract the zip file. Open the extracted folder and copy the folder “wordpress.”
Locate where you installed XAMPP and open htdocs folder. I installed mine at disk C, hence the location is C/xampp/htdocs
Paste the copied wordpress folder into “htdocs” and rename it with the name you want to to use for the website. I renamed mine as “ben” and this will be the name of my local website, when I enter localhost/ben into the web browser.
Enter the website address (in this case, localhost/ben) into the address bar to proceed with the WordPress set-up. You should be redirected to the WordPress Configuration (config) file set up.
Select your preferred language and hit “Continue” to proceed.
Click on “Let’s go!” to move to the next screen.
Create a Database
To supply the required database details, we need to create one. To do this, open the XAMPP control panel and click on the “Admin” action of the MySQL module. Alternatively, you can enter localhost/phpmyadmin in your browser’s address bar.
Click on “New,” provide the name of the database and click on “Create.” That’s all that is required here; we won’t go deep into databases in this tutorial.
Let’s get back to our WordPress set-up page to enter the database details:
- Database name: enter the name of the database created in the previous step.
- Username: root
- Password: leave blank
- Database Host: leave the default value “localhost”
- Table Prefix: leave default value
After clicking on Submit, you should see the success message below. Click on “Run the Installation.”
Fill the fields displayed with respective details. You would use the Username and Password to login into your WordPress website’s dashboard. Proceed to “Install WordPress.”
You should see the success message and the login button below.
Now, login by entering the username and password provided in the previous step. You would now be taken to your dashboard, which serves as a control panel for your website.
Note: your WordPress dashboard can always be accessed by logging in through any of these URLs:
Your website can be accessed at localhost/websitename; and example is localhost/ben in this tutorial.
Enter this URL to take a look at your website. Congratulations! You just created a local WordPress website.
Do you have any comments regarding How to Create a Local WordPress Website with XAMPP? Drop them in the comments section below: