Vercel Sandbox allows you to run arbitrary code in isolated, ephemeral Linux VMs. This product is in beta.
A sandbox is an isolated Linux system for your experimentation and use. Internally, it is a Firecracker MicroVM that is powered by the same infrastructure that powers 1M+ builds a day at Vercel.
Vercel Sandbox is in beta.
To get started, create a new project:
Link it to Vercel:
Pull its environment variables:
Now create next-dev.ts
:
Run it like this:
This will:
next dev
serverAll while streaming logs to your local terminal.
The SDK uses Vercel OIDC tokens to authenticate whenever available. This is the most straightforward and recommended way to authenticate.
When developing locally, you can download a development token to .env.local
using vercel env pull
. After 12 hours the development token expires, meaning
you will have to call vercel env pull
again.
In production, Vercel manages token expiration for you.
If you want to use the SDK from an environment where VERCEL_OIDC_TOKEN
is
unavailable, you can also authenticate using an access token:
Set your team ID, project ID, and token to the environment variables
VERCEL_TEAM_ID
, VERCEL_PROJECT_ID
, and VERCEL_TOKEN
. Then pass these to
the create
method:
timeout
option of Sandbox.create()
.The base system is an Amazon Linux 2023 system with the following additional packages installed.
node22
image ships a Node 22 runtime under /vercel/runtimes/node22
.python3.13
image ships a Python 3.13 runtime under /vercel/runtimes/python
.vercel-sandbox
user./vercel/sandbox
is writable.The node22
and python3.13
images allow users to run commands as root. This
can be used to install packages and system tools:
Sandbox runs sudo in the following configuration:
HOME
is set to /root
– Executed commands will source root’s configuration
files (e.g. .gitconfig
, .bashrc
, etc).PATH
is left unchanged – sudo won’t change the value of PATH, so local or
project-specific binaries will still be found.Both these images are based on Amazon Linux 2023. The full package list is available here.
Vercel Sandbox allows you to run arbitrary code in isolated, ephemeral Linux VMs. This product is in beta.
A sandbox is an isolated Linux system for your experimentation and use. Internally, it is a Firecracker MicroVM that is powered by the same infrastructure that powers 1M+ builds a day at Vercel.
Vercel Sandbox is in beta.
To get started, create a new project:
Link it to Vercel:
Pull its environment variables:
Now create next-dev.ts
:
Run it like this:
This will:
next dev
serverAll while streaming logs to your local terminal.
The SDK uses Vercel OIDC tokens to authenticate whenever available. This is the most straightforward and recommended way to authenticate.
When developing locally, you can download a development token to .env.local
using vercel env pull
. After 12 hours the development token expires, meaning
you will have to call vercel env pull
again.
In production, Vercel manages token expiration for you.
If you want to use the SDK from an environment where VERCEL_OIDC_TOKEN
is
unavailable, you can also authenticate using an access token:
Set your team ID, project ID, and token to the environment variables
VERCEL_TEAM_ID
, VERCEL_PROJECT_ID
, and VERCEL_TOKEN
. Then pass these to
the create
method:
timeout
option of Sandbox.create()
.The base system is an Amazon Linux 2023 system with the following additional packages installed.
node22
image ships a Node 22 runtime under /vercel/runtimes/node22
.python3.13
image ships a Python 3.13 runtime under /vercel/runtimes/python
.vercel-sandbox
user./vercel/sandbox
is writable.The node22
and python3.13
images allow users to run commands as root. This
can be used to install packages and system tools:
Sandbox runs sudo in the following configuration:
HOME
is set to /root
– Executed commands will source root’s configuration
files (e.g. .gitconfig
, .bashrc
, etc).PATH
is left unchanged – sudo won’t change the value of PATH, so local or
project-specific binaries will still be found.Both these images are based on Amazon Linux 2023. The full package list is available here.