You have spent hours coding your website on your laptop (Localhost). It looks perfect. Now, the big question is: How do you show it to the world?
If you are a student or a beginner in web development, moving a website from your computer to a live server can feel a bit scary. But don't worry! You don't need to be a server expert to do this.
In this guide, we will show you exactly how to upload your HTML or PHP website using cPanel. It is the most popular and easiest way to manage web hosting in Sri Lanka.
Letβs get your site online in less than 5 minutes!
Step 1: Prepare Your Website Files
Before you log in to your hosting account, you need to get your files ready on your computer.
- Check your main file: Make sure your
homepage file is named exactly
index.htmlorindex.php(all lowercase). - Zip your files correctly:
Open your project folder.
Select all the files inside (CSS, Images, JS, and HTML/PHP files).
Right-click and Compress them into a
.ZIPfile.Important: Do not use .RAR format. cPanel handles .ZIP files much better.
Step 2: Log in to cPanel
Open your web browser and go to your cPanel login URL (usually sent to your email when you bought the hosting).
- Username: (Enter your username)
- Password: (Enter your password)
Step 3: Open the File Manager
Once you are inside the cPanel dashboard, look for the Files section. Click on the icon labeled File Manager.
Think of this as the My Computer or File Explorer for your web server.
Step 4: Locate the public_html Folder
This is the most important step!
- On the left-hand side menu, look for a folder named public_html.
- Click on it to open it.
Note: Anything you put inside the
public_html folder will be visible to the public. If you see a folder named
cgi-bin inside, do not delete it; it is a system folder.
Step 5: Upload Your Zip File
- Look at the top menu bar in the File Manager and click the Upload button.
- A new tab will open. Click Select File and choose
the
.zipfile you created in Step 1. - Wait for the progress bar to turn Green (100%).
Tip: Do not close the tab until the bar turns green, even if it says 100%.
Step 6: Extract Your Files
- Go back to the File Manager tab. If you don't see your file yet, click the Reload button in the top menu
- Right-click on your uploaded
.zipfile and select Extract. - A pop-up will appear asking where to extract. Just click Extract Files.
- Once done, you will see your
index.htmland other folders appear..
Cleanup: You can now delete the
.zip file from the server to save space.
Step 7: Test Your Website
Now for the exciting part! Open a new tab in your browser and type your
domain name (www.your-website.com)
If you see your website design, π Congratulations! You have successfully hosted your first website.
Get Your Fast and Secure Hosting Now
Youβve built your website, and now you know how to upload it. But a great website needs a fast and reliable home. Don't struggle with slow servers or complicated payments. At Host Asia, we make hosting simple for Sri Lankans
Frequently Asked Questions
Everything you need to know about
I uploaded my files, but my website still (says Index of /). How do I fix this?
Should I upload my files to the www folder or public_html?
My changes are not showing after I update my HTML file. Why?
My website says Not Secure in the address bar
Can I edit my HTML code directly in cPanel without re-uploading?
- Right-click on your file in File Manager.
- Select Edit or HTML Editor
- Make your changes and click Save Changes at the top right.














