# Publishing research results with Cloudflare

Many researchers find themselves needing to share research outputs and data: results, intermediate steps, datasets, interactive views. Often the journey from the data and text they have is arduous with many requirements. One is hosting.

I have had the same problem with my own work over and over. For years, I was running my own hosting and servers with CMSs like Drupal and Wordpress but since 2024, I've been looking for an AI native platform.  And after trying Lovable, Vercel and Netlify, I settled on Cloudflare for all of my public sites. 

My approach starts with files in folders, organised so that agents can manage them, and ends with publishing those files as a website. Each step has its own guide in this series - co-written with my agents based on the work they did for me. To make it simple, I use first person throughout:

1. *Publishing research results with Cloudflare* (this guide): putting a folder of files online at a public address.
2. [*Building research sites from data files: Astro and fast search*](https://semanticmachines.fyi/guides/astro-and-fast-search): turning data files into a site people can search.
3. Git and GitHub for sharing data with agents (coming soon): keeping the files where collaborators and their agents can work on them.
4. Spreadsheets and tabular data with agents (coming soon): turning workbooks into tables an agent can maintain.
5. From a pile of mixed documents to an agent-friendly knowledge repository (coming soon): turning documents into a repository an agent can maintain.

## Why I use Cloudflare to share research

Cloudflare is slightly more complex to use than Lovable or Vercel but since most of its use is outsourced to my agents, this is not a problem. Most of my own sites run there, including dominiklukes.net and Semantic Machines, and in October and November 2026 I moved several more there from Google Cloud Run and Lovable hosting. These are my reasons:

- **Cost.** A static site is a folder of files: HTML pages, styles, scripts and data. Cloudflare's free plan for static sites (called Pages) allows unlimited sites and does not limit the number of visitors or the amount of data they download. The limits are on builds and files: as of 2026, roughly 500 builds a month, 20,000 files per site and 25 MiB per file.
- **Comparison with similar hosts.** Vercel's free Hobby plan is for non-commercial personal use and meters bandwidth; its Pro plan is charged per seat per month. For my kinds of site, Cloudflare's free plan goes further.
- **Speed.** Cloudflare serves files from a global network, from copies kept close to the visitor. A static page does not wait for a server to assemble it.
- **Domains.** Every site gets a free address ending in `pages.dev`, so you do not need a domain at all. If you want one, Cloudflare sells domains at cost and handles the DNS records and the security certificates for you.
- **GitHub and agents.** A Cloudflare site can be built from a GitHub repository, and every step of publishing is a command an AI agent such as Claude Code or Codex can run for you.

## From one HTML file to a public link

AI agents are great at building HTML explainers. Imagine you built one you want to share with others or to set up a public site with an easily accessible link. Cloudflare is a great solution.

The first step is to give this guide to your AI agent (Claude Code, Codex or another) and have a conversation with it about what you want to publish. You can read the guide yourself, but the agent does the work and can take the next steps from here. My agents publish and update all my sites this way.

### Setting up your agent to work with Cloudflare

Cloudflare publishes setup instructions for about a dozen agents, including Claude Code and Codex, on its [agent setup page](https://developers.cloudflare.com/agent-setup/). One page there, [prompt.md](https://developers.cloudflare.com/agent-setup/prompt.md), is written for the agent itself. It begins: "Complete all of the following steps yourself by running the commands directly. Do not ask the user to run any of these commands."

Giving that page to your agent is the setup step. The agent installs Cloudflare's plugin, which has two parts. One is a set of about 25 skills, such as how to use Wrangler (Cloudflare's command-line tool) and best practice for Workers. The other is Cloudflare's MCP server, which lets the agent work with your account: DNS, projects and settings. The first time the agent uses it, you log in to Cloudflare through your browser. The agent changes its own configuration during setup, so you may want to skim the page first.

Cloudflare's [documentation](https://developers.cloudflare.com/docs-for-agents/) can also be read by agents: every page has a Markdown version, and there are llms.txt files.

### Publishing the explainer

Once the agent is set up, you ask it to publish the explainer and give you the address. The agent creates the project, uploads the files and comes back with a link you can send to anyone. Your part is to log in once in the browser, choose a name for the site and say yes when the agent asks before it does something on your account.

If you do not have a Cloudflare account yet, the agent can still publish a first try. Cloudflare announced temporary accounts in June 2026: the agent deploys the site with no account at all and gets a live address and a claim link. You have 60 minutes to open the claim link and sign up or log in to keep the site. Otherwise Cloudflare deletes it. Since spring 2026 an agent can also create a Cloudflare account, buy a domain and deploy through Stripe Projects; you accept Cloudflare's terms and add a payment method when asked.

For new projects, Cloudflare now recommends Workers, which can also serve static files. My existing sites run on Pages, which is still supported. Your agent will pick the current option, and you do not need to know the difference.

You can upload files by hand in the Cloudflare dashboard (roughly 1,000 files, up to 25 MiB each). That is not the right way to do it. Nothing is recorded, nothing is repeatable, and every change means doing it all again by hand.

### Changes after that

When you change the explainer, you ask the agent to publish the new version. My agents keep a short deploy script in each repository that builds the site and uploads it with Wrangler, so publishing is the same every time.

If you want your own domain, ask the agent to add it. The free `pages.dev` address works without one. My sites use subdomains of domains I hold in Cloudflare, such as talks.dominiklukes.net.

## Drafts and intermediate steps

A first version may need checking by co-authors before you share the link more widely. There are three things you can ask the agent for.

### Preview addresses

Ask the agent to publish the new version as a preview. A preview gets an address of its own and does not replace the live site, so you can send a colleague the new version while the public one stays as it was. Anyone who has the preview link can open it.

### A shared password

Two of my sites sit behind a password: a review site for a client and a family travel site. My agents set up both with the same pattern. A small piece of code (a Pages Function, explained below) runs before every page is served and shows a password page until the visitor enters the password stored as a secret in the Cloudflare project settings. The browser then receives a cookie, and the visitor can see the site until it expires. Images, styles and other files the pages need are let through.

This gate has one password that everyone shares. There are no user accounts and no record of who looked at what. It is fine for drafts and for a small audience. It is not protection for sensitive data (see the privacy section). Cloudflare also has a service called Access, which asks each visitor to log in with their own email address. I do not use it on any of my sites.

### Keeping drafts out of search

A page behind the password gate cannot be read by search engines. For a draft without a password, ask the agent to add a `robots.txt` file or a 'noindex' tag to the page, which asks search engines not to list it.

## GitHub alongside Cloudflare

Cloudflare holds the published site. GitHub holds the project behind it: the data and the source of the site. In a GitHub repository, your collaborators, and their agents, can work on the data directly, and every change is recorded with who made it and when. Cloudflare can rebuild the site automatically each time someone pushes a change, though my agents mostly upload my sites with the deploy script. A private repository behind a public site is a normal arrangement. The third guide in this series, Git and GitHub for sharing data with agents (coming soon), covers how to set this up and what to put in the repository.

## When you need more than files

Everything so far has been files. Now suppose you want visitors to ask a question of your papers or your data and see what matches it. The question has to be turned into an embedding and compared with embeddings of your papers at the moment someone asks. Something has to run when the visitor searches. That is the step where a running service, and some cost, comes in. For that kind of search, I would try two Cloudflare services I do not run yet. Workers AI runs embedding models on Cloudflare's network, so a Worker can turn the visitor's question into an embedding. Vectorize stores the embeddings of your papers and finds the ones closest to the question.

Cloudflare has several services for this step, and your agent can set them up when you need them. Here is what each one is and what I use it for.

### Pages Functions

A Function is a small piece of code attached to a Pages site that runs when a request arrives. The password gate above is a Function. The rest of the site stays as static files.

### Workers

A Worker is a small program that runs on Cloudflare's network whenever someone sends it a request. You do not set up or maintain a server. The free plan allows roughly 100,000 requests a day. I use Workers for:

- talks.dominiklukes.net, where one Worker serves the talk pages and stores readers' comments and questions;
- two sites with video, where a Worker only serves the video in pieces, so viewers can jump to any point without downloading the whole file;
- live workshops, where a Worker gives each participant a short-lived key for AI model services and passes their requests on. The real key stays on Cloudflare and never reaches the participants.

### D1: a database

D1 is a small SQL database (SQLite) that a Worker or Function can read and write. It holds the comments on the talks site, the participant keys and usage limits for the workshop service, and the conversation and feedback logs of a feedback chatbot.

### R2: file storage

R2 stores files, including large ones such as media and backups. Everything I keep in R2 is private: backups, media for my slide archive, archive copies of other projects. There is no charge for data downloaded from R2. That is why I compared its costs with podcast hosting. The free tier includes roughly 10 GB of storage.

### Durable Objects

A Durable Object holds the current state of something many people use at the same moment, so that they all see the same thing. I use them for realtime boards at events, where participants post ideas, form groups and ask anonymous questions, and for syncing and sharing in some of my apps.

## Privacy: this guide is about public data

Cloudflare can also be used for private data, and many organisations do. Before you put anything private there, make sure you understand your institution's policies on data and what support it offers. This guide is mostly about sharing data that is meant to be public, not anything secret, confidential or containing personal data.

- **A public site is public.** Anything on a public site can be indexed by search engines, copied and archived. Use only data you may publish: openly licensed records, your own outputs, aggregates.
- **The password is a convenience gate.** The shared password keeps casual visitors out. It is not access control for personal, confidential or embargoed data: there is one password, everyone shares it, and nothing records who looked.
- **Check your institution's policies first.** For personal data, participant data, unpublished data under an agreement, or anything an ethics approval governs, find out what your institution's policies require and which services it supports before you use Cloudflare or anything else; at Oxford, ask IT or information compliance.
- **Where the data is.** Cloudflare is a US company, and it serves data from a global network. A personal account sits outside your university's agreements with its suppliers.
- **Secrets stay out of pages and repositories.** API keys and passwords never go in the repository or the page. They go in Cloudflare's environment secrets, which only the server code can read. This is how the password gate and the workshop key service work.
- **Repositories have the same rule.** A public GitHub repository is public. Keep anything you cannot publish out of it, or make the repository private.
- **The agent works with your account.** Everything above applies to what you ask your agent to publish.

## Give this guide to your agent

Copy this and give it to your agent (Claude Code, Codex or another). The agent can read the whole guide and the rest of the series on this site, each page also as a Markdown file written for agents.

> Read https://semanticmachines.fyi/guides/publishing-research-with-cloudflare (and https://semanticmachines.fyi/llms.txt for the rest of the series), then help me publish my research outputs on Cloudflare the way it describes. Start by asking me what I want to share.

### What your agent takes from this guide

This is the practice the guide describes, written for the agent. It is here so that you can see what your agent will work from.

```markdown
# Practice: publishing research outputs on Cloudflare

Purpose: publish public research outputs and data as a static site on
Cloudflare, doing the work yourself, with drafts for co-authors and server
logic only when needed.

## Set up Cloudflare's agent tools first
- Read https://developers.cloudflare.com/agent-setup/prompt.md and follow it.
  It installs Cloudflare's plugin (skills, including Wrangler and Workers
  best practice) and Cloudflare's MCP server. It changes your configuration,
  so offer the user the page to skim before you start. The first use of the
  MCP server asks the user to log in through the browser.
- Use Cloudflare's documentation in its Markdown versions and llms.txt files:
  https://developers.cloudflare.com/docs-for-agents/
- If the user has no Cloudflare account, offer a first try with a temporary
  account: `wrangler deploy --temporary`. Give the user the live address and
  the claim link, and tell them they have 60 minutes to sign up or log in
  through the claim link, or Cloudflare deletes the site.

## Working with the user
- Run every command yourself. Ask the user only to log in, choose names
  (project, domain) and approve actions on their account.
- Do not ask the user to upload files in the dashboard.
- Keep a deploy script in the repository (for example scripts/deploy.sh) that
  builds the site and uploads it with Wrangler. Run it each time the user asks
  to publish a new version.
- For new projects, use Workers with static assets. Keep existing Pages
  projects on Pages.

## What may be published
- Publish only data the user may publish: openly licensed records, their own
  outputs, aggregates.
- This practice is for public data. Cloudflare can hold private data too, but
  for personal data, participant data, unpublished data under an agreement or
  anything governed by an ethics approval, first ask the user to check their
  institution's data policies and supported services.
- Keep API keys and passwords out of pages and repositories. Store them as
  Cloudflare environment secrets, which only server code can read.
- You act on the user's account. Apply these rules to everything you publish.

## The site
- A site is a folder of static files. The entry page is index.html; files it
  loads (images, data) sit in the same folder.
- Keep the data in separate files (JSON or Markdown) and generate the HTML
  from them with a site builder such as Astro. Keep each file under the
  25 MiB per-file limit.
- For a custom domain held in Cloudflare, add it to the project; Cloudflare
  creates the DNS record.

## Drafts
- For a version co-authors should check first, publish a preview. It gets
  its own address and does not replace the live site.
- For a shared password: add a Pages Function middleware
  (functions/_middleware.ts) that serves a password page, compares the
  submitted password with a SITE_PASSWORD secret set in the project settings,
  sets an HttpOnly cookie when they match, and lets images, styles and other
  assets through. Tell the user that this is one shared password with no
  accounts and no record of who looked, so it is not protection for
  sensitive data.
- For a draft without a password, add robots.txt or a noindex tag.

## When files are not enough
- Add server logic only for something that must run when a visitor makes a
  request, such as turning a search question into an embedding.
- Pages Function: code attached to a Pages site. Worker: a standalone small
  program. D1: a small SQL (SQLite) database. R2: storage for large files.
  Durable Object: shared state that many people use at the same moment.
- Tell the user that this step brings a running service and some cost.
```
