Skip to main content
By default, Keyflare deploys
  • A Cloudflare Worker named keyflare
    • A Master key secret deployed within that Worker
  • A Cloudflare D1 database named keyflare

Using a custom Worker

You can deploy custom Keyflare instances (e.g., for different environments or teams) using the --name flag:
# Production instance
kfl init --name keyflare-prod

# Staging instance
kfl init --name keyflare-staging
Each instance gets its own:
  • Worker (e.g., keyflare-prod.workers.dev)
  • D1 database
  • Master key secret
To target a specific instance, use its API URL:
kfl login
# Enter: https://keyflare-prod.workers.dev
Instance names must start with a lowercase letter, contain only lowercase letters, numbers, and hyphens, and be 63 characters or less.

Using an Existing D1 Database

If you have a pre-existing D1 database (e.g., from a previous Keyflare instance or migration), you can bind to it using the --d1id flag:
kfl init --d1id 12345678-1234-1234-1234-123456789abc
This tells Keyflare to use the specified database instead of creating a new one. The deployment will:
  1. Build an ephemeral config with the provided database_id
  2. Deploy the worker bound to that database
  3. Run migrations against it (idempotent)
When to use:
  • Migrating from another Keyflare instance
  • Restoring from a backup
  • Sharing a database across worker redeployments
Note: The database must exist in the same Cloudflare account. If the UUID is invalid, deployment will fail with a clear error.

Next Steps

Security & Backup

Back up your master key and define your recovery strategy.

Custom Domains

Serve your Keyflare instance from your own domain.