Move WP from localhost to live server

So, you built a shiny new WordPress website on your local machine—congrats! 🎉 Now comes the exciting part: moving it online, live for the world to see. If the idea sounds scary, relax. It’s much easier than you think!

TLDR 🤓

Moving your WordPress site from localhost to a live server is pretty straightforward. You’ll need to move your files, migrate the database, and update a few settings. Tools like phpMyAdmin and an FTP client make things simple. With a few steps and a bit of patience, your site will be live and kicking in no time.

Why Develop Locally?

Before diving into the move, let’s answer a question. Why work locally in the first place? Well, here’s the deal:

  • Speed: No uploads or server delays.
  • Safety: Break things without consequences.
  • Privacy: No one sees your unfinished masterpiece.

But when it’s showtime, your localhost isn’t going to cut it. People can’t access your computer like they do a website. You need a host server.

What You Need to Make the Move

Before you begin, make sure you have the following:

  • FTP client like FileZilla
  • Hosting provider details – cPanel login, database access, etc.
  • Access to phpMyAdmin both locally and on the server
  • Your local WordPress site ready to go

Step 1: Export Your Local WordPress Database

This is where all your content and settings live. You’ll need to export it.

  1. Go to http://localhost/phpmyadmin
  2. Select your WordPress database
  3. Click Export
  4. Choose Quick and SQL format
  5. Click Go – your SQL file will download

Easy so far, right? Let’s keep going.

Step 2: Upload Your Files to the Live Server

Now, take those WordPress files and put them onto your live site.

  1. Open your FTP client
  2. Connect to your hosting server using your login
  3. Navigate to the /public_html or root folder
  4. Upload everything from your local WordPress folder (including wp-content, wp-admin, and those loose files like wp-config.php)

This part may take a few minutes depending on your internet speed. Stretch, grab a coffee ☕️!

Step 3: Create a New Database on the Server

Once the files are uploaded, it’s time to create a place for all your content—aka, the database!

  1. Log into your web hosting control panel (like cPanel)
  2. Go to MySQL® Databases
  3. Create a new database
  4. Create a new database user, and give it a strong password
  5. Assign the user to the new database and select All Privileges

Take note of the database name, username, and password. You’ll need these in the next step.

Step 4: Import the Database to the Server

Now, move your local SQL file into the new database.

  1. Go to phpMyAdmin on your host
  2. Select your new database
  3. Click Import
  4. Choose your SQL file and click Go

Take a breath… you’re over halfway there 🎉

Step 5: Update wp-config.php

This file tells WordPress how to connect to the database. Let’s update it.

  1. Find and open wp-config.php in your uploaded files on the server
  2. Change the database name, username, and password to match the new ones from your server
  3. The lines to change look like this:
define('DB_NAME', 'your_new_db_name');
define('DB_USER', 'your_db_username');
define('DB_PASSWORD', 'your_db_password');
define('DB_HOST', 'localhost');

Save the file and re-upload it if needed.

Step 6: Fix Your Site URL

Words don’t just float in the void. Your local site needs to recognize its new online home.

  1. Back in phpMyAdmin on the server, go to your database
  2. Open the wp_options table
  3. Find the rows for siteurl and home
  4. Edit them to match your live URL – like https://yourdomain.com

Tip: If your site uses a different table prefix than wp_, look for it as prefix_options

Step 7: Search & Replace Old URLs

Your database may still have links and images pointing to localhost. Not good. Let’s fix that.

Use a tool like the Better Search Replace plugin or the Search Replace DB script.

Search for:

http://localhost/yoursite

And replace it with:

https://yourdomain.com

Run it carefully, and always back up first!

Step 8: Test Everything

Moment of truth. Open your browser and type in your domain.

Do you see your site? Hooray! 🎉

Now check:

  • Images loading correctly
  • Internal links
  • Forms and contact pages
  • Admin dashboard access

If something looks broken, retrace the steps. It’s usually a small mistake—not the end of the world.

Optional: Set Up Permalinks

Sometimes pretty URLs don’t work after a move. Fix it easily:

  1. Go to Settings → Permalinks
  2. Choose your format (usually Post Name)
  3. Click Save Changes – even if nothing seems different

This refreshes the URL rules on your new server. Problem solved!

Done and Dusted ✨

You’re now a WordPress migration master! From a simple localhost to an epic online presence, you did it. 🙌

To recap, here’s the big picture:

  • Export your database
  • Upload your WordPress files
  • Create and import your database
  • Edit wp-config.php
  • Update site URL and home settings
  • Run search & replace to fix links
  • Test, test, test!

Ready to show the world your awesome site? Go ahead, share that URL proudly. 🚀