How to Run the computerd Binary as a Standalone SEA Artifact

The computerd daemon can be compiled into a self-contained Node.js Single Executable Application (SEA) that bundles the CLI source, native FUSE addons, and system libraries into a single file requiring no external Node runtime or npm installation.

The cloudflare/computer repository distributes the computerd service as a portable SEA artifact suitable for containerized and bare-metal deployments. This guide covers the complete workflow to build, locate, and execute the standalone binary using the official build scripts and source configuration.

Prerequisites for SEA Compilation

Before generating the SEA artifact, prepare your build environment with a C toolchain and FUSE development headers. The build process compiles native modules that interface with the filesystem.

On Debian or Ubuntu systems, install the required packages:

sudo apt-get install build-essential libfuse-dev

These dependencies are only required for compilation; the resulting binary embeds the fuse-native addon and pre-built libfuse library as SEA assets, eliminating runtime dependencies on the host system.

Building the Standalone Binary

Execute the cross-compilation script located at packages/computerd/scripts/build-bin.mjs to orchestrate the entire build pipeline:

node packages/computerd/scripts/build-bin.mjs

This script performs four critical operations defined in the source:

  1. Bundle the CLI: Calls esbuild via packages/computerd/scripts/sea/bundle.mjs to transpile packages/computerd/src/cli/computerd.ts and its dependencies into a single ESM file.
  2. Generate the SEA blob: Uses node --experimental-sea-config to create a configuration blob containing the bundled JavaScript and asset descriptors.
  3. Inject the payload: Downloads the target-specific Node.js binary and injects the SEA blob using postject, creating the executable.
  4. Code signing: Strips and re-signs the binary when targeting macOS to satisfy platform security requirements.

The build script supports cross-compilation for Linux x86_64 and macOS targets, producing platform-specific artifacts in a single invocation.

Locating and Running the SEA Artifact

After the build completes, the standalone binary resides at packages/computerd/bin/<target>/computerd. For the default Linux x86_64 target, the exact path is:


packages/computerd/bin/computerd-linux-x64/computerd

Execute the binary directly without invoking Node.js:

./packages/computerd/bin/computerd-linux-x64/computerd --port 45678

The SEA artifact accepts the same environment variables as the source CLI defined in packages/computerd/src/cli/computerd.ts:

  • PORT: TCP port for the daemon to listen on
  • MOUNT_POINT: Local filesystem path for the compute mount
  • FUSE_MOUNT: Enable or disable FUSE filesystem integration
  • UPSTREAM_URL: URL for upstream compute cluster coordination

Because the binary statically links the required native libraries, it operates on any compatible Linux x86_64 host regardless of the local Node.js installation status.

Containerizing the Binary

The repository includes a minimal Dockerfile at packages/computer-computerd-linux-x64/Dockerfile that packages the SEA artifact into a scratch container image containing no operating system libraries or package managers:

docker build -f packages/computer-computerd-linux-x64/Dockerfile . -t computerd:latest

This produces a tiny container image that uses the SEA binary as its entrypoint, ideal for secure, minimal deployments where attack surface reduction is critical.

Testing the SEA Build

The test suite validates the compiled binary through packages/computerd/src/cli/computerd.test.ts, which spawns the built artifact directly from dist/cli/computerd.cjs. After running npm run build, the test suite automatically exercises the SEA binary to verify CLI argument parsing, port binding, and FUSE initialization without mocking the Node.js runtime.

Summary

  • The build-bin.mjs script at packages/computerd/scripts/build-bin.mjs automates SEA generation by bundling, blob creation, and binary injection.
  • The final artifact includes embedded fuse-native and libfuse assets, requiring no external Node.js installation or npm packages at runtime.
  • Linux x86_64 binaries output to packages/computerd/bin/computerd-linux-x64/computerd and accept standard environment variables like PORT and UPSTREAM_URL.
  • A minimal Dockerfile at packages/computer-computerd-linux-x64/Dockerfile enables distribution via scratch containers.
  • The test suite in packages/computerd/src/cli/computerd.test.ts validates the binary against the same assertions used for the source CLI.

Frequently Asked Questions

What is a Node.js SEA binary?

A Single Executable Application (SEA) is a Node.js feature that packages your application code, assets, and the Node.js runtime itself into one executable file. According to the cloudflare/computer implementation, the computerd SEA embeds the bundled CLI from src/cli/computerd.ts along with native FUSE libraries, allowing the binary to run on systems without Node.js installed.

Does the SEA binary require FUSE system libraries to be installed on the host?

No. While building the artifact requires libfuse-dev headers for compilation, the build-bin.mjs script embeds the fuse-native addon and a pre-built libfuse library directly into the SEA binary as assets. The resulting executable is self-contained and does not depend on the host's FUSE installation, though it still requires FUSE kernel support to mount filesystems.

Can I run the computerd SEA binary on macOS?

Yes. The build-bin.mjs script supports cross-compilation for macOS targets and automatically handles code signing and stripping of the macOS binary after injection. The artifact path follows the pattern packages/computerd/bin/computerd-darwin-<arch>/computerd and operates identically to the Linux version, respecting the same environment variables and CLI flags defined in the TypeScript source.

How does the SEA binary handle environment configuration?

The standalone binary reads environment variables exactly as the standard Node.js CLI implementation does. As defined in packages/computerd/src/cli/computerd.ts, the binary checks for PORT, MOUNT_POINT, FUSE_MOUNT, and UPSTREAM_URL at startup, allowing you to configure the daemon without modifying the embedded code or providing a separate configuration file.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →