Skip to main content
Jun deploys as one Cloudflare Worker with its own database, bucket, queue and Durable Objects. You can deploy it with the Deploy button or from a checkout of the repo.
Use the Workers Paid plan ($5/month per account) for the AI. On Free, a Worker gets 10 ms of CPU per request, and reading a model’s streamed answer takes far more, so AI replies fail now and then with error 1102. The inbox, widget and visitors run on Free. See Costs and limits.

What gets created

Resource IDs aren’t in wrangler.jsonc on purpose: the button and wrangler deploy provision them. See How it works for what each one does.

With the Deploy button

1

Open the button

Deploy to CloudflareSign in to Cloudflare and connect your GitHub account when asked.
2

Fill in the form

The form shows:
  • A repository name for your copy of Jun in your GitHub account.
  • A name for each resource: the Worker, the D1 database, the R2 bucket and the queue. Keep the defaults for your first desk.
  • SETUP_TOKEN: any passphrase of 16 or more characters. You enter it once to create the owner account, and again only to recover access.
3

Deploy

Cloudflare copies the repo into your GitHub account, creates the resources and builds the Worker with Workers Builds. The deploy step is npm run deploy, which applies D1 migrations and deploys.
4

Open the Worker's URL

Open https://<worker-name>.<your-subdomain>.workers.dev and continue with First sign-in.
The repo the button creates stays connected to the Worker through Workers Builds, so pushing to it deploys again. Updates arrive in it as pull requests; see Upgrade.

A second desk in the same account

If this Cloudflare account already has Jun installed, give the new one its own names on the form, for example jun-trial, jun-trial-files and jun-trial-crawl.
With the default names, the new Worker binds to the existing jun-desk database, jun-desk-files bucket and jun-desk-crawl queue. It then shares the first desk’s conversations and files.

”Could not push contents of source repo to destination repo”

If the build stops with this message, Cloudflare created your repo with only README.md and wrangler.jsonc and couldn’t copy the rest. GitHub refused the copy: its push protection blocks a push that contains something shaped like a key. Jun’s own files no longer carry any, so this should only happen with a fork that adds one. workers-sdk#14553 reports the same message. To get past it, either:
  • use the command line route below, or
  • push the code into the repo the button created, keeping that repo’s wrangler.jsonc. git push prints the file GitHub objects to.

From the command line

You need Node 22.18 or later and a Cloudflare account.
1

Clone and install

2

Sign in to Cloudflare

3

Pick names (optional)

For a second desk in the same account, change the names in wrangler.jsonc: the Worker name, database_name, bucket_name, and the queue in both producers and consumers.
wrangler.jsonc
Keep the binding names (DB, FILES, CRAWL_QUEUE, AI) and the Durable Object classes as they are.
4

Set the setup token

Enter a passphrase of 16 or more characters. If the Worker doesn’t exist yet, Wrangler offers to create it so it can hold the secret. You can also run this after the first deploy; until it’s set, the setup page answers “SETUP_TOKEN isn’t configured”.
5

Deploy

npm run deploy runs scripts/deploy.ts, which:
  1. builds the dashboard, the widget frame and the Worker with Vite,
  2. on a first deploy (no D1 database with that name yet), deploys first so the database gets provisioned, then applies the migrations,
  3. on later deploys, applies new D1 migrations first, then deploys, so new code never runs against an old schema.
Wrangler prints the Worker’s URL at the end. Open it to create the owner account.

Optional secrets

Nothing else is required. Add these when you need them, with npx wrangler secret put <NAME> or in the Cloudflare dashboard under the Worker’s Settings → Variables and Secrets: The full list is in Secrets.

First sign-in

Create the owner account with your setup token.

Custom domain

Serve the desk from your own hostname.