You built your site locally, it looks great, and now you need the internet to see it. Learning how to move WordPress from localhost to a live server is mostly about doing a handful of steps in the right order — export the database, copy the files, and carefully swap the local web address for your real domain. That last part trips up most people, so we’ll be specific about it. Here’s the full process, start to finish.
A quick note before you begin: a local WordPress install (built with a tool like Local, MAMP, or XAMPP) is just files plus a database. Moving it live means recreating both on your host and telling WordPress its new home address. That’s the whole job.
Step 0: Get your live hosting ready
Before you touch the local site, make sure your live environment exists: a hosting account, your domain pointed at it, and an empty database created (note the database name, username, and password — you’ll need them). Setting up SSL (the certificate behind the HTTPS padlock) now, so the site is HTTPS from the first visit, saves you a fix later.
Step 1: Export the database from localhost
Your content — posts, pages, settings, users — lives in the database, not the files. Open the database tool your local setup uses (usually phpMyAdmin) and export the site’s database as a single .sql file. Choose a standard export; you don’t need anything custom. That file is half your site.
Step 2: Copy the files to the live server
The other half is the files. Grab the entire WordPress folder from your local install — especially the wp-content directory, which holds your theme, plugins, and every image and upload. Connect to your live server with an SFTP (a secure way to connect to your site’s files) client (or your host’s file manager) and upload everything into the site’s root directory.
Depending on file sizes this can take a while, particularly the uploads folder. Let it finish completely before moving on — a half-copied site is a broken site.
Step 3: Import the database on the live server
On your live host, open its database tool, select the empty database you created in Step 0, and import the .sql file you exported. When it finishes, all your content now lives on the server. It isn’t connected to anything yet — that’s the next step.
Step 4: Update wp-config.php with the live database details
WordPress finds its database using credentials stored in the wp-config.php file. Right now that file still points at your local database, so open it on the live server and update three values to the live database name, username, and password from Step 0. Save it. WordPress can now talk to its content on the live server.
Step 5: Fix the URLs — carefully
This is the step that breaks migrations when done wrong. Throughout your database, WordPress has stored your local address (something like http://localhost/mysite) in hundreds of places — in settings, in links, embedded in content. Every one of those needs to become your real domain, or images will 404 and links will point back to a site only you can see.
The critical warning: do not do a blind find-and-replace with raw database queries. WordPress stores some data in a packed format (called serialized data) that records the length of each piece of text. A dumb search-and-replace changes the text but not the recorded length, which quietly corrupts those settings — often theme and widget options.
Use a tool built to handle this safely instead. Either the free WP-CLI command-line tool’s search-replace (which understands serialized data), or a reputable plugin such as Better Search Replace, run once to swap the local URL for your live domain across the whole database. Those tools do the length math correctly so nothing breaks.
Step 6: Go live and test everything
Now walk the site as a visitor would. A short checklist:
- Log in and refresh permalinks. In Settings → Permalinks, just click Save once — this rewrites your link structure for the new server and fixes most “page not found” errors on inner pages.
- Click through your pages. Confirm images load, menus work, and internal links go to the live domain, not localhost.
- Test forms and any checkout. Submit a contact form and, if you have a store, run a test order.
- Confirm HTTPS. Make sure every page loads with the padlock and there are no “mixed content” warnings from assets still requested over HTTP.
- Check on mobile. Load the live site on a phone, not just your desktop, before you call it done.
When it doesn’t go smoothly
Two problems account for most launch-day panic. A blank white page usually means a PHP (the programming language WordPress runs on) error — often a plugin or a memory limit — and can be traced by turning on debugging or deactivating plugins. A database connection error means the credentials in Step 4 don’t match the live database. If you hit a wall, our guides to the restoring from a backup and diagnosing common breakages are a calm place to start, and a backup taken before you flip anything is your safety net.
The shortcut: let the move be done for you
Every step above is doable, but it’s fiddly, and the URL step in particular is unforgiving. That’s why migration is included free on managed hosting — you hand over the site and it arrives live, with the database swapped and the URLs fixed correctly, verified to look and work the way it did locally. Our US-based team does this routinely, so a first-timer’s launch-day gotchas simply don’t happen to you.
If you’d rather ship your work than debug serialized data, that’s the option to take. See what’s included on our hosting page. And once you’re live, the safe way to make future changes is a staging site — a private copy you test on before touching the real thing. Moving an online store instead of a local build? We cover that specific case in migrating a WooCommerce store.
Prefer not to do any of this yourself? We move your site for you – free, with zero downtime. See how our migration works, or start my move.