cf-fs is a file storage service for Cloudflare Workers built around
filesystem semantics. WebDAV and the browser interface are access layers over
the same filesystem implementation.
File contents are stored in Cloudflare R2, while coordination and metadata are managed by Cloudflare Durable Objects.
The implementation is split into three layers:
- Access layers translate WebDAV and browser requests into filesystem operations.
- The filesystem layer owns paths, resources, directories, and file operations.
- The storage layer keeps metadata in Durable Objects and file contents behind an object-store interface, currently backed by R2.
This separation allows additional access protocols and storage backends without duplicating filesystem semantics.
- RFC 4918 — WebDAV Class 1 and Class 2
- RFC 6578 — Collection Synchronization
- RFC 4331 — WebDAV Quota and Size Properties
- RFC 5689 — Extended MKCOL
- Atomic consistency and failure recovery across WebDAV request handling and filesystem mutations
Compatibility is validated with the Apache Litmus WebDAV compatibility test suite. Passing Litmus does not imply complete conformance with the listed RFCs.
Deploy interactively with Wrangler:
bunx cf-fs deployTo remove a deployment, run the interactive destroy command. Worker deletion requires explicit confirmation, and deleting the R2 bucket is optional.
bunx cf-fs destroyManual deployment
bun install
# Log in to Cloudflare if needed
bunx wrangler login
# Create the R2 bucket. If you use a different name, update the binding in
# wrangler.jsonc as well.
bunx wrangler r2 bucket create webdav
# Deploy the Worker. The command prints its HTTPS URL.
bun run deploy
# Set the WebDAV username and password interactively
bunx wrangler secret put USERNAME
bunx wrangler secret put PASSWORDFor local development, set these variables in .dev.vars:
USERNAME=your-username
PASSWORD=your-password