How to publish an HTML site online

A finished index.html opens fine on your own computer — but for other people to see it, the files need to live on a server that's reachable from the internet. Here's how that works.

What "publishing a site" actually means

Publishing a site means copying your files (HTML, CSS, images) to a computer that's permanently connected to the internet and has a public address. That computer is called a server, or hosting.

As long as the files only sit on your own drive, only you can see them. Once uploaded to hosting, the files get an address other people can reach.

Hosting and domain are two different things

  • Hosting — where the site's files are physically stored.
  • Domain — a human-readable address (e.g. example.com) that points to the hosting's IP address.

A domain is bought separately from a domain registrar; hosting is bought separately from a hosting provider. Some services bundle both together.

Why HTTPS matters

HTTPS encrypts the connection between a visitor's browser and the server. Without it, browsers show a "Not secure" warning, and some features (like forms) may work worse or not at all.

Most modern hosts (including GitHub Pages) issue an HTTPS certificate automatically and for free.

Ways to upload files to a server

  • An FTP/SFTP client (e.g. FileZilla) — the classic way for regular hosting.
  • A hosting control panel — a browser-based file manager, no extra software needed.
  • A Git repository — files are uploaded with git push, and the host publishes the changes automatically.

GitHub Pages as one option

GitHub Pages is a free way to publish a static site directly from a Git repository, without a separate hosting provider. It works well for sites without a server backend, including simple HTML/CSS projects. It's one option among several — not the only one and not required.

Common reasons a site doesn't work after upload

  • The main file isn't named index.html — most hosts look for exactly that name for the homepage.
  • Wrong letter case in file paths (Style.css instead of style.css) — case matters on Linux-based servers.
  • Files were uploaded into a subfolder instead of the site's root folder.
  • The browser cache is showing an old version — try a hard refresh.
  • The domain's DNS records haven't propagated yet — this can take anywhere from minutes to a day after a change.

Related tools