Skip to main content
novita template create builds a Dockerfile directly into a reusable sandbox template. It reads the Dockerfile, builds the image, applies sandbox settings (start / ready command, CPU, memory, disk size), and registers the result under the template name — which you can then pass to sandbox.create(...).

Usage

CLI

Argument

Options

Behavior and validation

  • Authentication is required: log in with novita auth login or set NOVITA_API_KEY in the environment.
  • Providing --cmd without --ready-cmd fails with Both start and ready commands must be provided.; --ready-cmd alone is allowed.
  • An invalid template name or an odd --memory-mb value aborts the build before anything is sent to the server.
  • A --disk-size-mb value that is not an integer or is below 1024 aborts the build before anything is sent to the server. A value that is not a multiple of 1024, or that exceeds your account’s disk quota, is rejected by the server.
  • Build logs are streamed to the terminal. On success the CLI prints Python / JS snippets showing how to create a sandbox from the new template.

Examples

An example Dockerfile used by the commands below:
Dockerfile

Minimal build

Reads ./novita.Dockerfile (or ./Dockerfile) in the current directory:
CLI

Specify a Dockerfile explicitly

Point the build at a specific Dockerfile relative to the root directory:
CLI

Full build

Custom root directory, resources (including disk size), start/ready commands, and no cache:
CLI
Once the build finishes, create sandboxes from the template by name:
JavaScript & TypeScript
Last modified on December 2, 2026