Self-hosting
Self-host camelRun v2 on Cloudflare Workers and camelfsd
Run camelRun v2 yourself: Cloudflare Workers with SQLite Durable Objects plus the Go camelfsd service for CamelFS repos and Firecracker session VMs.
camelRun v2 consists of two runtime components and requires zero Postgres or D1 databases:
worker/: A Cloudflare Worker (HonoAPI) with three SQLite Durable Object classes (TenantDO,AgentDO,VoiceCallDO), an R2 bucket (MEDIA_BUCKET) for images and audio, and a Cloudflare Queue (EVENTS_QUEUE) for webhooks and channel replies.camelfsd/: A standalone Go service providing content-addressed Git-backed repositories and session VMs (--backend=localwith SQLite + filesystem, or--backend=awswith 2 DynamoDB tables + S3;--vm-driver=localor--vm-driver=firecracker).
Local development
From the v2/ directory of the runtime repository:
# Typecheck, run Go camelfsd tests, and run end-to-end Miniflare + camelfsd tests
npm run typecheck
npm run test:go
npm run test:tsStart camelfsd locally with SQLite + local VM driver:
cd v2/camelfsd
go run ./cmd/camelfsd \
--listen 127.0.0.1:8790 \
--data-dir ./data \
--backend local \
--vm-driver local \
--dev-token dev-camelfs-tokenStart the Worker locally with Wrangler:
cd v2
npm exec -- wrangler dev -c worker/wrangler.jsoncVerify the health endpoint and bootstrap your first tenant:
curl -s http://127.0.0.1:8787/v2/health
curl -s -X POST http://127.0.0.1:8787/v2/tenants \
-H "X-Admin-Key: dev-admin-secret" \
-H "Content-Type: application/json" \
-d '{"name": "local-dev", "initialCreditsUsd": 100}'Production deployment (Cloudflare Workers + Firecracker)
1. Build the Firecracker guest init and rootfs
On a Linux Firecracker host (kernel with CONFIG_FUSE_FS and CONFIG_OVERLAY_FS), build camelfs-guest-init and install it onto a base Linux ext4 rootfs:
cd v2/camelfsd
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o /tmp/camelfs-guest-init ./cmd/camelfs-guest-init
scripts/install-guest-init.sh /path/to/base.ext4 /tmp/camelfs-guest-init /path/to/v2-rootfs.ext4When a Firecracker VM starts, camelfsd sends only the commit's tree metadata over virtio-vsock (port 10000). camelfs-guest-init mounts a read-only metadata-cached FUSE lowerdir (fetching blobs lazily over vsock port 10001) under a writable overlayfs at /workspace. On every bash command checkpoint, it walks only the overlayfs upperdir (O(changed files)).
2. Run camelfsd with AWS storage and Firecracker jailer
Create an S3 bucket and two DynamoDB tables (camelfs-repos and camelfs-vms, each with string partition/sort keys PK and SK). Run one direct Firecracker daemon per VM table under systemd (KillMode=control-group, Restart=on-failure) using a short socket path such as /nvme/v2:
camelfsd \
--listen 127.0.0.1:8790 \
--data-dir /nvme/v2 \
--backend aws \
--s3-bucket my-camelfs-objects \
--ddb-repos-table camelfs-v2-repos \
--ddb-vms-table camelfs-v2-vms \
--vm-driver firecracker \
--firecracker-bin /usr/local/bin/firecracker \
--firecracker-jailer /usr/local/bin/jailer \
--firecracker-kernel /nvme/v2/vmlinux \
--firecracker-rootfs /nvme/v2/v2-rootfs.ext4 \
--public-keys "k1:<base64url-ed25519-public-key>"Route the Worker's CAMELFS_URL to the daemon over a private tunnel (such as Cloudflare Tunnel). When camelfsd uses the Firecracker jailer, reserve UID/GID 201000 + guestCID on the host.
3. Deploy the Cloudflare Worker
Create the R2 bucket (MEDIA_BUCKET) and Cloudflare Queue (EVENTS_QUEUE) declared in your Wrangler config, supply secrets (ADMIN_SECRET, VAULT_SECRET, CAMELFS_SIGNING_KEY, TOOL_IDENTITY_PRIVATE_JWK, and any platform model provider keys), and deploy:
cd v2
npm exec -- wrangler deploy --dry-run -c worker/wrangler.production.jsonc --outdir dist/production-worker
npm exec -- wrangler deploy -c worker/wrangler.production.jsoncSee Configuration for every Worker binding, secret, and camelfsd flag.