Website Live on cPanel
Deploy any website to a live server using cPanel — step by step
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.
- Developers deploying their first live website
- Freelancers delivering client websites
- Students completing web development projects
- Anyone moving from localhost to production
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.
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.
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.
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.
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.
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.
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'
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://.
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.
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.
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:
- Download FileZilla from filezilla-project.org
- Open FileZilla → File → Site Manager → New Site
- Enter: Host = yourdomain.com, Port = 21, Protocol = FTP
- Enter your cPanel Username and Password
- Click Connect — you'll see your server files on the right panel
- Navigate to
public_htmlon the right, drag files from left panel
FTP vs File Manager comparison:
| Feature | FTP (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 filesMySQL 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:
- cPanel → Databases → MySQL Databases
- Enter database name (e.g.,
mysite_db) → Create Database - Scroll down → Create a new user → enter username + strong password
- Add user to database → select ALL PRIVILEGES → Make Changes
- Note: cPanel prefixes your username to DB name (e.g.,
cpuser_mysite_db)
Importing .sql file via phpMyAdmin:
- cPanel → phpMyAdmin → select your database (left panel)
- Click Import tab → Choose File → select your .sql file
- Set Character set to
utf8mb4 - Click Go — wait for import to complete
Common import errors & fixes:
| Error | Cause | Fix |
|---|---|---|
| Max file size exceeded | phpMyAdmin upload limit | Use BigDump or split SQL file |
| Charset mismatch | utf8 vs utf8mb4 | Add SET NAMES utf8mb4 at top of .sql |
| Table already exists | Duplicate import | Drop tables first or use IF NOT EXISTS |
| Access denied | Wrong DB user permissions | Re-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.sqlWordPress 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:
- Export DB from local: phpMyAdmin → your WP database → Export → SQL → Go
- Upload files: FileZilla → upload entire WordPress folder to
public_html - Create live DB: cPanel → MySQL Databases → create DB + user
- Import DB: Live phpMyAdmin → Import → upload your .sql file
- Edit wp-config.php: Update DB_NAME, DB_USER, DB_PASSWORD, DB_HOST
- Fix URLs: phpMyAdmin → wp_options → update siteurl and home
- 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.phpBlock 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 WordPressImportant: 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
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');cpuser_dbname). Test connection in phpMyAdmin.http://yourdomain.com to https://yourdomain.com in the database.http://localhost/mysite with https://yourdomain.com across all database tables.