Skip to main content

Build and wait for completion

The build method builds the template and waits for the build to complete. It returns build information including the template ID and build ID.
Disk size is not a per-sandbox setting. Unlike cpuCount/cpu_count and memoryMB/memory_mb, there is no disk-size parameter, neither on the template build nor on Sandbox.create. A sandbox’s disk size is determined by your team’s tier limit and applied when the template is built (see Build limits). diskSizeMB only ever appears in API response payloads (for example on sandbox and template info), never as an input. To get a larger disk, raise your tier or contact support@e2b.dev.

Build in background

The buildInBackground method starts the build process and returns immediately without waiting for completion. This is useful when you want to trigger a build and check its status later.

Check build status

Use getBuildStatus to check the status of a build started with buildInBackground.

Example: Background build with status polling