WordPress has become the trend for building websites. WordPress offers the easiest solution to build a website. You may see millions of blogs on how to get started with WordPress, but there aren’t many blogs on how to install it on localhost. This article will show a step-by-step guide to install WordPress in localhost.
It can be a very good step if you have decided to gather some technical knowledge on WordPress before going into business. It will help you to build a solid foundation.
As a result, you will get to know more about the plugins and themes eventually. Installing and using WordPress in localhost permits you to run some tests or customize something without affecting the actual website. So, it is only necessary but also fun.
Take a look at the table of content that provides an overall idea of this article. Just navigate to the topic that you want to know if your time is limited.
What is WordPress?
WordPress is the most widely used Content Management System (CMS) in the world. More than one-third of the top websites on the planet run on WordPress. It is leading the CMS industry with more than 60% of the total market share.
Let’s get a bit technical. WordPress is an open-source CMS meaning anyone can use or modify the software to their liking for free. And a Content Management System is a tool/software that can help you to manage different parts of your website easily. You don’t need to have any programming knowledge to use CMS. The goal of WordPress is to make websites accessible to everyone, and it has been doing it elegantly.
What is localhost?
If you don’t want to involve in any kind of investment of purchasing a domain and hosting, installing and running WordPress in your localhost will be a decent choice of practice.
However, you can’t expect to access all the features while using WordPress in localhost as your business won’t be visible online. To index your online website, purchasing a domain and hosting is a must. Localhost can act as a demo of your original website where you can run some tests and customize something to see the changes. It won’t affect the actual website. So yes, it is a very good practice.
Localhost works as a hostname of the computer that you are using. Using a loopback network interface, localhost fetches the running network services. The loopback network interface generates a default IP address, which is basically (127.0.0.1). You can easily run some tests without prevailing the changes to the world as the information won’t be sent over the internet.
Why do you need to install WordPress on Localhost?
Like we have said before, installing WordPress in localhost is a very good practice to observe any changes in the website after particular customization. At the same time, the changes won’t be applied to the original website as no data will be sent over the internet that is not perfect yet.
Furthermore, installing WordPress is just a matter of a few clicks. The process is almost identical when you are about to install WordPress for the actual site except for the XAMPP installation part.
For example – you run an eCommerce website where you sell various products. At one point, you thought it’s time to raise the prices of the products. Before updating the prices on the real website, you can use our localhost to see the changes first. On your local website, you can check whether the prices of all the products have successfully updated or not. This will save you the hassle of making a mistake on your original website.
How to install WordPress in Localhost?
Here comes the burning question, how do you install WordPress in Localhost? Well, that’s easy. Just follow these steps, and you’re ready to go. We have come up with six easy steps that you need to follow for installing WordPress on your machine. Necessary screenshots are provided that’ll guide you along the way. So let’s get started.
Setting up the environment:
First, let’s set up the environment. You’ll be needing a server-side programming language like PHP, a web server app like Apache, and a database management tool like MySQL. Installing all of these apps can be tiring. That’s why there are some web server solution stack packages that come with all the things required to host your first website. Some of the most renowned development environment software are:
- XAMPP — Cross Platform (All)/ Apache/ MySQL/ PHP
- MAMP — Mac (OS X)/ Apache/ MySQL/ PHP
- LAMP — Linux/ Apache/ MySQL/ PHP
- WAMP — Windows/ Apache/ MySQL/ PHP
Obviously, XAMPP is the most widely used server solution stack package among all of these. Therefore, we will be discussing the installation process of XAMPP on various operating systems. First, you need to download and install XAMPP. So, head over to the official website. The welcome screen will look something like this:
Choosing the Operating System:
Now select your operating system (Windows, Linux, or OS X). This will take you to the download page, which will look something like this:
Keep in mind that, it is best to download the latest version to get it running properly on any operating system. For instance, it is better to download the (8.0.1 / PHP 8.0.1) version to run on the latest Windows platforms.
XAMPP installation for Windows:
Once you have downloaded XAMPP on windows, click on the (.exe) file. You will notice a pop-up message. Select (yes) and go to the next step. A warning message may appear. Click on (Ok) to move forward.
Next, you will see something like below. Start by clicking (Next) and go through the on-screen instructions and you will successfully install XAMPP within a couple of minutes.
Make sure (Apache, PHP, and phpMyAdmin) is selected. It is better if (MySQL) is selected, you may need it in the future. Also, it will be advantageous if you happen to have some coding knowledge.
Keep the rest of the things as they are. If you don’t want to keep the XAMPP in the C drive, change the location at the beginning of the installation process.
Once choosing is done, click next to start the installation process. The installation window will become something like this:
You may see a pop-up dialogue about selecting a language. You can either select English or German. Determining your preferred language, click on the (Save) button.
Once the installation has been completed, You’ll see the completion screen. Click (Finish) to complete the installation.
XAMPP installation for Linux:
If you’re using a Linux device, open the terminal and enter the following command –
If you are wondering, here’s an idea of what this is all about –
- cd – command is used to tell the console to choose the current directory
- chmod 755 xampp-linux-x64-8.0.0-2-installer-run – Here, chmod is used to change the mode to access the file, and chmod 755 is used to tell the console that we are accessing the file in read/write format. It’s something like “Run as Administrator” on Windows.
- udo ./xampp-linux-x64-8.0.0-2-installer-run – This command is used to tell the console to do something or open a file.
You should note that – linux-x64-8.0.0-2 is the version number of the XAMPP tool. The name might be different if you use a different version.
XAMPP installation for OS X:
If you are a mac user, drag the downloaded XAMPP folder to the Application folder. This will install the environment.
Now launch XAMPP from the Launchpad. Click the (Start) button in the ‘General’ tab of the stack manager and wait for the status icon to turn green.
Make sure that all the services are running in the ‘Services’ tab of the stack manager. If you can’t start Apache on Mac, try to disable Web sharing from –
System Preferences… >> Internet & Wireless >> Sharing
Now you are done setting up the environment to run WordPress on your Windows, Mac, or Linux device. Let’s move on to the next part. The rest of the steps are similar for all the OS.
Run XAMPP on your system:
Congratulations on completing step one of your WordPress installation. Now fire up the XAMPP software.
For Linux users, Open the Terminal and give the command:
sudo /opt/lampp/manager-linux-x64 .run
The starting screen will look something like this:
Now start the Apache and MySQL server. If you see a security alert like this, don’t be confused. Go forward with the installation by clicking “Allow access”.
If everything is right, the screen should look something like this –
N:B: You may face some errors while installing. Follow This article to troubleshoot your errors here.
Download WordPress:
Now that you’ve successfully set up the necessary environment for your website. Let’s move on to the next step. Head over to WordPress Official Website to download the latest version. Scroll down till you find the download button. Click on the button to start downloading WordPress on your Computer.
Once the download is complete, you will see a zip file. Unzip the file and copy it for later use.
The default location on different operating systems are
- For Windows, the default path is C:\xampp\htdocs
- For Linux, the default location path should be /opt/xampp/htdocs
- And for Mac users, it should be Application/XAMPP/htdocs
You need to paste the extracted wordpress files into the htdocks folder. make a new folder as your wish to name your website. and paste the wordpress extracted files into that folder. we are using the name wordpress.
If you want to run the installation in a geeky way, you can edit the wp-config-sample.php file as below.
first you need to create the database shown in the 4.4 (Create Database) section . After that we are going to connect the wordpress with the database. Its not sin to try different ways!
Open the file in notepad, it should look like this:
name the pointed areas as your database name , and rename user, password as below
you’ve done it! now save it as wp-config.php. so lets go to section 4.5 and install wordpress.
4.4 Create Database:
The next step is to create a database for your website. To create the database, first head over to the folder where you installed XAMPP.
Now go to your web browser and type localhost/phpmyadmin on the search bar.
The loaded page will look like the image below.
Now click on the (Database) button located in the top panel to create a new database.
Type the name of your database and hit create. Make sure to provide the same name you used in C:\xampp\htdocs for your database.
4.5 Install WordPress:
Open a new tab on your browser and write localhost/your given name (WordPress in our case), and hit the (Enter). A setup wizard will show up just like the image below. From there, select your language and click ‘Continue’.
Here, you will be informed about the requirements to run a WordPress-powered website. Click “Let’s go” to move forward.
Here, provide the name of the database. Keep username as “root” and leave the password empty. You should leave everything to default as the installation process might get interrupted if you change something.
After clicking the submit button a new window will appear where you need to press “Run the installation” button.
Finally, we have come to the final stage of the setup process. Give a title to your website, set up your username, password and provide your authentic email address. Carefully read the page and keep the “Search engine visibility” checked if you don’t want Google to start indexing your website. Lastly, click “Install WordPress” to finish the WordPress installation process.
Congratulations! You’ve successfully installed WordPress on your localhost if you have followed everything accordingly. The welcome screen will look like this. Click on “Log In” to move forward.
4.6 Finishing (Check the website):
Okay! We are almost there. If you want to visit the dashboard, you need to provide your username and password to log in. In order to do that, go to (your website name/wp-admin)
After login, you’ll be directed to your website’s dashboard. You will be able to control your entire website through this dashboard.
The final step is to click on the website name on the dashboard’s upper left corner, just beside the WordPress logo. Click the name to get the default layout preview of your very first website. The default website will look something like this –
Our Final Thoughts:
If you have successfully followed every step, you will have the world’s most versatile CMS powering your website. Give a pat yourself on the back; you deserve it. Be very clear about one thing, your journey has not ended, it has only started. From here on, surf the vast ocean of customizing your website and give a proper structure to it before you finally want to let your audience see it.
You have successfully completed the first step, crafting your boat. Now it’s time to sail and venture into the unknown. With that being said, I hope this article has helped you a lot in installing WordPress in localhost. Feel free to share your thoughts and concerns with us over the comment section. Hope to see you in another article. Till then, take care.
Leave A Comment
You must be logged in to post a comment.