Rank #1 on Google Maps
India English
Kenya English
United Kingdom English
South Africa English
Nigeria English
United States English
United States Español
Indonesia English
Bangladesh English
Egypt العربية
Tanzania English
Ethiopia English
Uganda English
Congo - Kinshasa English
Ghana English
Côte d’Ivoire English
Zambia English
Cameroon English
Rwanda English
Germany Deutsch
France Français
Spain Català
Spain Español
Italy Italiano
Russia Русский
Japan English
Brazil Português
Brazil Português
Mexico Español
Philippines English
Pakistan English
Turkey Türkçe
Vietnam English
Thailand English
South Korea English
Australia English
China 中文
Somalia English
Canada English
Canada Français
Netherlands Nederlands

How to Host HTML Website in cPanel: A Step-by-Step Guide

Buy domains, business emails, hosting, VPS and more: Get Started

Cheapest Domains in Kenya

Get your .Co.ke domain now for just KSh 999 (Back to 1200 in 7 days)

.CO.KE for KSh 999 | .COM for KSh 999

Getting your HTML website live is faster and very easy. If you have your files ready and a hosting account set up, you can have your site online in under ten minutes.

If you are confused by that statement on file and hosting, let me break it down. This is what you need before starting the process:

  • A working HTML project on your computer with index.html as your main file
  • All necessary folders, including your css, js, images, and assets folders, should be part of the project
  • A domain name and cPanel hosting if you don’t have these yet, you can get both from us at Truehost. 

We offer affordable cPanel hosting plans and domain registration. Check out our page.

Here’s what you’ll learn:

  • How to prepare and host html website in cPanel
  • How to upload and extract files in cPanel’s File Manager
  • How to move files so your site loads at yourdomain.com (not a subfolder)
  • Common mistakes to avoid and how to test your site after going live

Let’s get into it.

Step-by-Step Guide to Host Your HTML Website in cPanel

Step 1: Prepare Your Files

Before you touch cPanel, make sure your project folder is properly organised on your computer.

Your folder should look something like this:

my-website/
├── index.html
├── css/
│   └── style.css
├── js/
│   └── main.js
└── images/
    └── logo.png

Now, zip the entire folder not just index.html.

Why zip? Uploading a zip file and extracting it in cPanel is much faster and more reliable than uploading files one by one. If you have 30 files in your project and upload them individually, one failed upload can break your site silently.

On Windows, right-click the folder → Send to → Compressed (zipped) folder. On Mac, right-click → Compress.

You should end up with something like my-website.zip. That’s the file you’ll upload.

Step 2: Log In to cPanel

Go to your hosting account’s cPanel. This is usually accessible at:

yourdomain.com/cpanel

Or log in through your Truehost client area and find cPanel from there.

host html website in cPanel - Client Area

Once you’re inside the cPanel dashboard, scroll down to the Files section and click on File Manager.

host html website in cPanel

Step 3: Go to the public_html Folder

Inside File Manager, look at the left sidebar. You’ll see a directory tree. Click on public_html.

host html website in cPanel - public_html

This is the most important folder in your entire hosting account. It’s the web root. 

This means that anything placed here becomes accessible to the public when someone visits your domain.

Files outside public_html are private and won’t be served to visitors. So everything your site needs must live inside this folder.

Step 4: Upload the Zip File

While you’re inside public_html, click the Upload button in the top toolbar.

File Manager - Upload (host html website in cPanel)

A new browser tab will open with a simple upload interface. Either:

host html website in cPanel
  • Drag and drop your zip file into the upload area, or
  • Click Select File and browse to your zip on your computer

Wait until the upload reaches 100% before doing anything else. 

A partial upload will cause problems during extraction broken files, missing styles, images that won’t load.

host html website in cPanel

Once you see a green success bar or 100% progress, click Go Back to /home/yourusername/public_html to return to the File Manager.

Step 5: Extract the Zip File

Back in public_html, you should now see your uploaded zip file listed.

Right-click on it and select Extract.

A dialog box will pop up asking where to extract the files. Make sure the destination path shows /public_html/, then click Extract File(s).

cPanel will unzip all your project files right there in public_html.

Step 6: Move Files to the Root 

Here’s where many beginners make a critical mistake, so pay close attention.

After extraction, cPanel typically creates a new subfolder with the same name as your zip file. So instead of your files sitting directly in public_html, they end up inside public_html/my-website/.

That’s a problem. If you leave it like that, your website will only load at yourdomain.com/my-website/ not yourdomain.com.

Here’s how to fix it:

  1. Open the newly created folder (e.g., my-website) inside public_html
  2. Select all files and folders inside it and use the checkbox at the top to select all
  3. Right-click and choose Move
  4. In the destination field, change the path to just /public_html/, and delete any folder name after the slash
  5. Click Move Files

Your index.html, css, js, and all other files should now sit directly inside public_html, not inside a subfolder.

Related: How to Host a Static Website on GitHub Pages

Step 7: Clean Up

Now do a quick tidy-up:

  • Delete the original zip file: right-click it and select Delete
  • Delete the now-empty folder: if the extraction folder (my-website/) is still there but empty, delete it too

This keeps your public_html clean and avoids confusion later when you’re making updates.

Your public_html should now look something like this:

public_html/
├── index.html
├── css/
├── js/
└── images/

Clean. Organised. Ready to serve.

Step 8: Test Your Website

Open a new browser tab and type in your domain name. Hit Enter.

Your website should load directly.

If it doesn’t appear right away, don’t panic. Try these quick checks:

  • Clear your browser cache: older cached data can prevent the new site from showing
  • Try incognito/private mode: this bypasses the cache entirely
  • Wait 1–2 minutes: DNS can sometimes take a moment to reflect changes, especially if your domain is newly connected

If your CSS or images aren’t loading, double-check that your CSS and JS folders were moved correctly and sit directly inside public_html at the same level as index.html.

Don’t know how to create a html website? Check our guide.

Common Mistakes to Avoid

Even experienced developers slip up on these. Keep them in mind:

  • Don’t delete your CSS and JS folders. Your index.html is just the skeleton. Without the CSS, your site will look like a plain, unstyled wall of text. Without JS, interactive features will stop working entirely.
  • Don’t upload files one by one. Always zip the entire project and upload as one file. It’s faster, safer, and ensures nothing gets missed.
  • Don’t leave index.html inside a subfolder. The goal is simple: index.html must live directly inside public_html. If it’s sitting inside another folder, your domain will throw a ‘403 Forbidden’ or ‘Index of /’ error instead of loading your site.
  • Don’t forget to wait for 100% upload completion. Moving away before the upload finishes is one of the most common causes of broken file extraction.

Read also: Moving a wordpress website from a subdirectory to the root (/public_html) directory

Get Started with Truehost cPanel Hosting

Get your domain name and cPanel hosting plan with us.

We offer fast, reliable cPanel hosting with local payment support including M-PESA, Airtel Money, and bank transfer. You can get your domain and hosting set up in minutes.

HTML Website in cPanel FAQs

How to edit HTML in cPanel?

You don’t need to re-upload your entire project for small changes. Inside cPanel’s File Manager, go to public_html and find the file you want to edit. Right-click it and choose HTML Edit to open the visual WYSIWYG editor, or select Edit to work directly with the raw code. Make your changes and click Save the update goes live immediately.

For bigger changes, it’s safer to edit on your local computer first, then re-upload and overwrite the existing file.

How to secure a website on cPanel?

Is cPanel hosting good for beginners?

What are the disadvantages of cPanel?

Where to host a simple HTML page?

Where to put HTML code for website?

Cheapest Domains in Kenya

Get your .Co.ke domain now for just KSh 999 (Back to 1200 in 7 days)

.CO.KE for KSh 999 | .COM for KSh 999

Winny Mutua
Author

Winny Mutua

SEO Specialist Nairobi, Kenya

Winfred Mutua is a results-driven SEO Specialist with over 5 years of experience in technical SEO, keyword strategy, and organic growth. She helps tech and web hosting brands improve visibility, rankings, and conversions through in-depth keyword research, content optimization, and technical SEO.
Proficient in SEMrush, Ahrefs, Screaming Frog, Google Analytics, and Search Console.
What She Excels At

- Technical SEO audits & site optimization
- Keyword research and search intent analysis
- SEO content strategy & long-form content creation
- On-page optimization and WordPress management
- Performance tracking and data-driven growth

Currently an SEO Content Specialist at Truehost Cloud, driving organic growth for a tech/web hosting brand. She has also built and scaled two niche WordPress websites from scratch, achieving monetization through organic traffic.
Fully remote-ready and open to new SEO opportunities.

View All Posts