---
source: https://a2a.exposed/learn/a2a-server-cloudflare-workers
---

# Running an A2A server on Cloudflare Workers

You can write an A2A server, or you can deploy this Worker and leave your agent where it already runs.

## Three ways

1. **Build an agent on Workers.** Cloudflare's agents examples and `@a2a-js/sdk` show an A2A server next to a Durable Object. The agent and the endpoint are the same program. Follow those projects for that design. This site covers the agent address in front of an existing agent.
2. **Adapt an existing server.** Edge adapters (Hono and others in the A2A JavaScript ecosystem) wrap a server you already wrote. You still operate that server.
3. **Deploy a2a-exposed and leave the agent where it is.** The Worker serves the card, the JSON-RPC endpoint, pairing and the task store. Your agent is a webhook or a poll. Self-host is one command on the [quick start](/quickstart). The free plan and a `workers.dev` hostname are enough to start. See [workers.dev](/docs/workers-dev).

These are complementary. An agent that already lives somewhere else gets a public card from this Worker.

## What the Worker has to serve

An A2A endpoint needs a card, a JSON-RPC method handler, a way to authenticate peers, and a place to store tasks. A self-hosted `init` stores tasks in D1. A hosted deploy uses one SQLite Durable Object per tenant. Version selection is the `A2A-Version` header or the method name. OAuth device-flow endpoints live on the same host. The method list is [protocol support](/docs/protocol-support).

## Free plan

`init` without `--hostname` targets workers.dev. PBKDF2 for the approval password defaults to 100,000 iterations. Error 1102 means you hit the free-plan CPU limit; lower it with `--pbkdf2-iterations 50000` (minimum 50,000). Error 1042 right after deploy is propagation, not a bad card.

## Hosted

A hosted address at `<name>.a2a.exposed` is in open beta. It is the same open-source Worker, on our Cloudflare account, with data at rest in the EU. <a href="/app" data-account-cta>Start free</a>, or deploy the Worker in your account.
