Want to learn how to move your live WordPress site to localhost?
Moving a WordPress site to a local host offers several advantages. It provides a secure testing environment where you can experiment with themes, plugins, and updates without affecting your live site. Additionally, working on a local host allows for faster development and troubleshooting, as you eliminate any delays caused by network connections and potential server limitations.
In this step-by-step tutorial, we’ll show you how to move WordPress to a local host!
Can You Locally Host a WordPress Site?
Yes. By using software such as XAMPP, MAMP, WAMP, or LocalWP, you can set up a local server environment on your computer. This will install WordPress and run it locally, allowing you to develop and test your website without needing an internet connection or a live server.
Why You Might Want to Locally Host Your WordPress Site
Whether you’re a developer, designer, or just want to make a few changes to your website, it’s a good idea to build a locally hosted site. Essentially, this involves creating a copy of your live WordPress site and hosting it on a local server on your computer.
This gives you an exact copy of your website to mess around with while your live site remains unchanged. You can edit your WordPress theme, update plugins, and add new content all without affecting the functionality of your actual website.
Here are the main benefits of having a local WordPress site:
- Build an isolated testing environment: With a local host, you create an independent testing environment where you can freely experiment without impacting the live site. This allows you to test new themes, plugins, and code changes without the risk of breaking anything on the production website. You can also push changes without downtime, so you won’t harm your SEO.
- Start learning WordPress: If you’re new to development or design, you can create a local site to build your skills. You’ll be free to learn coding on an offline, free website.
- Offline availability: Local hosting allows you to work on your WordPress site even without an internet connection. This is particularly useful when you are traveling or in situations where a stable internet connection is not readily available. You can continue to develop, design, and test your website regardless of your internet access.
- Faster development: Hosting WordPress locally gets rid of the dependency on internet connectivity and server response times. This results in a faster workflow, allowing you to make changes, test them, and see immediate results.
- Confidentiality and privacy: Local hosting ensures that your work remains confidential and private. You can work on sensitive projects without the risk of exposing them to the public. This is especially important when working on your clients’ websites.
- Cost savings: If you don’t have a live WordPress website, you can build a local site before paying for web hosting services, saving you money in the long run. You can build your first website without any extra costs. This is particularly beneficial for individuals or small businesses on a tight budget.
Ultimately, creating a locally hosted site can give you greater control, flexibility, and a safer space to experiment and refine your WordPress website.
How to Move a Live WordPress Site to a Local Host
Now that you know the benefits of hosting your WordPress site locally, let’s walk you through the process of moving your data to a local server!
Step 1: Install Duplicator Pro
If you want to start testing site changes in a local environment, you’ll want to migrate an exact copy of your data to a local server. Although this sounds like a difficult task, Duplicator simplifies the process.
Duplicator is the best WordPress backup and migration plugin. It can bundle your entire live website into a single zip file. This allows you to transfer all of your WordPress files, plugins, themes, and database tables to a new location:
Here are some more useful features included in Duplicator Pro:
- Manual and automatic backups
- Cloud backup storage
- Supports large sites and Multisite networks
- Recovery points for quick site restoration
- Drag-and-drop imports
- Empty site support
- Email notifications for timeouts
First, select a subscription for Duplicator Pro. You can use a free version of the plugin, but a premium plan supports drag-and-drop migrations. This can be especially helpful as you’re moving changes to and from your production site.
After your purchase, copy your license key. Then, install and activate Duplicator Pro on your live WordPress site. If you’re not sure how to do this, follow this guide on installing WordPress plugins.
Before you start using Duplicator, you’ll need to activate your license. Go to Duplicator Pro » Settings » Licensing and find the License Key setting:

Paste your license key and hit Activate. Then, feel free to continue to the next step!
Step 2: Create a Package
As its name suggests, Duplicator allows you to duplicate your entire website. To create this copy, you’ll need to create a backup, or package. This can then be easily transferred to a new domain name, another hosting provider, or a local host.
To get started, navigate to Duplicator Pro » Packages » Create New:

Give the package a name and choose Local for the storage location:

If you want to move all of your data, don’t make any changes to the archive file. However, you can also exclude certain site files or only back up your WordPress database instead:

When you’re done with this, click on Next. Then, Duplicator will scan your live website. You’ll see notices if anything needs your attention:

After reviewing these notices, hit Build. Once Duplicator automatically builds a copy of your website, you’ll see it on the Packages page:

Be sure to download both the archive and installer files.
Step 3: Build a Local Site
Next, you’ll need to set up a local site that’s hosted on your computer. To do this, it’s important to find a local server environment.
Here are some effective options:
- LocalWP (Mac, Windows, and Linux)
- WAMP (Windows)
- MAMP (Mac)
- XAMPP (Mac, Windows, and Linux)
In this tutorial, we’ll be focusing on LocalWP and MAMP. To see how the WAMP and XAMPP installation processes differ, check out these tutorials:
How to Install WordPress on a Windows Computer
How to Create a Local WordPress Site Using XAMPP
Method 1: Building a Local Site Using LocalWP
LocalWP is one of the most popular tools for building local WordPress sites. After just one click, it will automatically install WordPress for you. Unlike other local software, LocalWP is compatible with Mac, Windows, and Linux:

To start creating your local site, go to the LocalWP website and click on Download For Free. Then, choose your operating system:

After you install the app, click on the + icon in the bottom left corner. This will allow you to add a new local site:

Select Create a new site and continue:

Then, name the new local site:

If you’re a developer, you can customize the local environment with a specific version of PHP, Apache, and MySQL. To do this, select Custom. However, Preferred will set up a general WordPress installation for you:

Lastly, provide a username, email address, and password for the site:

LocalWP will take just a few minutes to set up your new local WordPress site.
Method 2: Building a Local Site Using MAMP
Many people decide to use MAMP for Mac computers and WAMP for Windows. Either of these options will quickly install WordPress and host it on your local computer. We’ll be using MAMP in this guide.
You’ll need to start by going to the MAMP website and downloading the version that is compatible with your computer:

When you open this file, MAMP will walk you through some installation instructions. If you follow these steps, you’ll see a success message:

Now, open the MAMP app and click on Preferences » Ports. Here, set the Apache Port to 80 and hit OK:

After this, head over to the Server tab. Under Document root, you can choose a folder to store your local site:

By default, this will be Applications » MAMP » htdocs.
Step 4: Create a Database
Before you start moving your original files to the local site, you’ll need to create a new database. You can do this in your phpMyAdmin dashboard. To find this, open one of the following links:
http://localhost/phpmyadmin/
http://localhost:8080/phpmyadmin/
Then, click on New. Add a name for your new site’s database and hit Create:

Now you’re free to install your backup on the local site!
Step 5: Install Your Backup Files
To make sure your local site looks and feels exactly the same as your live site, you’ll need to import the backup that you saved earlier. We’ll show you how to do this using both LocalWP and MAMP.
Method 1: Installing Your Backup Files on LocalWP
If you have WordPress already installed on the local site, you can simply drag and drop your archive file into it. To show you how this works, we’ll use LocalWP.
Open the app and select your local site. Along with details about the site, you’ll see a WP Admin button:

Click on this to access your new local environment. If you’re opening it for the first time, you’ll need to sign in. Then, install Duplicator Pro as a plugin.
After activating Duplicator, find the Import page. Here, you can simply drag and drop your saved archive file:

Once the package is ready to install, continue:

You’ll need to confirm that you want to launch the installer and replace any content currently on the local site:

Then, Duplicator will walk you through the installation. First, make sure the Install Type is a Full install single site. Then, accept the terms and notices and hit Next:

Lastly, confirm the installation:

Your production website will automatically be imported into the local site! When this is finished, use the Admin Login button to start testing your site locally.
Method 2: Installing Your Backup Files on MAMP
If you created your local site with applications like MAMP or WAMP, WordPress won’t be automatically installed. But don’t worry, Duplicator can import your website into a completely blank local site.
First, find the folder where you installed MAMP. In our case, it was Applications » MAMP » htdocs. Here, create a new folder for your local site:

Copy both the archive file and installer script that you downloaded with Duplicator. Paste them into this folder:

Now, open a browser window and run the installer.php script. To do this, simply search for this URL:
http://localhost/local-site/installer.php
However, remember to replace local-site with the custom name of your folder.
This will open the Duplicator installer. Scroll down to Setup, where you’ll enter your new database information:

Be sure to enter the new database name. For local sites, the host name is localhost and the user is root. Usually, you can leave the password blank, but this could also be root.
After this, hit Validate to test the database. Review any notices, accept the terms and notices, and continue:

Just like we did with the LocalWP site, you’ll need to confirm your installation settings:

The Duplicator plugin will then extract the archive file. You’ll see an option to log into the WordPress dashboard for your new local site!
Frequently Asked Questions (FAQs)
To make sure you correctly move your live WordPress site to a local host, let’s answer some common questions about the process!
How do I move my WordPress site without cPanel?
You can move your WordPress site without cPanel by installing Duplicator Pro. This plugin allows you to download a package of your site that bundles its files and database information. Then, you can install Duplicator Pro on a second site and drag and drop your site package directly into it.
Can I start a WordPress site without a domain?
Yes, you can create a WordPress site on a local server without needing a domain name or a hosting provider. You’ll first need to choose a local development software like LocalWP, XAMPP, MAMP, or WAMP. These will guide you through the process of installing WordPress.
How do I manually move a live WordPress site to a local host?
To move your site manually, open your hosting account dashboard. Then, log into phpMyAdmin and export your database as a SQL file. You’ll also need to use a File Manager or FTP client like FileZilla to export files in your public_html folder.
Install MAMP or WAMP and create a folder for your local site. Here, copy and paste your exported WordPress files.
Next, open phpMyAdmin for the local site. Open the Import tab and click on the Choose File button. Then, add your zipped database file.
After this, it’s time to replace all the URLs in the database that reference your live site. To do this, go to the SQL tab in phpMyAdmin and paste this SQL query:
UPDATE wp_options SET option_value = replace(option_value, 'https://www.example.com', 'http://localhost/local-site') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET post_content = replace(post_content, 'https://www.example.com', 'http://localhost/local-site');
UPDATE wp_postmeta SET meta_value = replace(meta_value,'https://www.example.com','http://localhost/local-site');
Remember to replace all the URLs with your unique production site and local site links. Also, be sure to use HTTPS if you have an SSL on your live site. Then, hit the Go button.
Lastly, you’ll need to update the wp-config.php file. Find your local site folder and open this file in a text editor. Here are the MySQL database values you’ll need to update:
- DB_HOST
- DB_NAME
- DB_USER
- DB_PASSWORD
Finally, to make sure every URL links to the local site, open your WordPress options table in phpMyAdmin. For both siteurl and home, change the option_value to your localhost URL.
Conclusion
You now have a locally hosted website where you can safely update your live WordPress site!
Do you want to back up your live site before migrating it to a local server? Check out our beginner’s guide on backing up WordPress.
Are you ready to start enjoying the benefits of a local host? Download Duplicator Pro to seamlessly migrate your live data to your local computer!