Home / Posts

How To Upload A Local Wordpress Site To Cpanel Hosting

jkm96dev
April 26, 2025
Development Tools
How To Upload A Local Wordpress Site To Cpanel Hosting

So, you've created an impressive WordPress website on your local machine and are now ready to take it live. If you try uploading it like a regular static site, you’ll likely run into some issues. This tutorial will guide you through a step-by-step process to successfully upload your local WordPress site to your hosting provider using cPanel. I've done extensive research to ensure that all the essential steps are included.

Steps Overview

  1. Zip the WordPress site on your local machine
  2. Export the database from your local server
  3. Upload the zipped WordPress files to cPanel
  4. Import the database into your online MySQL database
  5. Extract the zipped WordPress files and edit the wp-config.php file
  6. Browse your live site

1. Zipping the WordPress Site

When working with WordPress locally, you need a local server like XAMPP or WampServer. In XAMPP, your WordPress files are typically located in the htdocs folder, and in WampServer, it's the www folder. Locate your project folder and compress it into a .zip file using your operating system’s built-in tool or any file archiver like WinRAR or 7-Zip.      

2. Exporting the Database

WordPress stores much of your site’s configuration and content in a MySQL database. Skipping this step will result in a broken site.

  • Open your browser and go to: http://localhost/phpmyadmin/        
  • Locate the database used for your WordPress site. If you're unsure about the database name, open the wp-config.php file in your WordPress folder and look for the line:

define('DB_NAME', 'your_database_name');

  • In phpMyAdmin, click the database name from the sidebar, then click the Export tab.
  • Choose the Quick export method and the SQL format, then click Go to download the file.

     Now you have your .zip file of the WordPress site and the .sql file for your database.

3. Upload the Zipped WordPress Site to cPanel

  • Log in to your cPanel account. You can use the login link sent to your email by your hosting provider after purchasing the hosting package.
  • In the cPanel dashboard, locate and click on File Manager. (Note: The appearance of your dashboard may vary depending on the theme your host uses.)
  • In File Manager, open the public_html folder — this is where your website’s files should be stored.
  • At the top of the File Manager interface, click on the Upload button.
  • A new tab or window will open, allowing you to upload files. You can either:
    • Click Select File and choose your zipped WordPress file from your computer, or
    • Drag and drop the file into the upload area.
  • The upload process may take a few minutes, depending on your internet speed and the size of your WordPress site.
  • Once the upload is complete, you’ll see a confirmation message or progress bar indicating that the file has been uploaded successfully.

4. Import the Database into cPanel

  • In cPanel, go to phpMyAdmin.
  • If you haven't created a database yet, use the MySQL Database Wizard to create one and assign a user to it.
  • In phpMyAdmin, select the newly created database, then click the Import tab.      
  • Choose the .sql file you exported earlier and click Go to import it. This will take several minutes to successfully import the files. So you have to give it time, or else it will not complete the importation process. After successfully importing the file, you will see the following:

After the import finishes:

  • Click on the wp_options table.
  • Look for the siteurl and home rows under the option_name column.
  • Replace the current value (http://localhost/your-folder-name) with your live domain. For example, if your domain name is http://uploadwordpress.com, then replace the current value with it.

Click Enter or Go to save the changes.

5. Extract the Zipped WordPress Site and Edit wp-config.php

  • In File Manager, right-click the uploaded .zip file and choose Extract.
  • After extraction, go into the new folder and select all files and folders.
  • Click Move, and set the path to /public_html/ to move everything to the root.
  • Now, locate and edit the wp-config.php file:
    • Update the Database Connection Details
      • Replace these lines with your new database credentials:

                  define('DB_NAME', 'your_online_database_name');

                  define('DB_USER', 'your_database_user');

                  define('DB_PASSWORD', 'your_database_password');

                  define('DB_HOST', 'localhost');

  • Update Authentication Keys and Salts
  • Click Save Changes at the top right of the editor.

6. Browse Your Site

You're all done! Visit your domain (e.g., http://uploadwordpress.mblog.co.ke/) to view your now live WordPress website. If everything was done correctly, the site should load as expected.

wordpress cpanel xampp wampserver

Login

Don’t have an account?

No comments yet.