Are you looking for a step-by-step guide on how to install WordPress on localhost? This blog is for you.
WordPress is the most popular Content Management System, powering over 810 million websites worldwide. The platform is simple and easy to use, as it lets you design and customize websites without the required coding knowledge.
However, what if you want a WordPress website on a test basis?
Optimizing your website for speed can be tricky without a testing site, as testing new themes or features on your live website can lead to performance issues. Therefore, it becomes essential to know how to install WordPress locally.
Using a localhost for your WordPress site allows you to test new WordPress features, experiment with the website design, run updates, and learn how to use the platform to build websites. This means you can make changes to your website without affecting the user experience or worrying about functionality issues.
With this step-by-step guide, learn how to install WordPress on localhost, install WordPress files, and create a local database to run your website.
What is Localhost?
Localhost is similar to a hosting plan. When you want to build a WordPress website, you buy a domain name and choose a web hosting plan for your website where all the site data will be hosted on the hosting provider’s server.
With a localhost, instead of virtual hosting, your website data will be stored on your PC’s local storage, and you can run the website from locally. This also means your website won’t be available online.
Using your PC’s storage as the host involves creating a private hosting environment by installing third-party software to get WordPress.
For instance, you can install software like XAMPP on your PC, which will create a similar environment as that of virtual hosting, and then install WordPress on localhost to get started.
Why Should You Install WordPress Locally?
Setting up WordPress locally has various advantages for anyone working in web design or development.
- For starters, it is a great way for beginners to start their learning journey with WordPress as they can get familiar with the CMS platform, learn how to build entire websites from scratch and understand what functions they can add to the website.
- Secondly, having WordPress localhost installed allows developers and experts to create a staging site – a copy of your live website on the localhost – and use it for testing and experimentation. It provides a safe environment for experimenting with themes, plugins, and design changes.
- Lastly, localhost can also be a safer way to run updates and test new software. You can conduct troubleshooting and identify any issues without affecting your website performance. This way, you won’t have to worry about breaking your website in case something goes wrong.
Building your first WordPress website? Learn the major differences between the two ecosystems of WordPress with this guide on WordPress.com vs WordPress.org.
Various Options to Install WordPress on Localhost
Whether you’re using Windows or Mac OS for your WordPress website, you’ll need to install localhost software to install WordPress for local development. Fortunately, there are a ton of reliable software available for different operating systems.
Here are the various software options to install WordPress on localhost-
- XAMPP
- WAMP
- Local by Flywheel
- LAMP
- MAMP
Among these, XAMPP is one of the most popular, user-friendly, and versatile software available that supports all operating systems, including Windows, Mac, and Linux. For this blog, we’ll take XAMPP as the software to work with WordPress locally.
How to Install WordPress on Localhost? [Step-by-Step]
Now that you know what a localhost is and how it benefits you while developing a WordPress website, let’s look at how you can install WordPress locally.
Step 1: Download XAMPP Software
The first step is to download the XAMPP software from the official Apache Friends website. The software is available for different operating systems.
Select the download version for your Operating System, and the download will start automatically and may take a few minutes to finish.
Step 2: Install and Run the XAMPP Server on Localhost
Once downloaded, click on the .exe file to launch the installer. The installer screen will appear. Here, click on Next.
Now, you need to choose the additional components you want to install. It is important to note that you don’t need every component to use WordPress locally.
To install WordPress on the localhost, you’ll only need Apache, MySQL, PHP, and phpMyAdmin. Select Next.
Now, choose the folder to install XAMPP into and select your preferred language. It will automatically start the installation process.
However, if you have an antivirus installed, it might show an error message, but you can easily proceed with the installation. Once the software is installed, you can launch the control panel to get started.
Step 3: Run the Modules to Test the Server
To run WordPress and XAMPP, you’ll need to run three modules on the control panel-
- Apache (the web server used by XAMPP)
- MySQL (the database used by WordPress)
- PHP (the programming language that the WordPress is built on)
Simply navigate to the XAMPP control panel and start these three modules. Under the Manage Server tab, the status for all three modules should turn green.
If you find any of these are red, click on Start All or Restart All.
Next, to confirm if your local server is working, go to http://localhost on your web browser. This will open the XAMPP welcome page, which means you have successfully added the XAMPP server to your operating system.
Step 4: Download the latest WordPress version
Before creating a local database, you need to install WordPress on your system. For this, go to the official WordPress website and download the latest version. Once downloaded, extract the zip files and copy them.
Next, find the XAMPP folder on your computer and open the htdocs folder.
Create a folder within the htdocs folder and name it something like “testsite”, as this will become the sub-name to access your website on the localhost.
Now unzip the WordPress zip file copied at the beginning.
Step 5: Create a Database
At this stage, it’s time to create a MySQL database to install WordPress for local development.
To do this, go to your XAMPP control panel, click on the Admin button for MySQL, and launch phpMyAdmin.
Click on Database and create a new database. Here, make sure that the second drop-down menu against your database name is set to Collation.
Select Create, and you’ll now be able to access your new testing website.
Step 6: Install WordPress on the Localhost
In this last step, you will complete the WordPress installation. Open your browser and search for http://localhost/testsite in your browser.
Here, “testsite” is any custom name you’ve chosen for your WordPress folder. Select your language preference, and click on Continue.
Now, you’ll need to enter the credentials for the database, such as
- Database name (database name created in phpMyAdmin)
- Username (set it to “root”)
- Password (leave blank)
For Windows users, WordPress will automatically record this information in a wp-config.php file. Complete the rest of the installation process.
Now, you should see a new WordPress install running on your localhost.
And that’s it! You can now work with WordPress locally and test your website without affecting the live performance.
Are you looking for reliable hosting providers for your Elementor website? Check out the 8 Best WordPress Hosting for Elementor.
How to Add Themes and Plugins on Localhost?
Once you run WordPress locally, you should be able to install any WordPress theme or plugin on localhost.
Now, there are two ways to install WordPress themes and plugins on localhost.
Install Plugins
In the first method, visit the link http://localhost/yourwebsitename/wordpress/wp-adminand enter the website credentials created while setting up WordPress locally. On the WordPress dashboard, go to Plugins > Add New and search for the plugin you want to install.
In the second method, you can install the plugin with access to its zip file. If you have the zip file for the plugin, go to the XAMPP folder > htdocs > your website > WordPress > wp-content > plugins. Here, copy and paste the zip file of the plugin, unzip the file, and the plugin will be installed for your local website.
If you’re looking for a reliable plugin for your WordPress website, The Plus Addons for Elementor is the perfect addition to your website.
This all-in-one plugin is a complete toolkit of 120+ addons for Elementor that lets you add a range of unique features and functionalities to your website.
From adding custom designs and responsive content to integrating WooCommerce features or social media feeds, this plugin lets you do all this and more.
Install Themes
Similarly, you can also install themes, like the Nexter theme, to your local WordPress website.
Visit http://localhost/yourwebsitename/wordpress/wp-admin, and on your WordPress dashboard, go to Appearance > Themes. Here, you can search for Nexter, which is an all-in-one theme for your WordPress website.
It is a lightning-fast theme with a minimal design and a lightweight code that doesn’t add weight to your website. What’s more, it’s got an extensive library of ready-to-use design templates, a header and footer builder, a WooCommerce builder, global styles, and plenty of customizations to create a stunning website.
Alternatively, you can also download a theme if you have access to its zip file. Just go to the XAMPP folder and locate htdocs > your website > WordPress > wp-content > themes. Unzip the zip file of your custom theme in this folder, and it will be installed for your local website.
Did you know some WordPress themes can serve multiple purposes? Check the 5 Best WordPress Multipurpose Themes For Elementor.
How to Uninstall WordPress on Local Host
Done testing your WordPress website and don’t need it available locally anymore? The process of uninstalling WordPress on localhost is quite simple.
All you need to do is open the Control Panel on your Windows computer and go to Program. Here, locate the XAMPP app and hit the uninstall button.
This will uninstall XAMPP from the server. Next, go to Apps and Features on your system, locate the XAMPP app, and uninstall it.
Finally, to delete all the files from your computer, find the uninstall.exe file for XAMPP from the C:\xampp folder on the computer.
Run the file to remove all the XAMPP files and features.
Further Read: Are you wondering how you can build your WordPress website using Elementor in localhost? Check out this Step-by-Step Guide on How to Install Elementor in Localhost.
Do you Manage WordPress Websites? Download Our FREE E-Book of 20+ Checklist for WordPress Site Maintenance.
- SAVE MAXIMUM THIS BLACK FRIDAY