Deploy and launch · Skill

Deploy a site to Cloudflare

deploy-site-to-cloudflare

Deploys a static site, single-page app or full-stack app to Cloudflare Workers with Wrangler - log in, pick static assets or a Worker, set secrets, preview, then ship - and adds storage such as KV, D1 or R2 only when needed. Use when the user wants to host on Cloudflare, deploy with wrangler, or move a site to Cloudflare Workers or Pages.

Works with: Any AI Not yet model-tested; testing Jan 2027

Paste it into ChatGPT, Claude, Gemini or any AI chat, then tell it about your project. How it works

Install in Claude Code, Cursor or Codex (optional)

Only for AI coding tools that read skill folders. Run one line in a terminal, in your project folder. It downloads this skill's text files from TheSkillVault and nothing else; you can read them first with “View raw SKILL.md”.

Claude Code (all your projects)

curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/deploy-site-to-cloudflare/raw' -o ~/'.claude/skills/deploy-site-to-cloudflare/SKILL.md' && curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/deploy-site-to-cloudflare/files/LICENSE.txt' -o ~/'.claude/skills/deploy-site-to-cloudflare/LICENSE.txt'

Cursor (this project)

curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/deploy-site-to-cloudflare/raw' -o '.cursor/skills/deploy-site-to-cloudflare/SKILL.md' && curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/deploy-site-to-cloudflare/files/LICENSE.txt' -o '.cursor/skills/deploy-site-to-cloudflare/LICENSE.txt'

Codex and other Agent Skills tools (this project)

curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/deploy-site-to-cloudflare/raw' -o '.agents/skills/deploy-site-to-cloudflare/SKILL.md' && curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/deploy-site-to-cloudflare/files/LICENSE.txt' -o '.agents/skills/deploy-site-to-cloudflare/LICENSE.txt'

Or connect the whole library over MCP

Add TheSkillVault to Cursor or add this to your app's MCP settings (read-only; help):

{
  "mcpServers": {
    "theskillvault": {
      "url": "https://theskillvault.ai/mcp"
    }
  }
}

Ship a site to Cloudflare's network with the Wrangler command-line tool. Most sites need only static assets; add a Worker when you need server code.

When to use

  • You want fast, cheap hosting on Cloudflare for a static site or app.
  • You were told to "run wrangler deploy" and want to do it safely.
  • You are moving off another host and want a preview first.

When not to use

  • Your app is Next.js and you want zero config. Use deploy-nextjs-to-vercel, or the Cloudflare adapter for your framework.

Steps

  1. Build the site locally (npm run build) and note the output folder, such as dist.
  2. Run npx wrangler login, then npx wrangler whoami to confirm the account.
  3. Add a wrangler.toml (or wrangler.jsonc) with a name, a compatibility_date and an [assets] block pointing at the build folder.
  4. If you have server code, add main = "src/worker.ts". Keep API routes there.
  5. Store secrets with npx wrangler secret put NAME. Put plain config in [vars].
  6. Test locally with npx wrangler dev.
  7. Run npx wrangler deploy --dry-run to check the bundle without shipping.
  8. Ask before the real deploy, then run npx wrangler deploy and open the *.workers.dev URL it prints.
  9. Add your domain under the Worker's settings when the preview looks right.
| Need | Cloudflare piece |
| --- | --- |
| Key-value cache or settings | KV |
| SQL database | D1 |
| File and image storage | R2 |
| Background jobs | Queues |

Gotchas

  • Never put API keys in [vars] or in git. They are visible. Use wrangler secret.
  • An old compatibility_date can disable newer runtime features. Use a recent date for new projects.
  • Single-page apps need not_found_handling = "single-page-application" under [assets] so deep links work.
  • Workers do not run every Node module. Add nodejs_compat to compatibility flags when a library needs Node APIs.
  • In CI, use a scoped API token as a secret, not your personal login.

Portability

Works with Astro, SvelteKit, Vite, Remix and plain HTML. If you use a framework with its own Cloudflare adapter, follow its build command and keep the same wrangler steps.

Example prompt

"Deploy my Vite site to Cloudflare. Show me a dry run first and keep my API key secret."

Done when

  • wrangler deploy --dry-run passes with no errors.
  • The live URL loads, deep links work, and secrets are set with wrangler secret, not in files.
  • The custom domain (if any) shows the new site over HTTPS.

---

Modified from "cloudflare-deploy" in openai/skills (Apache-2.0). Changes by TheSkillVault are listed in the metadata above. See LICENSE.txt.

Bundled files

Licence

Adapted from OpenAI (openai/skills, cloudflare-deploy) (Copyright (c) OpenAI (openai/skills, cloudflare-deploy); Apache License 2.0 text in LICENSE.txt), Apache License 2.0. Modified by TheSkillVault on 2026-11-02: rewritten as a beginner deploy walkthrough for one site; the product index and decision trees were cut to a short storage table; added secrets handling, gotchas and done-when. Not the original file.

Licence: Apache License 2.0. Attribution when you reuse it: Based on work by OpenAI (openai/skills, cloudflare-deploy) (Copyright (c) OpenAI (openai/skills, cloudflare-deploy); Apache License 2.0 text in LICENSE.txt, Apache License 2.0), https://github.com/openai/skills/tree/49f948faa9258a0c61caceaf225e179651397431/skills/.curated/cloudflare-deploy; adapted by TheSkillVault, https://theskillvault.ai