Build

How to upload a static site to cPanel

Zip the built output, upload it to public_html through File Manager, extract it, and delete any default index file. The contents of the build folder go into public_html — not the folder itself.

Written by Anas Bin Masud 8 steps About 30 minutes 300 words

Before you start

  • cPanel access
  • Your built site as a ZIP

The steps

  1. Step 1: Build the site

    Producing a folder of static files — HTML, CSS, JS, images, sitemap and robots.txt.

  2. Step 2: Zip the contents, not the folder

    Select everything inside the build output and compress that. A ZIP containing one folder puts your site at /dist/ instead of the root.

  3. Step 3: Open File Manager

    cPanel → Files → File Manager → public_html.

  4. Step 4: Remove the default files

    Any placeholder index.html or default.htm the host installed.

  5. Step 5: Upload the ZIP

    The Upload button. Wait for it to reach 100% before navigating away.

  6. Step 6: Extract in place

    Right-click the ZIP → Extract, into public_html.

  7. Step 7: Delete the ZIP

    It is now duplicated storage and, if crawlable, an accidental download of your whole site.

  8. Step 8: Verify

    Load the home page, one deep page, /robots.txt and /sitemap-index.xml. All four must return 200.

The mistake that shows up as a broken site

Uploading a ZIP that contains the build folder itself. Everything extracts one level too deep, the home page 404s, and the fix is to move the contents up one level.

Check the file count

Note how many files the build produced and compare after extraction. Interrupted uploads are silent — the ZIP appears to arrive and extraction quietly omits the tail.

Getting clean URLs right

A static site built with directory-style output serves /about/ from /about/index.html, which Apache handles without configuration. If your build emits /about.html instead, the URL will be /about.html and your canonicals must match it exactly. Decide which you want before launch rather than after, because changing the convention later means a redirect for every page on the site.

The background behind this

Technical SEO, in the order the problems actually block you covers the reasoning in about 4 minutes — free, ungated, written from client work.

Who wrote this

Anas Bin Masud builds e-commerce sites and does technical SEO for businesses in the UK, Canada, Ireland and Pakistan. These procedures are the ones I run on client work, written down rather than invented — including the ones where the honest answer is that the fix is not available on your current hosting.

Related procedures

All 64 how-to guides →

Want this done rather than done yourself?

Send the brief and you get a reply within one business day — either questions, or a scoping call. If your project is not something I should take on, I will say so then.

Response
Replies within 1 business day
Hours
Mon–Fri, 09:00–18:00 PKT — overlaps 05:00–14:00 UK, 00:00–09:00 US Eastern
Booking
Booking projects from October 2026
WhatsApp — opens a chat with +92 346 5348466 in a new tab