Authenticate Wrangler, then copy the generated environment template.
bunx wrangler logincp .env.example .env.local
Set CHARDB_URL to the public URL Wrangler prints for the Worker, usually https://<worker-name>.<account-subdomain>.workers.dev. If you use a custom domain, configure that route before bootstrapping. Replace both secret placeholders.
Do not commit .env.local. The bootstrap script sends both secrets through a mode-0600 temporary file, removes it, and never puts a secret in process arguments.
Create the external resources, then bootstrap the Worker. The bootstrap script runs type checks, tests, and both builds before it uploads.
bun run setup:cloudflarebun run deploy:bootstrap
setup:cloudflare creates or verifies the R2 bucket in wrangler.toml. It does not install an expiry rule: the private content-addressed objects are the authoritative file bytes. Vectorize needs the explicit setup shown in Vectors. deploy:bootstrap uploads the first Worker, waits for the packaged schema identity, and applies the migration.
CharDB adds no hosted-service fee. Cloudflare bills Workers, Durable Objects, R2, and Vectorize from the bindings and traffic in your application. One application mutation can cause several Durable Object calls and SQLite row operations.File uploads write one content-addressed R2 object per unique payload digest, so identical payloads share bytes. Those objects do not expire automatically. Bytes left by rejected uploads or deleted files remain billable until provider-wide orphan collection is available. A completed restore also materializes one live key for each restored file until normal deletion removes it. Current evidence measures latency and operation counts, not a complete Cloudflare invoice. It does not collect every Worker CPU-ms, Durable Object duration, R2 GB-month, or Vectorize billing dimension.
Store the manifest outside the deployment. Restore validates the current topology, fences new traffic, and restarts the Catalog and every active shard at their recorded Durable Object PITR bookmarks:
Cloudflare retains Durable Object PITR history for 30 days. CharDB keeps authoritative R2 file bodies without automatic expiry. During restore it clears CharDB’s current live R2 keys and tracked Vectorize records in signed, bounded turns, restarts every Durable Object, eagerly rebuilds authoritative files, and requeues authoritative vectors. The same manifest resumes after an unknown result. CharDB does not provide automatic regional failover or a production SLA.Automatic resharding and range merging are unsupported.For recovery, resharding, and availability limits, read Plan ahead.Read Schema migrations before changing a deployed table.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"CharDB","description":"Better Auth-owned SQLite, files, and live Drizzle queries for Cloudflare Workers.","colors":{"primary":"#EC5713","light":"#F0642B","dark":"#C83D09"},"favicon":"https://mintcdn.com/chardb/FSnNMDOpitMgRH_w/favicon.svg?fit=max\u0026auto=format\u0026n=FSnNMDOpitMgRH_w\u0026q=85\u0026s=7d84448e419103c704b364b912d8c036","styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"chardb","hasAudioNarration":false,"actualSubdomain":"chardb","customDomains":["docs.chardb.dev"],"gitSource":{"type":"github","owner":"zpg6","repo":"chardb","deployBranch":"main","contentDirectory":"docs","isPrivate":false,"mountPath":"","label":""},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6a9d980ccf963d91b91da831","clientVersion":"0.0.4111","searchFilterCounts":[{"language":"default","tag":"Clients","count":2},{"language":"default","tag":"Operate","count":2},{"language":"default","tag":"Features","count":2},{"language":"default","tag":"Core","count":2},{"language":"default","tag":"Cookbook","count":1},{"language":"default","tag":"Plan ahead","count":1}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":"/* cyrillic-ext */\n@font-face {\n font-family: 'JetBrains Mono';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/jetbrainsmono/v24/tDbY2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8-qxTN1OVgaY.woff2) format('woff2');\n unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;\n}\n/* cyrillic */\n@font-face {\n font-family: 'JetBrains Mono';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/jetbrainsmono/v24/tDbY2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8-qxTPlOVgaY.woff2) format('woff2');\n unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;\n}\n/* greek */\n@font-face {\n font-family: 'JetBrains Mono';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/jetbrainsmono/v24/tDbY2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8-qxTOVOVgaY.woff2) format('woff2');\n unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;\n}\n/* vietnamese */\n@font-face {\n font-family: 'JetBrains Mono';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/jetbrainsmono/v24/tDbY2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8-qxTNVOVgaY.woff2) format('woff2');\n unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;\n}\n/* latin-ext */\n@font-face {\n font-family: 'JetBrains Mono';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/jetbrainsmono/v24/tDbY2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8-qxTNFOVgaY.woff2) format('woff2');\n unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;\n}\n/* latin */\n@font-face {\n font-family: 'JetBrains Mono';\n font-style: normal;\n font-weight: 500;\n font-display: swap;\n src: url(/_mintlify/assets/fonts/google/s/jetbrainsmono/v24/tDbY2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8-qxTOlOV.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n}\n.nav-logo,#page-title,.mdx-content h1,.mdx-content h2,.mdx-content h3{font-family:\"JetBrains Mono\", ui-monospace, SFMono-Regular, Menlo, monospace;font-weight:500;letter-spacing:-0.035em}.nav-logo{font-size:20px;letter-spacing:-0.025em;text-transform:lowercase}"}],"page":{"pagePath":"deploy","slug":"/deploy","pageMetadata":{"title":"Deploy","description":"Configure Cloudflare and deploy the Worker.","href":"/deploy"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Configure Cloudflare and deploy the Worker.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,p:`p`,pre:`pre`,span:`span`,..._provideComponents(),...props.components},{CodeBlock,Heading,Note}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);return _jsxs(_Fragment,{children:[_jsx(Heading,{level:`2`,id:`set-production-secrets`,children:`Set production secrets`}),`\n`,_jsx(_components.p,{children:`Authenticate Wrangler, then copy the generated environment template.`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`bunx`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` wrangler`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` login`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`cp`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` .env.example`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` .env.local`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Set `,_jsx(_components.code,{children:`CHARDB_URL`}),` to the public URL Wrangler prints for the Worker, usually `,_jsx(_components.code,{children:`https://\u003cworker-name>.\u003caccount-subdomain>.workers.dev`}),`. If you use a custom domain, configure that route before bootstrapping. Replace both secret placeholders.`]}),`\n`,_jsx(CodeBlock,{filename:`.env.local`,numberOfLines:`3`,language:`dotenv`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`dotenv`,children:_jsxs(_components.code,{language:`dotenv`,numberOfLines:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`CHARDB_URL`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`https://your-worker.example.com`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`CHARDB_ADMIN_TOKEN`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`replace-with-32-to-512-byte-secret`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`BETTER_AUTH_SECRET`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`replace-with-at-least-32-byte-secret`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Do not commit `,_jsx(_components.code,{children:`.env.local`}),`. The bootstrap script sends both secrets through a mode-0600 temporary file, removes it, and never puts a secret in process arguments.`]}),`\n`,_jsx(Heading,{level:`2`,id:`first-deploy`,children:`First deploy`}),`\n`,_jsx(_components.p,{children:`Create the external resources, then bootstrap the Worker. The bootstrap script runs type checks, tests, and both builds before it uploads.`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`bun`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` run`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` setup:cloudflare`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`bun`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` run`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` deploy:bootstrap`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`setup:cloudflare`}),` creates or verifies the R2 bucket in `,_jsx(_components.code,{children:`wrangler.toml`}),`. It does not install an expiry rule: the private content-addressed objects are the authoritative file bytes. Vectorize needs the explicit setup shown in `,_jsx(_components.a,{href:`/vectors`,children:`Vectors`}),`. `,_jsx(_components.code,{children:`deploy:bootstrap`}),` uploads the first Worker, waits for the packaged schema identity, and applies the migration.`]}),`\n`,_jsx(Heading,{level:`2`,id:`later-deploys`,children:`Later deploys`}),`\n`,_jsx(_components.p,{children:`Use the routine release path when the resources already exist. It runs the same checks and builds before upload.`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`bun`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` run`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` deploy`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Routine `,_jsx(_components.code,{children:`deploy`}),` requires an existing Worker and refuses a package or migration mismatch.`]}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[`Keep `,_jsx(_components.code,{children:`CHARDB_ADMIN_TOKEN`}),` separate from `,_jsx(_components.code,{children:`BETTER_AUTH_SECRET`}),`. The first authorizes maintenance operations. The second signs application sessions.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`cost-boundary`,children:`Cost boundary`}),`\n`,_jsx(_components.p,{children:`CharDB adds no hosted-service fee. Cloudflare bills Workers, Durable Objects, R2, and Vectorize from the bindings and traffic in your application. One application mutation can cause several Durable Object calls and SQLite row operations.`}),`\n`,_jsx(_components.p,{children:`File uploads write one content-addressed R2 object per unique payload digest, so identical payloads share bytes. Those objects do not expire automatically. Bytes left by rejected uploads or deleted files remain billable until provider-wide orphan collection is available. A completed restore also materializes one live key for each restored file until normal deletion removes it. Current evidence measures latency and operation counts, not a complete Cloudflare invoice. It does not collect every Worker CPU-ms, Durable Object duration, R2 GB-month, or Vectorize billing dimension.`}),`\n`,_jsx(Heading,{level:`2`,id:`recovery-boundary`,children:`Recovery boundary`}),`\n`,_jsx(_components.p,{children:`Capture a native SQLite recovery point after a healthy deploy and before a migration:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`bunx`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` @chardb/core`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` backups`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` create`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --url`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://your-worker.example.com`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --out`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` recovery.json`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Store the manifest outside the deployment. Restore validates the current topology, fences new traffic, and restarts the Catalog and every active shard at their recorded Durable Object PITR bookmarks:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`bunx`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` @chardb/core`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` backups`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` restore`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --url`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://your-worker.example.com`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` recovery.json`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Cloudflare retains Durable Object PITR history for 30 days. CharDB keeps authoritative R2 file bodies without automatic expiry. During restore it clears CharDB’s current live R2 keys and tracked Vectorize records in signed, bounded turns, restarts every Durable Object, eagerly rebuilds authoritative files, and requeues authoritative vectors. The same manifest resumes after an unknown result. CharDB does not provide automatic regional failover or a production SLA.`}),`\n`,_jsx(_components.p,{children:`Automatic resharding and range merging are unsupported.`}),`\n`,_jsxs(_components.p,{children:[`For recovery, resharding, and availability limits, read `,_jsx(_components.a,{href:`/plan-ahead`,children:`Plan ahead`}),`.`]}),`\n`,_jsxs(_components.p,{children:[`Read `,_jsx(_components.a,{href:`/schema-migrations`,children:`Schema migrations`}),` before changing a deployed table.`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Deploy","description":"Configure Cloudflare and deploy the Worker.","href":"/deploy"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Set production secrets","slug":"set-production-secrets","depth":2,"children":[]},{"title":"First deploy","slug":"first-deploy","depth":2,"children":[]},{"title":"Later deploys","slug":"later-deploys","depth":2,"children":[]},{"title":"Cost boundary","slug":"cost-boundary","depth":2,"children":[]},{"title":"Recovery boundary","slug":"recovery-boundary","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"chardb","siteName":"CharDB","title":"Deploy - CharDB","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-09-06T16:43:05.147Z","originalFileLocation":"deploy.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Configure Cloudflare and deploy the Worker.\">\u003cmeta data-mint-head name=\"application-name\" content=\"CharDB\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/chardb/MPk1h6qUU0LBgFS_/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/chardb/MPk1h6qUU0LBgFS_/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/chardb/MPk1h6qUU0LBgFS_/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/chardb/MPk1h6qUU0LBgFS_/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/chardb/MPk1h6qUU0LBgFS_/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/chardb/MPk1h6qUU0LBgFS_/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/chardb/MPk1h6qUU0LBgFS_/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/chardb/MPk1h6qUU0LBgFS_/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/chardb/MPk1h6qUU0LBgFS_/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Deploy - CharDB\">\u003cmeta data-mint-head property=\"og:description\" content=\"Configure Cloudflare and deploy the Worker.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"CharDB\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.chardb.dev/deploy\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://chardb.mintlify.site/_mintlify/api/og/v2?division=Operate\u0026amp;title=Deploy\u0026amp;description=Configure+Cloudflare+and+deploy+the+Worker.\u0026amp;theme=927d29d5e4857ba598887b7b\u0026amp;signature=b752a7a9fa3730870c3bb674016891c169458712cbd0c9fbd364f10cbc00d853\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Deploy - CharDB\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Configure Cloudflare and deploy the Worker.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://chardb.mintlify.site/_mintlify/api/og/v2?division=Operate\u0026amp;title=Deploy\u0026amp;description=Configure+Cloudflare+and+deploy+the+Worker.\u0026amp;theme=927d29d5e4857ba598887b7b\u0026amp;signature=b752a7a9fa3730870c3bb674016891c169458712cbd0c9fbd364f10cbc00d853\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/chardb/MPk1h6qUU0LBgFS_/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"CharDB\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#EC5713\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.chardb.dev/deploy\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/deploy.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.chardb.dev/#organization\",\"name\":\"CharDB\",\"url\":\"https://docs.chardb.dev\"},{\"@type\":\"WebSite\",\"@id\":\"https://docs.chardb.dev#website\",\"name\":\"CharDB\",\"url\":\"https://docs.chardb.dev\",\"publisher\":{\"@id\":\"https://docs.chardb.dev/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.chardb.dev/deploy#webpage\",\"url\":\"https://docs.chardb.dev/deploy\",\"name\":\"Deploy\",\"description\":\"Configure Cloudflare and deploy the Worker.\",\"dateModified\":\"2026-09-06T16:43:05.147Z\",\"isPartOf\":{\"@id\":\"https://docs.chardb.dev#website\"},\"breadcrumb\":{\"@id\":\"https://docs.chardb.dev/deploy#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.chardb.dev/deploy#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"CharDB\",\"item\":\"https://docs.chardb.dev\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Deploy\",\"item\":\"https://docs.chardb.dev/deploy\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.chardb.dev/deploy#article\",\"headline\":\"Deploy\",\"name\":\"Deploy\",\"description\":\"Configure Cloudflare and deploy the Worker.\",\"url\":\"https://docs.chardb.dev/deploy\",\"mainEntityOfPage\":{\"@id\":\"https://docs.chardb.dev/deploy#webpage\"},\"dateModified\":\"2026-09-06T16:43:05.147Z\",\"publisher\":{\"@id\":\"https://docs.chardb.dev/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.chardb.dev#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"CharDB\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"CharDB\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/deploy.md","siteName":"CharDB","nav":{"global":null,"groups":[{"group":"Core","pages":[{"title":"Quickstart","href":"/quickstart"},{"title":"Ownership","href":"/ownership"}]},{"group":"Clients","pages":[{"title":"Clients","href":"/clients"},{"title":"Live queries","href":"/live-queries"}]},{"group":"Features","pages":[{"title":"Files","href":"/files"},{"title":"Vectors","description":"Write and search organization vectors through Vectorize.","href":"/vectors"}]},{"group":"Operate","pages":[{"title":"Deploy","href":"/deploy"},{"title":"Schema migrations","description":"Generate, inspect, and apply a forward schema change.","href":"/schema-migrations"}]},{"group":"Plan ahead","pages":[{"title":"Plan ahead","href":"/plan-ahead"}]},{"group":"Cookbook","pages":[{"title":"Chat app","href":"/cookbook/chat-app"}]}]},"basePath":"","title":"Deploy - CharDB","buildId":"dpl_DqYu5MPb49gWBBbUGgpHQUmCHY3P","deploymentId":"dpl_DqYu5MPb49gWBBbUGgpHQUmCHY3P","dynamics":[],"chunks":[]}