Skip to main content

Create Sandbox

The simplest way to create a sandbox is to call novita.sandbox.create() without any arguments.

From Template

You can create a sandbox from a template by passing the template name or ID.
Python
Use a context manager for automatic cleanup:

Specify CPU, memory, and disk

Pass resources to set the sandbox’s total allocation at creation. Only specify the resources you need to override; omitted fields use the template defaults. Requested values must meet the template minimums and your account quotas.
Customizing the disk size or CPU cores when creating a Sandbox increases boot time. We recommend preconfiguring the required disk size and CPU cores in your Template to reduce startup time.
Values must be positive. Memory and disk use GiB and must represent a whole number of MiB; for example, 0.5 GiB is 512 MiB. For runtime expansion, see the whole-GiB requirements. To increase resources after creation, see Resize Sandbox.

Environment Variables

You can set environment variables when creating a sandbox, and override or append them on a single command.

Metadata

Sandbox metadata lets you attach custom key-value information to a sandbox. Common uses include:
  • Connecting a sandbox to a user session.
  • Saving custom user-related data for a sandbox, such as API keys.
  • Linking a sandbox to a user ID so it can be reconnected later.
Metadata is provided when the sandbox is created. Later, it can be read when listing active sandboxes with novita.sandbox.list(). Sandboxes can also be filtered using metadata when listing.
Last modified on December 1, 2026