New: Complete Beginner's Guide to Coding is now available in Premium
Updated: Indian Govt Exam roadmaps now include salary breakdowns & timelines
Tip: Use the Career Hub to explore all career paths in one place
Deployment

Website Live on cPanel

Deploy any website to a live server using cPanel — step by step

1-3 days Beginner Essential Skill 10 Steps
Website Live on cPanel
Complete Guide
About This Guide

You've built your website locally — now it's time to show it to the world. Deploying to cPanel is the most common way to go live in India, used by millions of websites on shared hosting. This guide covers the exact 10 steps to move any website (HTML, PHP, or WordPress) from your computer to a live server. No prior server experience needed — just follow each step in order.

Who Is This For?
  • Developers deploying their first live website
  • Freelancers delivering client websites
  • Students completing web development projects
  • Anyone moving from localhost to production
What You Will Learn
Upload files to cPanel File Manager or via FTP
Create and import a MySQL database
Configure SSL and force HTTPS
Test and verify your live website
Progress: 0 / 10 steps completed
1
Prepare Your Website Files Step 1

Make sure your website is complete and tested locally. Organize files: index.html (or index.php) must be in the root folder. Remove any test data, debug code, and unused files. Zip your entire project folder.

VS Code 7-Zip WinRAR
2
Login to cPanel Step 2

Access cPanel at yourdomain.com/cpanel or the URL your host provided. Login with your hosting credentials. You'll see the cPanel dashboard with all management tools.

cPanel Browser Hosting email
3
Create MySQL Database Step 3

Go to MySQL Databases in cPanel. Create a new database (e.g., mysite_db). Create a database user with a strong password. Add the user to the database with ALL PRIVILEGES. Note down: DB name, username, password.

cPanel MySQL Databases phpMyAdmin
4
Upload Files via File Manager Step 4

Open File Manager in cPanel. Navigate to public_html (this is your website root). Upload your zipped project file. Right-click and Extract. Make sure index.html or index.php is directly in public_html, not in a subfolder.

cPanel File Manager FileZilla FTP
5
Configure Database Connection Step 5

Update your database connection file (config.php or wp-config.php) with the live server credentials: DB_HOST is usually localhost, DB_NAME, DB_USER, DB_PASSWORD from Step 3. For WordPress, edit wp-config.php directly in File Manager.

cPanel File Manager wp-config.php config.php
6
Import Database Step 6

Open phpMyAdmin in cPanel. Select your database. Click Import tab. Upload your .sql file (exported from local phpMyAdmin). Click Go. Your database tables and data are now on the live server.

phpMyAdmin MySQL dump file
7
Update Site URLs Step 7

For WordPress: Go to phpMyAdmin → wp_options table. Update siteurl and home values to your live domain (https://yourdomain.com). Or use WP CLI: wp search-replace 'localhost/mysite' 'yourdomain.com'

phpMyAdmin WP CLI Better Search Replace plugin
8
Enable SSL (HTTPS) Step 8

In cPanel, go to SSL/TLS → Let's Encrypt SSL. Install a free SSL certificate for your domain. Then force HTTPS: add redirect rules in .htaccess or use cPanel's Force HTTPS option. Check your site loads on https://.

cPanel SSL Let's Encrypt .htaccess
9
Set Up Email & DNS Step 9

Create professional email accounts in cPanel Email Accounts. Verify your domain's DNS records are pointing correctly (A record, MX records). Use cPanel Zone Editor to manage DNS if needed.

cPanel Email DNS Zone Editor MXToolbox
10
Test Everything Step 10

Test all pages, forms, and features on the live site. Check on mobile and different browsers. Submit your sitemap to Google Search Console. Set up Google Analytics. Configure automated backups in cPanel Backup Wizard.

Google Search Console GTmetrix BrowserStack

Deep Dive Topics

FTP File Upload with FileZilla

FTP (File Transfer Protocol) lets you transfer files between your computer and your hosting server. FileZilla is the most popular free FTP client. Use it for large uploads — cPanel File Manager can time out on big files.

FileZilla setup:

  1. Download FileZilla from filezilla-project.org
  2. Open FileZilla → File → Site Manager → New Site
  3. Enter: Host = yourdomain.com, Port = 21, Protocol = FTP
  4. Enter your cPanel Username and Password
  5. Click Connect — you'll see your server files on the right panel
  6. Navigate to public_html on the right, drag files from left panel

FTP vs File Manager comparison:

FeatureFTP (FileZilla)cPanel File Manager
Large file uploads✅ No timeout❌ Can timeout
Batch upload✅ Drag & drop folders⚠️ One zip at a time
Speed✅ Faster⚠️ Slower
Ease of use⚠️ Needs setup✅ Browser-based
Edit files❌ Need external editor✅ Built-in editor

Common FTP errors & fixes:

Error: Connection timed out Fix: Check firewall, try passive mode (Transfer → Transfer Type → Passive) Error: 530 Login authentication failed Fix: Wrong username/password — use cPanel FTP account credentials Error: 550 Permission denied Fix: Wrong folder permissions — set to 755 for folders, 644 for files

MySQL Database Setup in cPanel

Every dynamic website (WordPress, PHP apps) needs a database. cPanel makes it easy to create MySQL databases and manage them with phpMyAdmin.

Creating a database in cPanel:

  1. cPanel → Databases → MySQL Databases
  2. Enter database name (e.g., mysite_db) → Create Database
  3. Scroll down → Create a new user → enter username + strong password
  4. Add user to database → select ALL PRIVILEGES → Make Changes
  5. Note: cPanel prefixes your username to DB name (e.g., cpuser_mysite_db)

Importing .sql file via phpMyAdmin:

  1. cPanel → phpMyAdmin → select your database (left panel)
  2. Click Import tab → Choose File → select your .sql file
  3. Set Character set to utf8mb4
  4. Click Go — wait for import to complete

Common import errors & fixes:

ErrorCauseFix
Max file size exceededphpMyAdmin upload limitUse BigDump or split SQL file
Charset mismatchutf8 vs utf8mb4Add SET NAMES utf8mb4 at top of .sql
Table already existsDuplicate importDrop tables first or use IF NOT EXISTS
Access deniedWrong DB user permissionsRe-assign ALL PRIVILEGES in cPanel

Export from localhost (phpMyAdmin):

phpMyAdmin → select database → Export tab → Format: SQL → Check "Add DROP TABLE" (prevents duplicate errors on re-import) → Go → saves as database_name.sql

WordPress Migration: Local → Live

Moving WordPress from localhost to a live server requires updating file paths and database URLs. Follow these steps exactly to avoid broken links and white screens.

Step-by-step migration:

  1. Export DB from local: phpMyAdmin → your WP database → Export → SQL → Go
  2. Upload files: FileZilla → upload entire WordPress folder to public_html
  3. Create live DB: cPanel → MySQL Databases → create DB + user
  4. Import DB: Live phpMyAdmin → Import → upload your .sql file
  5. Edit wp-config.php: Update DB_NAME, DB_USER, DB_PASSWORD, DB_HOST
  6. Fix URLs: phpMyAdmin → wp_options → update siteurl and home
  7. Test: Visit your live domain — should load WordPress

wp-config.php changes:

// Change these values to your live server credentials define( 'DB_NAME', 'cpuser_livedb' ); define( 'DB_USER', 'cpuser_dbuser' ); define( 'DB_PASSWORD', 'YourStrongPassword' ); define( 'DB_HOST', 'localhost' );

Fix URLs in phpMyAdmin:

-- Run in phpMyAdmin SQL tab: UPDATE wp_options SET option_value = 'https://yourdomain.com' WHERE option_name IN ('siteurl', 'home');

Better Search Replace plugin: Install this plugin on your live site to find and replace all instances of localhost/mysite with yourdomain.com in the database — fixes broken image URLs and internal links automatically.

.htaccess — Apache Configuration

.htaccess is a configuration file for Apache web servers. It controls URL redirects, security rules, caching, and more. It lives in your public_html root directory. Changes take effect immediately — no server restart needed.

Force HTTPS redirect:

RewriteEngine On RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

www to non-www redirect:

RewriteEngine On RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC] RewriteRule ^ https://%1%{REQUEST_URI} [R=301,L]

Custom 404 error page:

ErrorDocument 404 /404.php ErrorDocument 500 /500.php

Block bad bots:

RewriteEngine On RewriteCond %{HTTP_USER_AGENT} (AhrefsBot|MJ12bot|DotBot) [NC] RewriteRule .* - [F,L]

WordPress default .htaccess:

# BEGIN WordPress RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] # END WordPress

Important: Always backup your .htaccess before editing. A syntax error can take your entire site offline with a 500 Internal Server Error. Use cPanel File Manager to edit it — it's hidden by default (enable "Show Hidden Files").

Common cPanel Deployment Errors & Fixes

1. 500 Internal Server Error
Causes: Syntax error in .htaccess, wrong PHP version, bad file permissions. Fix: Check cPanel Error Logs (Logs → Error Log). Rename .htaccess to .htaccess_bak to test. Set folder permissions to 755, file permissions to 644.
2. WordPress White Screen of Death (WSOD)
Causes: PHP memory limit, plugin conflict, theme error. Fix: Add define('WP_DEBUG', true); to wp-config.php to see the error. Deactivate all plugins via phpMyAdmin (set option_value to 'a:0:{}' in wp_options where option_name='active_plugins'). Increase memory: define('WP_MEMORY_LIMIT', '256M');
3. Error Establishing a Database Connection
Causes: Wrong DB credentials in wp-config.php, database server down. Fix: Double-check DB_NAME, DB_USER, DB_PASSWORD in wp-config.php. Remember cPanel prefixes your username (e.g., cpuser_dbname). Test connection in phpMyAdmin.
4. Mixed Content Warning (HTTPS)
Causes: Some resources (images, scripts) still loading over HTTP after SSL install. Fix: Install "Really Simple SSL" plugin. Or use Better Search Replace to change all http://yourdomain.com to https://yourdomain.com in the database.
5. File Permission Errors (403 Forbidden)
Causes: Wrong file/folder permissions. Fix: Set folders to 755, files to 644. In cPanel File Manager: select all → Permissions → 755 for folders. For wp-config.php use 640 for extra security.
6. Images Not Loading After Migration
Causes: Hardcoded localhost URLs in database. Fix: Use Better Search Replace plugin to replace http://localhost/mysite with https://yourdomain.com across all database tables.
7. Permalinks Not Working (404 on posts)
Causes: .htaccess not updated, mod_rewrite not enabled. Fix: WordPress Admin → Settings → Permalinks → click Save Changes (regenerates .htaccess). If still broken, check that mod_rewrite is enabled in cPanel.
8. PHP Version Mismatch
Causes: Plugin/theme requires PHP 8.x but server runs PHP 7.x. Fix: cPanel → Software → Select PHP Version → change to PHP 8.1 or 8.2. Always test on staging first — some old plugins break on newer PHP.
Tools You Need
cPanel
Hosting control panel
Paid
FileZilla
FTP file upload
Free
phpMyAdmin
Database management
Free
Let's Encrypt
Free SSL certificate
Free
Cloudflare
CDN + DNS
Free
Google Search Console
SEO monitoring
Free
Salary Guide
Freelance Deployment ₹1K-5K/site
Web Developer ₹3-15 LPA
Server Admin ₹5-20 LPA
Pro Tips
Always backup your local database before importing to live server
Use FileZilla for large file uploads — File Manager can timeout
Test on a staging subdomain before going live on the main domain
Keep wp-config.php permissions at 640 for security