Migrate from E2B

Updated at:

The primary integration goal of FC Agent Sandbox is native compatibility with the E2B SDK. When migrating an existing E2B application to FC Agent Sandbox, keep the application structure unchanged whenever possible and replace only the connection parameters first.

Replace connection parameters

export E2B_API_KEY="<your-api-key>"
export E2B_API_URL="https://api.cn-beijing.e2b.fc.aliyuncs.com"
export E2B_DOMAIN="cn-beijing.e2b.fc.aliyuncs.com"

Capabilities to verify first

When migrating, verify the following core paths first:

  • Create, connect, pause, resume, and terminate sandboxes.

  • Run commands, background commands, standard input, and PTY sessions.

  • File read and write operations, directory management, uploads, and downloads.

  • Use getHost(port) to expose temporary services.

  • Build templates and create sandboxes from a specified template.

Capabilities that require redesign

If your application depends on E2B Volume, Snapshot, MCP gateway, BYOC, advanced network configuration, or high-frequency metrics, redesign those parts before migration instead of moving them over directly. FC Agent Sandbox supports sandbox metrics and currently returns them at 1-minute granularity.