1. Guide
  2. Publish to Your Own Cloudflare

Publish to Your Own Cloudflare

This guide shows you how to publish your LocusPilot site to your own Cloudflare account. LocusPilot still manages the site source code. You get a simple publish button and your site runs on your Cloudflare Pages project.

This is also one of the best ways to get a higher Agent-Ready markdown score. Cloudflare can add rules that serve markdown when AI tools ask for it.

Before you publish: Apply AI Agent Ready first. Then publish or republish to Cloudflare so the live site gets the Agent-Ready files and rules.

1Pick the Right Hosting Path

There are a few ways to host your site. The right one depends on who should control DNS and Cloudflare.

LocusPilot hosting

This is the easiest path. Use the normal Custom Domain guide. For the higher Agent-Ready markdown score, your domain must point through our Cloudflare hosting so LocusPilot can apply the needed rules.

Publish to My Cloudflare

This is the middle path. Your site runs in your Cloudflare account, but LocusPilot still manages the source code and publish button. This guide covers this option.

Full self-hosting

Use this if you want your own GitHub repo and your own Cloudflare build setup. Follow the self-hosted guide.

Simple rule: To get Agent-Ready markdown negotiation, the domain must run through Cloudflare rules. Plain DNS at Namecheap or GoDaddy cannot do this by itself.

2Prepare Your Cloudflare Account

  1. Create or log in to your Cloudflare account.
  2. If you want the higher Agent-Ready score, add your domain as a Cloudflare Website. This creates a Cloudflare zone.
  3. Make sure the domain status is active before you publish again.
Important: Adding a domain only inside Cloudflare Pages is not enough for Transform Rules. The domain must also exist as a Cloudflare Website, also called a zone.

3Create the Cloudflare API Token

LocusPilot needs a Cloudflare API token so it can create a Pages project, deploy your site, and add the Agent-Ready rules.

AreaPermissionLevel
AccountCloudflare PagesEdit
ZoneZoneRead
ZoneTransform RulesEdit
Token resources: Set Account Resources to include your account. Set Zone Resources to All zones or the domain you want to use. If Zone Resources are wrong, LocusPilot will not find your domain.
Cloudflare API token permissions setup

4Add Cloudflare in LocusPilot

  1. Open LocusPilot.
  2. Go to Settings.
  3. Open Cloudflare Accounts.
  4. Click Add Account.
  5. Enter a name, your Cloudflare Account ID, and your API token.
  6. Save the account.

LocusPilot checks that the token can access Cloudflare Pages. Zone access is used later when you publish with a custom domain.

LocusPilot Cloudflare account settings

5Turn On AI Agent Ready (Optional)

This is optional. Before you publish to your Cloudflare account, turn on AI Agent Ready. This adds the files that AI tools need, such as markdown pages, discovery files, and Agent-Ready headers.

  1. Open the completed project in LocusPilot.
  2. Find the AI Agent Ready section.
  3. Click Apply.
  4. Wait until the apply step starts or completes.
If you already published first: That is okay. Apply AI Agent Ready, then use Publish to My Cloudflare again. The second publish sends the Agent-Ready files to Cloudflare and tries to create the Transform Rules.
Apply AI Agent Ready on the project status page

6Publish from the Project Status Page

  1. Open the completed project in LocusPilot.
  2. Find Publish and export.
  3. Click Publish to My Cloudflare.
  4. Choose the Cloudflare account you added.
  5. Enter the Cloudflare Pages project name.
  6. If you want Agent-Ready markdown negotiation, enter your custom domain in the publish modal.
  7. Click Deploy.
Do not mix up the two domain fields: The Custom Domain card on the project page is for LocusPilot hosting. The custom domain field inside Publish to My Cloudflare is for your own Cloudflare account.
Publish to My Cloudflare modal

7Connect the Domain in Cloudflare Pages

After the first publish, Cloudflare gives you a URL like your-project.pages.dev. You can then add your real domain inside the Cloudflare Pages project.

  1. Open Cloudflare.
  2. Go to Workers & Pages.
  3. Open the Pages project you published.
  4. Open Custom domains.
  5. Add your domain.
  6. Follow the DNS steps Cloudflare shows.
  7. Wait until the domain and SSL are ready.
Add a custom domain in Cloudflare Pages

8Check Agent-Ready Markdown

If Agent-Ready is enabled and the domain is ready, LocusPilot will try to add two Cloudflare Transform Rules during publish.

Good results in the publish modal

  • Agent-Ready rules created
  • Agent-Ready rules already configured

Then scan your domain with your Agent-Ready checker. You can also test from a terminal:

curl -I -H "Accept: text/markdown" https://example.com/

A good response should include content-type: text/markdown.

isitagentready.com scanner result

Troubleshooting

Domain zone not found

The selected Cloudflare token cannot see the domain zone. Check that the domain is listed under Cloudflare Websites. Also check that Zone Resources include that domain or All zones.

Token needs more permissions

Add Zone > Zone > Read and Zone > Transform Rules > Edit. Then update the token in LocusPilot settings and publish again.

Site deploys, but the score is lower

The site can still deploy even if the rules fail. Direct markdown files can still work, but AI tools may not get markdown from the normal page URL until Transform Rules are active.

Where to see the rules in Cloudflare

Open the domain zone in Cloudflare. Go to Rules > Transform Rules > URL Rewrite. You should see two rules for Agent-Ready markdown.