How to Host a Website in cPanel

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

  1. Log in to cPanel using the URL:
    https://yourdomain.com/cpanel
    
  2. 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:
    1. Go to Addon Domains (under the Domains section).
    2. Enter the Domain Name (e.g., example.com).
    3. Click Add Domain.

Step 3: Upload Website Files

Method 1: Upload via File Manager (For Small Websites)

  1. In cPanel, go to File Manager (under Files).
  2. Open the public_html folder (this is your website's root directory).
  3. Click Upload and select your website files (index.html, index.php, etc.).
  4. If you have a .zip file, extract it inside public_html.

Method 2: Upload via FTP (For Large Websites)

  1. Use an FTP client like FileZilla.
  2. Enter the following details:
    • Host: ftp.yourdomain.com
    • Username: Your cPanel username
    • Password: Your cPanel password
    • Port: 21
  3. 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:

  1. In cPanel, go to MySQL® Databases.
  2. Create a new database (e.g., yourdb).
  3. Scroll down to MySQL Users, create a new user, and assign it to the database.
  4. Open phpMyAdmin, select the database, and click Import to upload your .sql file.

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 (localhost for 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)

  1. Go to SSL/TLS Status in cPanel.
  2. Click Run AutoSSL to enable Let's Encrypt.
  3. 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)

  1. In cPanel, go to Softaculous Apps Installer.
  2. Click WordPress, then Install.
  3. Fill in site details and click Install.

???? Congratulations! Your Website is Now Live! ????

Let me know if you need help with anything! ????

Prefer direct help?

Talk to Hamara Hosting if you want help instead of handling this alone.

Use direct assistance for hosting, business email, migration, reseller setup, or plan recommendations.

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How to host a Wordpress website on cpanel

Login to your Cpanel ,scroll down to the Database section , and select MySQL Database Wizard....

Using the Zone Editor in cPanel

DNS converts domain names into computer-readable IP addresses. DNS zone files configure domain...

How to Upload a File With cPanel File Manager

Overview cPanel organizes all the files in your account into folders. Use the File Manager...

SQL Services

  Please click here for more detailed information about cPanel SQL Services.   SQL Services...

Create an Email Account in cPanel

Overview This interface is part of the Email Accounts interface in cPanel (cPanel >> Home...

Powered by WHMCompleteSolution