Automate now

How to Build a Website with AI and Host It Free on Cloudflare Workers

You no longer need a website builder or a CMS to put a small website online. An AI assistant such as Claude, ChatGPT or Gemini can write the whole site as plain HTML, CSS and JavaScript files from a description of your business. Cloudflare Workers can then host those files for free, with HTTPS and your own domain.

Google PageSpeed Insights report for 4ptransform.org on mobile, 30 November 2026: 100 Performance, 100 Accessibility, 100 Best Practices, 100 SEO, Agentic Browsing 3/3
4ptransform.org, a site built this way and hosted free on Cloudflare Workers, scores 100 in every Google PageSpeed Insights category on mobile, plus 3/3 for Agentic Browsing (see the report, 30 November 2026).

This guide walks through the full process: what to ask the AI for, what to check before you publish, how to deploy to Cloudflare Workers, and how to handle updates, forms and a custom domain. It suits brochure sites, landing pages, portfolios, event pages and small documentation sites. It does not suit online stores, member areas or sites edited daily by non-technical staff; for those, see our guide to WordPress alternatives.

Why AI-written HTML on Cloudflare Workers

AI website builders (Wix, Squarespace, Framer, Hostinger and others) now generate a first draft for you, but the site lives on their platform and in their editor. Most have a free tier, but a custom domain and the more useful features usually need a paid plan. That is a good trade if you want to keep editing visually.

Asking an AI assistant for the HTML itself gives you something different: a folder of standard files that you own. Any web host can serve them, any developer can edit them, and there is no CMS, plugin or server software to keep patched. Any JavaScript in them still deserves a review now and then.

Cloudflare Workers is the best home we have found for that folder. We host our own sites on it, and Cloudflare’s documentation backs up why:

  • Free at any traffic level: requests to static files are free and unlimited, and storing them costs nothing. A busy month does not turn into a bill.
  • Close to every visitor: Cloudflare caches your files automatically across its global network, so visitors usually get them from a nearby location instead of from one server far away.
  • Room for a real site: the free plan allows up to 20,000 files per site (100,000 on the paid plan), each up to 25 MiB.
  • HTTPS and your own domain included: every site gets a workers.dev address with HTTPS, and you can add your own domain without buying a certificate.
  • Room to grow: when you need a contact form, an API or scheduled jobs, you add a small Worker script to the same project instead of moving to another host.
  • Cloudflare’s recommended choice: “If you are starting a new project, use Workers instead of Pages.” Cloudflare describes Workers as having “a distinctly broader set of features” than its older Pages product.

Static files have no database, admin login or plugins, so there is far less to attack than on a typical CMS site.

A real example: 4ptransform.org on Cloudflare Workers

4ptransform.org, one of our own sites, is built and hosted this way, on Cloudflare Workers. It went live in November 2026. Most of its code and copy changes were written with an AI coding assistant (Claude Code) and then reviewed by a person. The site uses Astro, a static site generator, so what gets deployed is the same kind of thing this guide describes: a folder of HTML, CSS and image files. It is served from Cloudflare Workers static assets on its own domain, with a config file much like the one in Step 4.

On 30 November 2026, Google PageSpeed Insights scored its home page 100 for Performance, Accessibility, Best Practices and SEO, on both mobile and desktop, and 3/3 for Agentic Browsing. In plain terms:

  • Performance 100: the page loads and becomes usable quickly, even in the slow mobile test Google runs.
  • SEO 100: the page passed every Lighthouse SEO check, the technical basics that let search engines crawl it, such as a title, a meta description, crawlable links and a valid robots setup. Ranking still depends on the content.
  • Agentic Browsing 3/3: all of Lighthouse’s checks on whether AI agents can read and use the page passed.
  • Accessibility and Best Practices 100: the page passed every automated Lighthouse check for accessibility and for good web practices. Automated checks do not replace testing with real users and assistive technology, but they catch the common problems.
Google PageSpeed Insights report for 4ptransform.org on desktop, 30 November 2026: 100 Performance, 100 Accessibility, 100 Best Practices, 100 SEO, Agentic Browsing 3/3

You can open the full report and switch between the Mobile and Desktop tabs. These are lab scores from a single test. Google notes that they are estimates and can vary from run to run. There is no real-user (field) data yet: Google only shows it once a site has enough real visits recorded. The scores still show what the approach makes possible. A small static site with no plugins, no page builder and no server code, served from Cloudflare’s network by Workers, starts with very little that can slow it down. Keep images compressed and scripts few, review every change before deploying, and it stays that way. Hosting it costs nothing.

What you need

  • An AI assistant that can produce code (Claude, ChatGPT or Gemini; a paid plan helps for longer sites).
  • A free Cloudflare account.
  • Node.js installed on your computer, to run Cloudflare’s command-line tool, Wrangler.
  • A text editor (Visual Studio Code is free) to look at and adjust the files.
  • Optional: a domain name. To attach it to a Worker, the domain’s DNS must be managed by Cloudflare.

Step 1: Write a brief before you prompt

The quality of the site depends mostly on what you tell the AI. Before you start, write down:

  • Who the site is for and what visitors should do (call, book, buy elsewhere, sign up).
  • The pages: for example Home, Services, About, Contact.
  • Your real content: business name, services, prices if you publish them, address, opening hours, phone number. An AI may invent plausible details if you leave gaps, so give it the facts.
  • Style: colours, fonts, two or three websites you like.
  • Images: your own photos, or say clearly that the AI should leave placeholders for you to replace.

Step 2: Ask the AI for a static site

A prompt that works well:

Build a static website as plain HTML, CSS and a little vanilla JavaScript, with no frameworks and no build step. Pages: index.html, services.html, about.html, contact.html, plus a 404.html. Put shared styles in css/style.css and images in an images/ folder. Use semantic HTML, a responsive layout that works on phones, alt text on every image, and a title and meta description on every page. Use only the business details I give you below; do not invent facts, reviews or prices. Leave clearly marked placeholders where content is missing. [Your brief here]

Then iterate. Ask for one change at a time (“make the header sticky”, “add an opening-hours table to the contact page”) and keep the latest version of every file. Most assistants can give you the files one by one or as a single downloadable ZIP.

Save everything into one folder on your computer, for example:

my-site/
  public/
    index.html
    services.html
    about.html
    contact.html
    404.html
    css/style.css
    images/

Open public/index.html in your browser to check it locally.

Step 3: Review before you publish

AI output looks finished before it is. Check:

  • Facts: every name, number, price, address and claim. Remove anything you cannot stand behind.
  • Links: every internal link points to a page that exists; external links go where they should.
  • Images: you own or have a licence for every image. Replace placeholders.
  • Secrets: no API keys, passwords or private email addresses in the files. Anything in a static file is public.
  • Mobile and accessibility: try the site on a phone, check that text is readable and every image has alt text.
  • Search basics: each page has its own title and meta description, and one H1.

Step 4: Deploy to Cloudflare Workers

Create a file called wrangler.jsonc in the my-site folder (next to public/):

{
  "name": "my-site",
  "compatibility_date": "2026-11-29",
  "assets": {
    "directory": "./public",
    "not_found_handling": "404-page"
  }
}

directory tells Wrangler which folder to upload. "not_found_handling": "404-page" makes unknown addresses show your 404.html with a proper 404 status.

Then, in a terminal inside my-site:

npx wrangler login
npx wrangler deploy

The first command opens your browser to sign in to Cloudflare. The second uploads the files and prints the site’s address, in the form my-site.<your-subdomain>.workers.dev. Your site is live.

If you would rather start from Cloudflare’s template, run npm create cloudflare@latest -- my-site, choose “Hello World example” and then “Static site”. It creates a project with an asset folder and a config file. Copy your files into the asset folder, cd my-site and run npx wrangler deploy.

To preview locally first, run npx wrangler dev and open the address it prints.

Step 5: Add your own domain

In the Cloudflare dashboard, open your Worker, go to its settings and add a Custom Domain (for example www.example.com). The domain must be an active zone in your Cloudflare account, meaning its DNS is managed by Cloudflare. Cloudflare then creates the DNS record and issues the HTTPS certificate for you.

Step 6: Update the site

Edit the files (yourself, or by asking the AI for a new version of a page), check them, and run npx wrangler deploy again.

If more than one person edits the site, put the folder in a Git repository so you have a history of every change and can roll back.

Optional: headers, redirects and a contact form

  • Security headers and caching: add a _headers file to public/ (up to 100 rules) to set headers such as Content-Security-Policy or cache times.
  • Redirects: add a _redirects file to public/ (up to 2,000 static and 100 dynamic redirects), useful when you rename a page or move from an old site.
  • Single-page apps: if the AI built a single-page app, use "not_found_handling": "single-page-application" instead, so an address that does not match a file serves index.html and the app handles the route.
  • Contact forms: a static file cannot process a form. Either use a third-party form service, or add a small Worker script to the same project: set main to your script and "run_worker_first": ["/api/*"] in the assets settings so form posts to /api/... reach your code, while other addresses are answered from your files first. Requests that run your script count towards the free plan’s 100,000 requests a day; requests for static files do not.

Limits and when this is the wrong choice

  • Editing: there is no visual editor. Every change means editing files or asking the AI again. If non-technical staff update the site weekly, a website builder or CMS will be less work.
  • Dynamic features: logins, shopping carts, search across many pages and comments need extra services or code.
  • Maintenance by AI: as a site grows, an AI may change parts you did not ask it to. Review each new version, and keep previous versions so you can compare.
  • Custom domains on Workers need your domain’s DNS on Cloudflare.

FAQ

Can ChatGPT, Claude or Gemini build a whole website?

Yes, for small static sites. They write HTML, CSS and JavaScript well when given a clear brief and your real content. You still need to review the result and host the files somewhere, which is what Cloudflare Workers is for in this guide.

Is hosting on Cloudflare Workers really free?

For static sites, Cloudflare states that requests to static assets are free and unlimited and that storing them costs nothing. Limits apply to the number of files (20,000 per site on the free plan) and to requests that run Worker code (100,000 a day on the free plan).

Cloudflare Workers or Cloudflare Pages?

Choose Workers. Both can serve static files for free, but Cloudflare now tells new projects to “use Workers instead of Pages”. It also describes Workers as having “a distinctly broader set of features”, such as scheduled jobs (Cron Triggers) and more complete observability, and direct support for Durable Objects. A site that starts as plain files on Workers can grow into forms, APIs and server code without a move. Pages is still supported and offers a drag-and-drop upload in the dashboard, but for a new site Workers is the better long-term choice.

Do I need to know how to code?

You need to be comfortable opening a terminal and running two or three commands, and reading HTML well enough to check what the AI produced. If that is too much, an AI website builder with a visual editor is the better fit.

Is an AI-generated website good for SEO?

It can be. Search engines care about useful, accurate content and a fast, accessible page, not about who typed the HTML. Small static files served from Cloudflare’s network are a good start for speed. Give each page a unique title, description and heading, and write or check the text yourself rather than publishing generic AI copy.

Sources

Cloudflare pages read on 29 November 2026.