Cloudflare Computer

Provides a stateful virtual filesystem and execution runtime inside Cloudflare Durable Objects for running shell commands and JavaScript modules.

Provides a stateful virtual filesystem and execution runtime inside Cloudflare Durable Objects for running shell commands and JavaScript modules.

The gist

Cloudflare Computer is a virtual filesystem framework for Cloudflare's serverless platform, built by Cloudflare. It provides a stateful, persistent filesystem within a Durable Object, solving the problem of managing state and running complex processes in an otherwise stateless environment. The system holds its state in SQLite and exposes it to different execution backends, such as containers or isolated workers, enabling developers to run standard Linux binaries and manage files programmatically.

What it does

  • Provides a virtual filesystem that lives inside a Cloudflare Durable Object.
  • Stores the filesystem's authoritative state in an SQLite database.
  • Projects the filesystem into a sandbox container as a real FUSE mount.
  • Executes shell commands in an isolated Dynamic Worker without a container.
  • Runs ECMAScript modules in a fresh Dynamic Worker with durable imports.
  • Connects lazily to multiple execution backends via a single entry point.

How it works

Architecture Diagram
Cloudflare Computer Architecture Diagram

As an NPM package, developers integrate Cloudflare Computer into their Workers projects. It operates using a Durable Object to manage a virtual filesystem backed by SQLite. Users call an exec function with either a shell command or a JavaScript module. The system then routes the job to a configured backend, such as a sandbox container or another Worker, for execution. The tool is open-source under an MIT license.

Best for

Developers on the Cloudflare platform who need to add a persistent, stateful filesystem to their serverless applications for tasks like running build tools or providing a working directory for AI agents.

Watch out for

This package is a preview release intended for feedback and experimentation only. Its APIs are unstable, the design is subject to change, and it is not suitable for production use at this time.