How to Host a Website in cPanel – Step-by-Step Guide
Hosting a website in cPanel involves uploading your website files, setting up a domain, and configuring essential settings. Follow these steps:
Step 1: Get cPanel Access
- Log in to cPanel using the URL:
https://yourdomain.com/cpanel - Enter your username and password (provided by your hosting provider).
Step 2: Add Your Domain (If Needed)
- If you purchased hosting and domain from the same provider, your domain is already set.
- If you are hosting an additional domain, add it manually:
- Go to Addon Domains (under the Domains section).
- Enter the Domain Name (e.g.,
example.com). - Click Add Domain.
Step 3: Upload Website Files
Method 1: Upload via File Manager (For Small Websites)
- In cPanel, go to File Manager (under Files).
- Open the public_html folder (this is your website's root directory).
- Click Upload and select your website files (
index.html,index.php, etc.). - If you have a
.zipfile, extract it insidepublic_html.
Method 2: Upload via FTP (For Large Websites)
- Use an FTP client like FileZilla.
- Enter the following details:
- Host:
ftp.yourdomain.com - Username: Your cPanel username
- Password: Your cPanel password
- Port: 21
- Host:
- Click Connect and upload files to public_html.
Step 4: Create and Import a Database (For Dynamic Websites)
If your website uses a database (like WordPress, PHP scripts, etc.), follow these steps:
- In cPanel, go to MySQL® Databases.
- Create a new database (e.g.,
yourdb). - Scroll down to MySQL Users, create a new user, and assign it to the database.
- Open phpMyAdmin, select the database, and click Import to upload your
.sqlfile.
Step 5: Configure Database Connection (For PHP Websites)
If your website has a database, update the configuration file (usually config.php or .env file) with:
- Database name
- Username
- Password
- Host (
localhostfor cPanel)
Step 6: Set Up DNS (If Needed)
If your domain is not yet linked to your hosting, update the Nameservers:
- Go to your domain registrar (e.g., GoDaddy, Namecheap).
- Update the nameservers to those provided by your hosting (e.g.,
ns1.yourhost.com,ns2.yourhost.com). - It may take 24-48 hours to propagate.
Step 7: Install SSL (Secure Your Website)
- Go to SSL/TLS Status in cPanel.
- Click Run AutoSSL to enable Let's Encrypt.
- Ensure your site is accessible via HTTPS.
Step 8: Test Your Website
- Open your browser and visit
https://yourdomain.com. - If it doesn’t load, clear the cache or wait for DNS propagation.
Optional: Install WordPress (For Blogs & CMS Websites)
- In cPanel, go to Softaculous Apps Installer.
- Click WordPress, then Install.
- Fill in site details and click Install.
???? Congratulations! Your Website is Now Live! ????
Let me know if you need help with anything! ????
