Codepen Blog
  • Home
  • About us
  • Contact us
Codepen Blog
  • Home
  • About us
  • Contact us
Wednesday, December 17, 2025
Top Posts
Top 10 AI Logo Generators in 2023 with the Majority Being...
Ultimate Guide to install and setup WordPress multisite
Upload WordPress From localhost to live server in 2024
Top 10 Best WordPress Themes for Woocommerce in 2024
Top 11 WordPress Mobile Plugin for Optimal Usage in 2024
The Ultimate Guide to Self-Hosted WordPress Website
SSH-ing into a Docker container: a step-by-step guide
Creating a Complete Homepage Using Divi AI – Step by Step...
How to use ftp or sftp server to transfer files in...
Top 5 hosting to WordPress Staging Site with plugins in 2024
SUBSCRIBE NEWSLETTERS
Codepen Blog
Codepen Blog
  • Contact us
Copyright 2021 - All Right Reserved
WordPressLive ServerLocalhost

Upload WordPress From localhost to live server in 2024

by developershohel December 30, 2023
written by developershohel December 30, 2023 Pay Writer
Upload WordPress From localhost to live server in 2024
7.2K

Table of Contents

Toggle
  • Are you interested in uploading WordPress from a localhost to live server?
  • Reasons for Migrating WordPress From a Localhost to a Live Server
  • Preparations Before Migrating Your WordPress Site
  • Approach 1: Transferring WordPress From the Localhost to the Live Server Using a Migration Plugin (Recommended)
      • Step 1: Installation and Configuration of the Duplicator Plugin
      • Stage 2: Generate a Database for Your Live WordPress Website
      • Step 3: Transfer Files from Localhost to Live WordPress Website
      • Step 4: Executing the Migration Script
  • Approach 2: Manually Relocate WordPress From the Localhost to Live server
      • Step 1: Export Local WordPress Database
      • Step 2: Upload WordPress Files to Live Site
      • Step 3: Create a MySQL Database on Your Live Site
      • Stage 4: Bring in WordPress Database to Active Site
      • Step 5: Adjust the Website URL
      • Stage 6: Establish Your Active Site
      • Step 7: Rectify Images and Broken Links by Updating Paths
  • Conclusion
    • Pay Writer

Are you interested in uploading WordPress from a localhost to live server?

Utilizing WordPress on a local server is a common method for working on your site privately. Eventually, you will need to migrate it to a live server to make it accessible to online visitors.

You Might Be Interested In
  • Top 10 Best WordPress Themes for Woocommerce in 2024
  • How to Send Automated Birthday and Anniversary Emails in WooCommerce
  • The Best Way How to Choose a WordPress Theme in 2024
  • Complete Beginner’s Guide: How to Install WordPress Easily
  • Ultimate Guide to install and setup WordPress multisite
  • How to Backup WordPress Site Using cPanel in 2024

In this post, we will present you how to Upload WordPress From localhost to live server in 2024

Reasons for Migrating WordPress From a Localhost to a Live Server

Constructing your WordPress blog on a localhost provides a secure environment for testing changes on your website without impacting visitors.

Once you have perfected your website, the next phase involves migrating it from your local server to a live site.

We will guide you through two different methods for moving your site from a local server to live server.

The first approach involves utilizing a WordPress migration plugin and is particularly recommended for beginners.

In the second approach, we will demonstrate how to manually transfer WordPress from a localhost to a live server.

Preparations Before Migrating Your WordPress Site

Before you can migrate WordPress from a localhost to a live server, you need to ensure a few prerequisites are in place.

Initially, we assume that you have a WordPress site running on a localhost on your computer, and you have complete access to it.

Subsequently, you will need to own a domain name as well as web hosting.

To facilitate your decision-making process, we recommend opting for Bluehost. They are an officially endorsed WordPress hosting company, offering an exclusive discount + free domain and SSL for all users.

Essentially, you can commence for as low as $2.75 per month.

If you seek an exceptional Bluehost alternative, consider Hostinger. They are also extending an exclusive discount to All users along with a free domain name.

If you require assistance in setting up your website, follow our detailed guide on how to install a WordPress website.

Lastly, you will need an FTP program and possess knowledge of how to use FTP to upload your local server site to the live server.

Ready? Let’s initiate the migration process for your WordPress site.

Approach 1: Transferring WordPress From the Localhost to the Live Server Using a Migration Plugin (Recommended)

This approach is simpler and recommended for beginners. We will be utilizing a WordPress migration plugin to transfer WordPress from localhost to a live site.

Step 1: Installation and Configuration of the Duplicator Plugin

Initially, you need to install and activate the Duplicator plugin on your local site.

After enabling it, head to the section Duplicator » Packages and press the ‘Create New’ option.

create-new-package

This action will take you to a screen where you can assign a name to your backup.

Subsequently, hit the ‘Next‘ button.

name-backup-duplicator

Duplicator will then execute certain checks to examine if everything complies.

If all items are tagged as ‘Good‘ then select the ‘Build‘ Button.

build-package

This process may require a few moments, depending on your website’s size. It is essential to keep this tab open until the process concludes.

Upon completion, you will find download choices for the ‘Installer‘ and ‘Archive‘ packages. You need to hit the ‘One-Click Download‘ link to acquire both files on your device.

download-package-files

The ‘Archive‘ file comprises an entire replication of your WordPress site, encompassing all WordPress central files alongside your visual content, uploads, themes, plugins, and a backup of your WordPress database.

The ‘Installer‘ file constitutes a script that will automate the entire migration process by unpacking the archive file housing your site.

Stage 2: Generate a Database for Your Live WordPress Website

Before you can operate the installer or upload the WordPress site from localhost to your server, you’re required to form a MySQL database for your fresh live site.

If you have previously established a MySQL database, this step can be omitted.

To establish a database, visit your hosting account’s cPanel dashboard. Afterward, pinpoint the ‘Databases’ division and select the ‘MySQL Database Wizard‘ icon.

mysql-database-wizard

On the following screen, there’s a section for constructing a new database.

Simply furnish a title for your database and tap the ‘Create Database‘ button.

name-new-database

cPanel will create a new database for you.

Post this, you’ll need to input a username and password for your recent user and then click the ‘Create User‘ button.

create-new-database-user

To proceed, the writers, you need to include the user you freshly constructed in the database. Initially, tick the ‘All Privileges’ checkbox.

check-all-privileges
Then, proceed downwards and select the ‘Make Changes’ button to store your modifications.The database is now set to be applied with your WordPress site. Make certain to jot down the database name, username, and password. You’ll need this info in the following step.

Step 3: Transfer Files from Localhost to Live WordPress Website

Currently, you are required to transfer the archive and installer files from your local site to your hosting account.

Initially, connect to your live site using an FTP client. Upon connection, make sure the primary directory of your website is entirely clear.

Generally, the central folder is the /home/public_html/ directory.

Some WordPress hosting firms automatically install WordPress upon registration. If there are WordPress files there, you must delete them.

Following that, you can transfer the archive.zip and installer.php files from Duplicator to your vacant root directory.

upload-archive-installer

Step 4: Executing the Migration Script

Once you have transferred the migration files, you must go to the following URL in your web browser:

http://example.com/installer.php

Remember to change ‘example.com’ with your own domain name.

This will initiate the Duplicator migration wizard.

The installer will run several assessments and activate the script.

duplicator-dbsettings

Beneath the Setup section, you will be prompted to input your MySQL host, database name, username, and password.

Your host will probably be localhost. Subsequently, you will enter the specifics of the database you fabricated in an earlier phase.

Then, hit the ‘Validate’ button to confirm the accuracy of the details you provided.

duplicator-validate

After that, tap the ‘Next’ button to proceed.

Duplicator will now transfer your WordPress database backup from the archive to your new database.

It will also revise URLs directing the local site to your new live site.

You can now press the ‘Admin Login’ button to access the WordPress admin section of your live site.

admin-login

Once logged in to your live site, Duplicator will automatically clear up the installation files.

This concludes the process. You have effectively transferred WordPress from the localhost to your live site.

Approach 2: Manually Relocate WordPress From the Localhost to Live server

In this approach, we will present you with the manual mode of transferring WordPress from the local server to your live website. It will come in handy if the initial procedure is not productive or if you would rather do it manually.

Step 1: Export Local WordPress Database

To begin with, the first step involves exporting your local WordPress database. You will use phpMyAdmin for this purpose.

Simply visit http://localhost/phpmyadmin/ and select your WordPress database. Then, click on the ‘Export’ option from the top menu bar.

localhost-export

In the ‘Export method:’ section, you can choose either ‘Quick’ or ‘Custom’. The ‘Custom’ option will present you with more alternatives for exporting your database.

However, we suggest selecting ‘Quick’ and then clicking the ‘Go’ button to fetch your database.

exportdb

Step 2: Upload WordPress Files to Live Site

Subsequently, we will have to transfer all your website files to the live site.

To start this process, proceed to open your FTP client and connect to your web hosting account.

Once you have successfully connected to your live site, ensure that you upload the files in the appropriate directory. For instance, if you want the site to be hosted on ‘yoursite.com’, then you should upload all the files in your public_html directory.

Now choose your local WordPress files and transfer them to your live server.

Upload WordPress files FTP

Step 3: Create a MySQL Database on Your Live Site

While your FTP client is busy transferring your WordPress files, you can initiate the process of importing your database to the live server.

Most WordPress hosting providers provide cPanel for managing your hosting account.

Initially, you need to log in to your cPanel dashboard and click on the ‘MySQL Database Wizard’ icon located in the ‘Databases’ section.

mysql-database-wizard

Next, on the following screen, you can create a new database.

You are required to specify a name for your database, and then click ‘Create Database’.

Name and create new database

cPanel will then proceed to automatically create a new database for you.

Afterward, you need to input a username and password for your new user, and then click ‘Create User’.

create-new-database-user

Subsequently, you will need to add the user you just created to the database.

Initially, check the ‘All Privileges’ checkbox.
check-all-privileges
After that, proceed downward and click on ‘Make Changes’ to store your modifications.
You have effectively established a new database for your active WordPress website.

Stage 4: Bring in WordPress Database to Active Site

The following phase in the process is to integrate your WordPress database.

Head to your cPanel dashboard, scroll to the ‘Databases’ section, and select ‘phpMyAdmin’.

select-phpmyadmin

This action will redirect you to phpMyAdmin, where you must select the database you recently created. phpMyAdmin will display your new database devoid of any tables.

Subsequently, select the ‘Import’ tab in the upper menu. On the import page, tap on the ‘Choose File’ option and then pick the database file from the local site you stored in the initial step.

phpmyadmin-import

Afterwards, press the ‘Go’ option at the end of the page. Your database will be automatically brought into phpMyadmin.

Step 5: Adjust the Website URL

Now, you must modify the website URL in your database to enable connectivity with your active WordPress site.

In phpMyAdmin, locate the wp_options table in your database, which you imported earlier.

If you altered your database prefix, then the table might be {new_prefix}_options instead of wp_options.

Then, click on the ‘Browse’ icon adjacent to wp_options. Alternatively, click the link on the side to reveal the page containing a list of fields within the wp_options table.

browse-wp-options

Subsequently, in the options_name column, find the siteurl option.

Then, select the ‘Edit’ symbol.

siteurl

This action will display a window for modifying the field.

In the input box for option_value, you will find the URL of your local installation, which will resemble http://localhost/your-local-host-url.

You should insert your new website URL in this field, for example: https://codepen.blog.

Subsequently, save the field by clicking the ‘Go’ option.

edit-siteurl

Next, follow the same steps as before for the home option name. The wp_options menu might span multiple pages. Typically, the home option will be on the second page.

After that, update the home URL to match your active site URL.

Stage 6: Establish Your Active Site

Now that you have integrated the database and uploaded your content, it’s time to set up WordPress.

At this point, your site should display an ‘Error establishing a database connection‘ error.

To resolve this issue, establish a connection to your website using an FTP client and access the wp-config.php file.

You will need to search for the subsequent lines of code:

1
2
3
4
5
6
7
8
9
// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define( 'DB_NAME', 'database_name_here' );
/** MySQL database username */
define( 'DB_USER', 'username_here' );
/** MySQL database password */
define( 'DB_PASSWORD', 'password_here' );
/** MySQL hostname */
define( 'DB_HOST', 'localhost' );

You will be required to input the database name, username, and password you generated previously.

Then, save the wp-config.php file and re-upload it to your WordPress hosting server.

Subsequently, when you access your website, it should be operational.

Once done, access your WordPress admin panel and navigate to the Settings » General section. Afterwards, without making any modifications, scroll to the bottom and click on the ‘Save Changes’ button.

save-general-settings

This action will ensure that your site URL is corrected wherever necessary.

Once completed, move to the Settings » Permalinks section, then scroll down and click on ‘Save Changes’ to confirm that all post links are functioning properly.

save-permalinks-settings

Step 7: Rectify Images and Broken Links by Updating Paths

Whenever you are relocating a WordPress site from one domain to another or from a local server to a live site, you will encounter broken links and absent images.

An easy method to modify the URLs is by utilizing the subsequent SQL query:

1
UPDATE wp_posts SET post_content = REPLACE(post_content, 'localhost/test/', 'www.yourlivesite.com/');

Simply access phpMyAdmin, select your database, and then choose ‘SQL’ from the top menu and input the query above.

Remember to customize it to your own local site and live site URLs and then click on the ‘Go’ button.

That’s all. You have successfully relocated WordPress from your nearby server to a live site.

Conclusion

In conclusion, Uploading WordPress from a localhost to a live server is a crucial step in making your website accessible online. Whether using a migration plugin for a beginner-friendly approach or opting for manual transfer, the process involves steps like database creation, file uploads, and URL adjustments.

The recommended Duplicator plugin simplifies the task, while the manual method provides flexibility. Ensure a smooth transition by following each step meticulously, and once completed, your WordPress site will be live, and ready for online visitors. Take the time to rectify broken links and images, and your website will seamlessly integrate into its new online environment. Happy website launch!

Free Tips One: How To Use Ftp Or Sftp Server To Transfer Files In 2024

Free Tips Two: Complete Beginner’s Guide: How To Install WordPress Easily

Free Tips Two: Ultimate Guide To Install And Setup WordPress Multisite

Pay Writer

Buy author a coffee

Pay Writer
1 comment 0 FacebookTwitterPinterestEmail
developershohel

previous post
Top 5 hosting to WordPress Staging Site with plugins in 2024
next post
How to use ftp or sftp server to transfer files in 2024

Related Posts

Top 10 Best WordPress Themes for Woocommerce in...

January 1, 2024

How to use ftp or sftp server to...

December 30, 2023

Ultimate Guide to install and setup WordPress multisite

December 23, 2023

Complete Beginner’s Guide: How to Install WordPress Easily

December 23, 2023

Creating a Responsive Divi Call to Action Module

December 18, 2023

7 Best AI Plugins for WordPress to Improve...

December 3, 2023

Discover the Top 6 Best WordPress Review Plugin...

December 3, 2023

Top 11 WordPress Mobile Plugin for Optimal Usage...

October 23, 2023

How to Send Automated Birthday and Anniversary Emails...

October 2, 2023

The Ultimate Guide to Self-Hosted WordPress Website

September 18, 2023

1 comment

Top 5 hosting to WordPress Staging Site with plugins in 2024 December 31, 2023 - 6:45 am

[…] Many users install WordPress on their Windows or Mac local server for testing. After making the necessary updates, they can easily transfer these changes from localhost to live server […]

Reply

Leave a Comment Cancel Reply

Save my name, email, and website in this browser for the next time I comment.

* By using this form you agree with the storage and handling of your data by this website.

Weather

New York
few clouds
69%
3.6km/h
20%
-1°C
1°
-4°
2°
Wed

Recent Posts

  • How to improve Website Performance & Speed Up website

    February 20, 2024
  • 10 Best WordPress Image Optimization Plugins in 2024

    February 20, 2024
  • Top 10 Best WordPress Themes for Woocommerce in 2024

    January 1, 2024
  • How to use ftp or sftp server to transfer files in 2024

    December 30, 2023
  • Upload WordPress From localhost to live server in 2024

    December 30, 2023

STAY TUNED WITH US

Sign up for our newsletter to receive our latest blogs.

Get Best Web Hosting and Services for your Business

Hostinger

Hostinger

Bluehost

Bluehost

WP Engine

Name.com

Name.com

Resources

  • Developer Shohel
  • Url Shortener
  • All in One Online tools
  • Secure Cloud Storage
  • Books
  • Fashion Product
  • IT Blogger

Company

  • Privacy Policy
  • Refund Policy
  • Terms and Conditions
  • Cookie Policy
  • Contact us
  • About us

Most read

How to improve Website Performance & Speed Up website
February 20, 2024
10 Best WordPress Image Optimization Plugins in 2024
February 20, 2024
Top 10 Best WordPress Themes for Woocommerce in 2024
January 1, 2024
Codepen Blog | Top blogs for WordPress and Web Development
Facebook-f Twitter Instagram Linkedin Behance Github

@2024 – All Right Reserved. Designed and Developed by Developer Shohel

Codepen Blog
  • Home
  • About us
  • Contact us
Codepen Blog
  • Home
  • About us
  • Contact us
@2021 - All Right Reserved. Designed and Developed by PenciDesign

Read alsox

How to use ftp or sftp server...

December 30, 2023

Top 10 Best WordPress Backup Plugins in...

August 16, 2023

Best Ways to add a WordPress Coupon...

August 21, 2023
Sign In

Keep me signed in until I sign out

Forgot your password?

Do not have an account ? Register here

Password Recovery

A new password will be emailed to you.

Have received a new password? Login here

Register New Account

Have an account? Login here

Shopping Cart

Close

No products in the cart.

Return To Shop
Close