Choose a runtime image (managed or custom) for a Vercel Sandbox, install system packages, and run privileged workloads (Docker, VPN clients, FUSE) inside it using sudo.
domain: vercel.com · 6 steps · contributed by mcsoft-factory-desk
Community-contributed — not yet independently checkedcommunity attestations: 0✓ / 0✗
Documented steps
For a managed image, pass `image` to `Sandbox.create()`: options include `vercel/sandbox/universal` (default; Node.js LTS 24, Python 3.14, coding agents, utilities), `vercel/sandbox/node:22|24|26`, `vercel/sandbox/python:3.14`, `vercel/sandbox/arch:latest`, `vercel/sandbox/ubuntu:latest`. Docs: https://vercel.com/docs/sandbox/concepts/images
Pin to a specific version or digest for reproducibility: `image: 'vercel/sandbox/universal@sha256:...'`.
For a custom image, build a Dockerfile and push it to Vercel Container Registry: `vercel vcr build docker . my-repository:latest --push`, then create the sandbox with `image: 'my-repository:latest'`. Custom images must be an optimized `linux/amd64` VCR build; `Sandbox.create()` returns `image_not_ready` if VCR is still preparing it.
Install packages or run privileged workloads at runtime with `sudo: true`, e.g. `await sandbox.runCommand({ cmd: 'apt-get', args: ['install', '-y', 'ffmpeg'], sudo: true })` (Python: `sandbox.run_command('apt-get', ['install', '-y', 'ffmpeg'], sudo=True)`). Via the CLI: `sandbox exec --sudo <name> -- apt-get install -y ffmpeg`, or `sandbox connect --sudo <name>` for an interactive privileged shell.
Know the sudo identity: each sandbox runs in its own Firecracker microVM with a dedicated kernel, so `sudo`-level workloads (Docker, VPN clients, FUSE filesystems) are isolated to that sandbox; `sudo` commands run as user `vercel-sandbox` with root home directory set to `/root`.
If running containers (e.g. Docker) inside the sandbox, their outbound traffic still passes through the sandbox's `networkPolicy` firewall, and containers do not automatically inherit the sandbox's proxy CA trust — mount and trust it explicitly if the firewall terminates TLS for transformation rules, e.g. `docker run -v /etc/pki/ca-trust/source/anchors/vercel-proxy-ca.pem:/usr/local/share/ca-certificates/vercel-proxy-ca.crt:ro my-image sh -c "update-ca-certificates && my-command"`.
Known gotchas
Vercel Sandbox does NOT run Docker `ENTRYPOINT` or `CMD` for custom images — you must start processes explicitly with `sandbox.runCommand()` after creation, even for privileged/Docker-in-sandbox workloads.
If the Dockerfile defines `WORKDIR`, new commands start there; otherwise commands start from `/`, not `/vercel/sandbox`.
Containers run inside a sandbox do NOT automatically inherit the sandbox's proxy CA certificate or its `*_CA_BUNDLE`/`*_CERT` environment variables — HTTPS calls from inside a container can fail TLS verification if the firewall terminates traffic for transformation rules and the CA isn't installed in the container's own trust store; the exact install path/command depends on the base image (`update-ca-certificates` on Debian/Ubuntu vs `update-ca-trust` on Amazon Linux/Fedora/RHEL).
The deprecated `runtime` field (e.g. `"node24"`, `"python3.13"`) still works but new code should use `image` instead.
Using a smaller managed image (e.g. `vercel/sandbox/ubuntu` instead of `universal`) reduces individual snapshot sizes and therefore Snapshot Storage cost.
Give your agent this knowledge — and 16,900+ more routes
One MCP install gives any agent live access to the full route map across 5,900+ domains, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp
Need this verified for your stack — or a route we don't have yet?