How to publish an HTML website for free with your own domain

A static hosting service can publish a folder of HTML, CSS and images. Decide where the original files will live and who owns the hosting account. Test the free project address before changing the domain your visitors already use.

By . Published on .

Prepare your website folder · Choose a host that fits the project · Use hosting you already pay for

Prepare your website folder

Put index.html at the top level. Store images in a subfolder and use relative URLs such as img/workshop.jpg. The server may distinguish between upper- and lower-case letters even if your computer does not. Open a copy from a different folder and check every image. Remove passwords, secret API keys, database exports and customer files.

Choose a host that fits the project

Cloudflare Pages Direct Upload. Use it when you already have the files you want to serve. In the Workers & Pages dashboard, create a Direct Upload Pages project, upload the files and open the assigned address. If you expect to switch to a Git-driven build later, check the restrictions on switching deployment modes first.

Netlify. Use the manual deployment flow with the final folder. For a project with a build step, upload the generated output. Check that the deployed site is publicly accessible. Before committing a business to free hosting, check the current allowance, usage policy and account terms.

GitHub Pages. A good fit for documentation, personal sites and eligible projects. Enable Pages in the repository settings, choose a publishing source and wait for the deployment. A project site commonly includes the repository name in its address, which affects links starting with a slash. Read the platform's commercial-use restrictions before choosing it.

Use hosting you already pay for

Check the public document root for the domain with your provider. Back up the running website and test the new files separately. Make sure someone can deploy and restore the previous version. On shared hosting, preserve mail settings and folders used by other services.

Connect the domain and verify HTTPS

Add the custom domain to the project before editing DNS. Copy the settings the host gives for the root domain and www. Keep the mail records and record the previous values. Once the certificate is active, test the root, www, an internal page and a missing page. Pick one canonical address.

Publish a second version safely

Keep a copy of the approved version and deploy the full output folder so new HTML does not refer to missing old assets. Open the preview in a private window and follow an old link. Add redirects at the host if a renamed URL already had readers or links pointing to it.

Troubleshoot a missing homepage, image or enquiry

A missing homepage often means an extra parent folder or an incorrectly capitalised Index.html. A broken picture often points to the wrong folder, extension or letter case. If a form displays but the message never arrives, check its delivery service. Hosting a static file alone does not send enquiries or take payments.

Sources and documentation

Related reading

Wellinton Oliveira

Written by

CEO of Lyntev

Technology with context, original analysis and sources you can consult.