WordPress on localhost

How to Install WordPress on Localhost

WordPress is currently the most popular CMS (Content Management System) for designing websites without coding. The conventional method to use WordPress sims is buying a domain and hosting plan and then installing it. But what if you don’t have a domain and hosting and want to use WordPress on a trial basis? Well, using WordPress locally is possible with a local WordPress installation. If you are new to the term and don’t know how to install WordPress on localhost, then this blog is for you. Here I will walk through all the steps of WordPress localhost installation.

What is localhost?

Localhost works in the same way as a hosting plan. But with localhost, instead of virtual hosting, the local PC will act as the storage device. To use PC storage as hosting, you need to use third-party software, which creates a local host environment to install WordPress. For example, you can install XAMPP on your PC, which will create an environment similar to virtual hosting. Then you can install WP on localhost as you install with a hosting package and premium domain.

Why install WordPress on localhost?

You may be wondering why you would install WordPress on localhost since nobody can see it. Or, you might think localhost is only for WordPress beginners.

But the fact is, installing WordPress on localhost is beneficial for anyone involved in web design and development. Beginners can learn how to design a website using WordPress CMS, how to design an entire website with WordPress and more. For instance, you can practice designing SaaS websites, WooCommerce websites, etc. on a local host.

For experts, installing WordPress locally makes it easy to test plugins, themes and other third-party tools before installing them on a live website. For example, suppose you want to design a SaaS website with some WordPress plugins before trying your live website tools, you can try it on local host. This will help you avoid making any mistakes.

Localhost is mandatory for developers because when they are creating a new WordPress plugin, they need to find bugs and try to fix them locally.

What are the options to install WordPress and localhost?

Irrespective of the operating system, installing the localhost software is essential for a WordPress localhost installation. The good thing is, you get localhost software for all operating systems.

At present, you will find five popular platforms for installing WordPress and similar CMS.

Here are popular localhost software for installing CMS locally –

  • XAMPP – It stands for Cross-Platform, Apache, PHP, MySQL and Perl
  • Native by Flywheel – Native WordPress development tool
  • WAMP – stands for Windows, PHP, Apache, MySQL
  • MAMP – stands for My Apache – PHP – MySQL
  • LAMP – stands for Linux, PHP, Apache, and MySQL

Among them, XAMPP and Native by FreeWheel are the most versatile and supporting multi-platform operating system.

LocalHost is our recommended localhost software for WordPress installations

Among all common localhost software, I recommend XAMPP. Compared to other platforms, XAMPP offers more features and is easy to use. So, I’m going to share how to install WordPress in XAMPP.

Setting up the platform is so easy that even a beginner can navigate all the features easily.

The best part is, it’s open-source software, which means you can enjoy all the features for free.

However, the other software I mentioned for localhost is free too. But XAMPP is more user-friendly.

Follow 4 steps for WordPress localhost installation

Installing WordPress on localhost is easier than you think. You need to install the XAMPP software and follow the same procedure as installing WordPress for a live website.

How to install WordPress locally with XAMPP-

Step 1: Download XAMPP localhost software

XAMPP supports all operating systems, and you can make your choice when downloading the software. As mentioned earlier, this is open-source software, you don’t need to provide any personal information.

Just go to the official website of XAMPP and find your operating system in the list. For Windows, you can choose XAMPP. Although the official website mentions Windows versions up to 8.0.12, you can use it for the above versions of Windows as well.

Select other operating systems like Linux and OS X if you use one of them. Once you press the download button, wait for a while as the file size is around 160 MB.

Step 2: Install XAMPP server on the local storage

Once you have downloaded the software on your PC, it is time to run the software for WordPress local install.

No special command is needed to install the software. Simply run the file and it will start the installation process. By default, it will show some options have been selected. But you don’t have to enable all these options.

To use localhost for WordPress, you just need to select Apache, MySQL and PHP.

Once you have selected these options for the checkboxes, click the Next button It will automatically start the installation process. This will show an option if you want to know more about Bitnami for XAMPP. Uncheck this box because you don’t need it.

However, if you have antivirus software on your PC, it may show some error messages. Simply select Continue and run the installation process. After final installation, it will show a message with a box. Click on the finish button and it will be done. Throughout the process, keep everything at default settings to avoid any complications.

Now XAMPP is installed on your PC. Continue to the next step to install WordPress on localhost.

Step 3: Start modules to test server

To install WordPress locally, you need to run Apache module and MySQL module.

Just go to XAMPP control panel and enable these modules.

Click on the Start button for both modules. These two modules will turn green after you activate them.

Step 4: Download WordPress for Localhost

When one uses a domain and virtual hosting, he can install WordPress directly on the hosting server.

For localhost, you will need to download the latest version of WordPress to your PC storage. Then you need to manually unzip the WordPress zip file to the target folder of XAMPP. Go to WordPress’s official website and download WordPress.

Step 5: Create a local database server

Now you need to create database for localhost where you will perform next steps. To do this, you will need to create a folder. This will be a folder where you will store all data for your local website.

Navigate to the folder where you downloaded the XAMPP software. If you keep everything to default settings, you will find the folder here – C:\xampp.

Under this link, you will see a folder called htdocs.

Open the folder and make a new folder for your local website. Note that the folder name will be the sub-name of your website. In the folder, unzip the downloaded WP file.

Now click on Admin button from MySQL module.

From the top, click Database and enter a name for your database. Here I have used wpment as the server name. Now click on Create button.

However, here you don’t need to create a user server like a regular WordPress installation for a live website.

Step 6: Install WordPress in XAMPP for Localhost

Now you can visit your local WP website with http://localhost/foldername link

Now provide the credentials for the database.

  • Database Name: Enter the database name you created for PHPMyAdmin here
  • Username: Put username as ‘root’
  • Password: Leave it blank

Complete the rest of the installation as usual.

If you set everything correctly, a new website will be created for localhost.

If you follow the steps correctly, you will never have to ask again how to install WordPress on localhost. Since XAMPP supports all operating systems, you don’t have to struggle with anything.

Be it a Mac or a Windows device, this method will help you install WordPress locally.

How to add themes and plugins to localhost?

Once you run a local website with XAMPP, you can install any WordPress plugins and themes you want. There are two ways to install themes and plugins on a localhost WordPress website.

In the first method, you need to visit the link http://localhost/yourwebsite/wordpress/wp-admin/ and provide the credentials you created while creating the site locally.

Next, from the WordPress dashboard, hover over Plugins > Add New.

Now search for the plugin you want to install. For example, suppose you want to install the popular WooCommerce plugin ShopEngine. Now search ShopEngine in the search box. The plugin will appear in the list.

Click the ‘Install Now’ button and then activate the plugin. Similarly, you can install other plugins.

But, if you have the zip file of the plugin, you can simply go to the XAMPP folder and then go to htdocs > your website > WordPress > wp-content > plugins. Copy and paste the zip file of the plugin. Unzip the file here and the plugin will be installed for the local website.

Likewise, you can install the ElementsKit all-in-one website design plugin, various form builders, and more on a local host. It will be useful for you to practice.

You can add a theme to your WordPress website. To install the theme directly on a local website, go to WordPress Dashboard > Appearance > Themes.

Next, search for the theme you want to install for the local website.

Alternatively, you can install WordPress themes and plugins directly on localhost. If you have a custom WordPress theme zip file, unzip it to the htdocs folder. But this time, instead of plugins, go to the ‘Themes’ folder. Unzip the theme file here and it will be installed for the local website.

How to uninstall WordPress on localhost?

In addition to installing WordPress locally, you need to learn how to install WordPress from localhost. Let’s learn!

Let’s say you’ve checked what you need for your projects and now you don’t need to use the software anymore. In that case, you can uninstall XAMPP software in few steps.

For Windows, go to Control Panel > Uninstall a Program. From the program list, select XAMPP and press the Uninstall button.

This will uninstall the XAMPP server.

Now you need to install XAMPP app from Windows. For this, search for Apps and Features in the Windows search bar.

Under the Apps and Features option, locate the XAMPP app. Click on the app icon, and it will show the uninstall option. Press the button, and it will uninstall the XAMPP app.

Now find the uninstall.exe file for XAMPP from C:\xampp folder. Run the file, and it will remove all files and features of XAMPP.

If you follow all these steps, the localhost software will no longer be available on your PC.

Scroll to Top