Topic guide

Hosting HTML

Everything you need to turn a file on your computer into a page anyone can open, in the order you will need it.

An HTML file is already a web page. The only thing missing is a server that hands it to other people’s browsers. Static hosts do exactly that: you give them files, they give you a link. No database, no install, and for small sites, usually no bill.

What you need before you start

  • One main file called index.html. Hosts serve index.html automatically when someone visits the root of your link. A file called final-v3.html will only load if people type its full name.
  • Every file the page uses. Stylesheets, scripts, images and fonts that your HTML points to must be uploaded too, in the same folder layout.
  • Relative paths. images/logo.png works anywhere. C:\Users\you\Desktop\logo.png only works on your computer.

Not sure what your page depends on? Paste it into the free HTML path checker. It lists every file reference and flags the ones that will break.

Step 1: Organize the folder

A tidy folder avoids most problems. A typical small site looks like this:

my-site/
  index.html
  about.html
  css/style.css
  images/logo.png

Use lowercase file names with hyphens instead of spaces. Many servers treat Logo.PNG and logo.png as different files, so a link that worked on your laptop can fail online.

Step 2: Check it locally

Open index.html in your browser by double-clicking it. Click every link and look for missing images. Then open your browser’s developer tools (right-click, then Inspect) and look at the Console tab for red “not found” errors. If you want a quick visual check of a single file, paste it into the HTML previewer.

Step 3: Pick a host

For a single page or a small folder, any static host works. The main differences are how you upload and what the free plan includes.

Upload method Typical hosts Best for
Drag and drop in the browser Netlify Drop, Tiiny Host, Cloudflare Pages One-off pages, no account setup fuss
Git repository GitHub Pages, Netlify, Vercel, Cloudflare Pages Pages you will edit often
Command line Most of the above Developers who already use a terminal

Free plans change, so check the current limits on the host’s own pricing or documentation page before you commit. Our free hosting alternatives guide compares the trade-offs in plain language, and the file size checker tells you whether your folder fits a limit before you upload.

Step 4: Upload

  1. Single file: rename it index.html and upload or drop it.
  2. A folder: upload the folder itself, so index.html sits at the top level, not inside another folder.
  3. A zip: many drag-and-drop hosts accept a zip and unpack it. Make sure index.html is at the top of the zip, not inside my-site/my-site/.

After a few seconds the host gives you a link, usually a subdomain of the host such as your-name.example-host.app.

Open the link in a private or incognito window so you see what a visitor sees. Check:

  • The page loads without a sign-in
  • Images, fonts and styles all appear
  • Links between pages work
  • It looks right on your phone
  • The tab shows a sensible title

If styles are missing, a path is wrong. A leading slash (/css/style.css) is a common culprit on hosts that put your site in a subfolder.

Step 6: Add a custom domain (optional)

A custom domain such as yourname.com looks more trustworthy than a long host subdomain. The steps are similar everywhere:

  1. Buy the domain from any registrar.
  2. Add it in your host’s settings.
  3. Copy the DNS records the host shows you into your registrar’s DNS settings.
  4. Wait for the change to spread, which can take from a few minutes to a day.
  5. Turn on HTTPS if the host does not do it automatically.

Updating the page later

To change the page, edit the file and upload it again. Drag-and-drop hosts usually replace the old version; Git-based hosts update when you push a change. Keep a copy of the folder on your computer, because that is your real source.

Common problems and quick fixes

Problem Likely cause Fix
404 at the root link No index.html at the top level Rename the main file or move it up a folder
Page loads with no styling Wrong stylesheet path Use a relative path like css/style.css
Images missing Files not uploaded, or name case differs Upload them and match names exactly
Works on desktop, tiny on phone No viewport tag Add <meta name="viewport" content="width=device-width, initial-scale=1">

If your page came from an AI assistant, read AI-made pages next. If you need to edit the HTML itself, start with HTML and CSS basics.