Developer Guide

Deploy to Cloudflare Button

One-click deployment for Cloudflare Workers. Share your project so anyone can clone, configure, and launch it on their own account in seconds.

Deploy to Cloudflare

What is the Deploy to Cloudflare button?

The Deploy to Cloudflare button is a special link + image badge that lets other developers instantly deploy your public GitHub or GitLab repository as a Cloudflare Worker — without manually cloning, configuring Wrangler, or provisioning resources themselves.

When someone clicks the button, Cloudflare:

📂

Clones the repo

Creates a fresh copy of your repository under the user’s own GitHub or GitLab account.

⚙️

Configures the project

Lets them customize Worker name, repo name, and any required resource names on a single setup page.

🚀

Builds & deploys

Uses Workers Builds to build the app, provision resources (KV, D1, R2, etc.), and deploy it live.

🔄

Sets up CI/CD

Configures automatic builds on every push to the production branch + preview URLs on pull requests.

How to use the button (for end users)

If you see a Deploy to Cloudflare button on a README or documentation page, here’s exactly what happens when you click it:

  1. Click the button You are taken to deploy.workers.cloudflare.com with the source repository URL pre-filled.
  2. Sign in / connect accounts Authenticate with GitHub (or GitLab) and your Cloudflare account if you aren’t already signed in.
  3. Customize project settings Choose a name for the new repository, the Worker name, and any resource names (KV namespaces, D1 databases, R2 buckets, etc.). Cloudflare reads the wrangler.toml / wrangler.json to know what is required.
  4. Deploy Cloudflare clones the repo into your account, provisions the necessary resources, binds them, builds the project, and deploys the Worker. You get a live URL almost immediately.
  5. Continue developing The new repository is yours. Future pushes to the main branch automatically rebuild and redeploy via Workers Builds. Pull requests get preview URLs.
💡

Tip: The source repository must be public. Private repos and self-hosted GitHub/GitLab instances are not supported.

How to add the button to your project

To let others deploy your Workers application with one click, add the button to your README, docs, or any webpage.

1. README.md (Markdown) version

This is the most common place. Paste the following into your README.md:

📄 README.md
[![Deploy to Cloudflare](https://deploy.workers.cloudflare.com/button)](https://deploy.workers.cloudflare.com/?url=https://github.com/RegisterMySite-com/chatroom)

Replace the GitHub URL with your own public repository URL. You can also point to a subdirectory if needed:

📄 With subdirectory
[![Deploy to Cloudflare](https://deploy.workers.cloudflare.com/button)](https://deploy.workers.cloudflare.com/?url=https://github.com/YOUR_USER/YOUR_REPO/tree/main/path/to/worker)

2. HTML version (for websites & docs)

Use this when embedding the button on a static HTML page, blog post, or documentation site:

</> HTML
<a href="https://deploy.workers.cloudflare.com/?url=https://github.com/RegisterMySite-com/chatroom">
  <img src="https://deploy.workers.cloudflare.com/button" alt="Deploy to Cloudflare" loading="lazy">
</a>
📌

The example above uses the RegisterMySite chatroom template repository. Swap the url parameter for any public Workers project you want to share.

Live example

Click the button below to deploy the RegisterMySite chatroom template to your own Cloudflare account:

Deploy to Cloudflare

Best practices & requirements

Repository requirements

Automatic resource provisioning

Cloudflare can automatically create and bind these resources based on your Wrangler config:

Make sure your source repo includes sensible default names/IDs so the cloned project is immediately usable.

Helpful package.json hints

You can guide users by adding binding descriptions:

📄 package.json (excerpt)
{
  "cloudflare": {
    "bindings": {
      "DB": {
        "description": "D1 database used for chat message storage"
      },
      "AI": {
        "description": "Workers AI binding for the chat assistant"
      }
    }
  }
}
⚠️

Monorepos: Each Worker needs its own Deploy button pointing to its isolated subdirectory. Deploying multiple Workers from one monorepo with a single button is not supported.

Quick reference

Markdown (README)

[![Deploy to Cloudflare](https://deploy.workers.cloudflare.com/button)](https://deploy.workers.cloudflare.com/?url=https://github.com/RegisterMySite-com/chatroom)

HTML

<a href="https://deploy.workers.cloudflare.com/?url=https://github.com/RegisterMySite-com/chatroom">
  <img src="https://deploy.workers.cloudflare.com/button" alt="Deploy to Cloudflare" loading="lazy">
</a>

Further reading