If you have a WordPress website, you might want to make certain changes to it or conduct troubleshooting in order to improve the user experience. Unless you’re a network administrator or trained in IT, however, you might be understandably afraid to make alterations on your live site.
Fortunately, localhost is a tool you can use to fix errors and test new plugins on your website without making them visible to your audience. Building locally can help you create a WordPress site in an affordable, fast, and test-friendly manner. Best of all, you don’t need to be a developer to understand what localhost is or use it to benefit your website.
This post will discuss what localhost is, and why you may want to create a local WordPress website. It will then briefly cover how to install WordPress on your computer using Local. Let’s get to work!
What Localhost Is
Localhost is a term that refers to the computer in use. It can be helpful to think of it as “the computer I am working on”. Some programmers call it “home” or “home computer.”
Localhost can also refer to the computer’s address or a “loopback address.” When you type in a URL, you are essentially connecting to another existing host computer. Using localhost, on the other hand, means accessing files on your local machine:
Localhost is most often used for testing and development. It is typically assigned the IP address 127.0.0.1.
Why It’s Useful To Know About Localhost
Localhost aids in testing certain features and speeds up development. It’s helpful for beginners to know how to install a local WordPress site, because it can allow you to design your pages quickly. You can also test tools and plugins locally before you make them live on your WordPress site.
Having a local version of your website also allows you to troubleshoot errors without disrupting the user experience. Plus, it enables you to work offline, and it eliminates the risk of people stumbling across a broken or half-finished site.
How To Start a Local WordPress Website (In 5 Steps)
Starting a local WordPress site means that your website’s files are stored on your computer and not on a third-party server. Now, let’s walk through how to start a local WordPress site in five steps.
Step 1: Download the Local Software
First, you need to download software that enables you to create a localhost environment. There are many options, but we will be using Local in our walkthrough. This is a beginner-friendly, free program developed by WP Engine. It offers a fast localhost environment, dedicated WordPress setup, and site import and export (among other features).
To get started, go to localwp.com and click on Download:
Choose your platform, then enter your name, email, and phone number (if you choose to) in the popup. After that, click on the Get It Now button. The download will start automatically.
Step 2: Open Local and Create Your Website
Once the download is complete, open up the application. It will prompt you to create a new website. Give your local WordPress site a name:
From here you can choose the environment in which to set up your WordPress site. There are both Preferred and Custom options. We will be using the Preferred, as it’s sufficient for most users:
Type in a WordPress username and password, making sure to write both down so you don’t forget them. A Provisioning Services screen should appear while Local is downloading the latest version of WordPress.
Step 3: Log In to Your New Local Site
After WordPress is downloaded, go to the main Local screen. From there, click on WP Admin:
Log in to your website using your username and password. You now have a locally-hosted WordPress website on your computer:
Your local site should open up in your web browser, as shown above.
Step 4 (Optional): Access Your Site’s Database
At this point, your local WordPress website is ready to go. You can use the admin dashboard to make whatever changes you like, just as you would with your live site.
Depending on your goals, you may also need to access the site’s database. For example, you may need to modify these files directly if you’re troubleshooting an error or making custom changes to your site.
To access your website’s database, go to the Database tab in Local, and click on Open Adminer:
The database will open in your browser:
Here you can make whatever changes or perform whatever tests you want to. This is also an excellent way to learn about your site’s database if you’re new to development, since you can experiment without risking your live site.
Step 5 (Optional): Import a Copy of Your Live Site
The first three steps above are sufficient if you want a brand-new testing site. If you need a copy of your live site for staging purposes, however, you’ll need to export the database and files and import them into Local. This method relies on File Transfer Protocol (FTP) and phpMyAdmin – it can be a bit more challenging if you’re not an experienced developer.
There are two main ways to do this: with a plugin or manually. Duplicator is a good option for WordPress users, and is relatively beginner friendly. You can also manually export data from your live server to your local environment. This will require:
- Exporting your WordPress database
- Creating a new database
- Updating the wp-config file
You can learn more about how to import a copy of your live site on our blog, and explore how to use Local for WordPress development.
Once you have a basic understanding of what localhost is and how to develop a site locally on your computer, you can start to reap its benefits. By following our guide, you’ll have the freedom to develop your website without impacting your users. Local hosting is a zero-cost way to set up your site quickly, test plugins, troubleshoot errors, and improve site speed.
All you’ll need to do is:
- Download the Local software.
- Use Local to create your local website.
- Log in to your new site.
- Optionally, access your database to make changes, and/or import a copy of your existing site.
Do you have any questions about localhost or how to launch a local WordPress website? Let us know in the comments section below!
Start the conversation