Snapshots | Daytona

Snapshots

Snapshots are persistent, point-in-time captures of sandbox state, including the filesystem, installed packages, dependencies, and settings. A snapshot saves a sandbox’s state so you can restore it later, and any number of new sandboxes can start from the same snapshot.

Daytona provides default snapshots for creating sandboxes. You can also create snapshots from images, capture the state of existing sandboxes, or create warm pools for a snapshot:

Default snapshots

Snapshot vCPU Memory Storage GPU Sandbox Class
daytona-small 1 1GiB 3GiB Container
daytona-medium 2 4GiB 8GiB Container
daytona-large 4 8GiB 10GiB Container
daytona-gpu 1 1GiB 1GiB 1 GPU
daytona-vm-small 1 1GiB 3GiB Linux VM
daytona-vm-medium 2 4GiB 8GiB Linux VM
daytona-vm-large 4 8GiB 10GiB Linux VM
windows-small 1 4GiB 30GiB Windows
windows-medium 2 8GiB 50GiB Windows
windows-large 4 16GiB 50GiB Windows
  1. Go to Daytona Sandboxes
  2. Click Create Sandbox
  3. Select a snapshot
  4. Click Create

Code Examples

from daytona import Daytona, CreateSandboxFromSnapshotParams

daytona = Daytona()

sandbox = daytona.create(
    CreateSandboxFromSnapshotParams(
        snapshot="daytona-small",
    )
)
import { Daytona } from '@daytona/sdk'

const daytona = new Daytona()

const sandbox = await daytona.create({
  snapshot: 'daytona-small',
})
require 'daytona'

daytona = Daytona::Daytona.new

sandbox = daytona.create(
  Daytona::CreateSandboxFromSnapshotParams.new(
    snapshot: 'daytona-small'
  )
)
package main

import (
  "context"
  "github.com/daytona/clients/sdk-go/pkg/daytona"
  "github.com/daytona/clients/sdk-go/pkg/types"
)

func main() {
  client, _ := daytona.NewClient()
  ctx := context.Background()
  params := types.SnapshotParams{
    Snapshot: "daytona-small",
  }
  _, _ = client.Create(ctx, params)
}
import io.daytona.sdk.Daytona;
import io.daytona.sdk.Sandbox;
import io.daytona.sdk.model.CreateSandboxFromSnapshotParams;

public class App {
    public static void main(String[] args) {
        try (Daytona daytona = new Daytona()) {
            CreateSandboxFromSnapshotParams params = new CreateSandboxFromSnapshotParams();
            params.setSnapshot("daytona-small");
            Sandbox sandbox = daytona.create(params);
        }
    }
}
daytona create --snapshot daytona-small
curl 'https://app.daytona.io/api/sandbox' \ 
  --request POST \ 
  --header 'Content-Type: application/json' \ 
  --header 'Authorization: Bearer YOUR_API_KEY' \ 
  --data '{
    "snapshot": "daytona-small"
}'

Default snapshots include pre-installed Python and Node.js packages.

Package Version
anthropic v0.120.2
beautifulsoup4 v4.14.3
claude-agent-sdk v0.2.130
openai-agents v0.19.4
daytona v0.203.0
django v6.0.1
flask v3.1.2
huggingface-hub v0.36.0
instructor v1.14.4
keras v3.13.0
langchain v1.2.7
llama-index v0.14.13
matplotlib v3.10.8
numpy v2.4.1
ollama v0.6.1
openai v2.53.0
opencv-python v4.13.0.90
pandas v2.3.3
pillow v12.1.0
pipx v1.8.0
pydantic-ai v1.47.0
python-lsp-server v1.14.0
requests v2.32.5
scikit-learn v1.8.0
scipy v1.17.0
seaborn v0.13.2
sqlalchemy v2.0.46
torch v2.10.0
transformers v4.57.6
uv v0.9.26

Create snapshots

Create a snapshot.

  1. Go to Daytona Snapshots
  2. Click Create Snapshot
  3. Enter the snapshot name and image of any publicly accessible image or container registry
    • Snapshot name: identifier used to reference the snapshot
    • Snapshot image: base image for the snapshot, must include either a tag or a digest (e.g., ubuntu:22.04); the latest/ lts/ stable tags are not supported
  4. Click Create

Code Examples

from daytona import Daytona, CreateSnapshotParams

daytona = Daytona()

snapshot = daytona.snapshot.create(
    CreateSnapshotParams(name="my-awesome-snapshot", image="ubuntu:22.04"),
)
import { Daytona } from "@daytona/sdk";

const daytona = new Daytona();

const snapshot = await daytona.snapshot.create({
  name: "my-awesome-snapshot",
  image: "python:3.12",
});
require 'daytona'

daytona = Daytona::Daytona.new

snapshot = daytona.snapshot.create(
  Daytona::CreateSnapshotParams.new(name: 'my-awesome-snapshot', image: 'python:3.12')
)
package main

import (
  "context"
  "github.com/daytona/clients/sdk-go/pkg/daytona"
  "github.com/daytona/clients/sdk-go/pkg/types"
)

func main() {
  client, _ := daytona.NewClient()
  ctx := context.Background()
  snapshot, logCh, _ := client.Snapshot.Create(ctx, &types.CreateSnapshotParams{
    Name:  "my-awesome-snapshot",
    Image: "python:3.12",
  })
  for range logCh {
  }
  _ = snapshot
}
import io.daytona.sdk.Daytona;
import io.daytona.sdk.model.Snapshot;

final class CreateSnapshot {
    public static void main(String[] args) {
        try (Daytona daytona = new Daytona()) {
            Snapshot snapshot = daytona.snapshot().create("my-awesome-snapshot", "python:3.12");
        }
    }
}
daytona snapshot create my-awesome-snapshot --image python:3.11-slim --cpu 2 --memory 4
curl https://app.daytona.io/api/snapshots \ 
  --request POST \ 
  --header 'Content-Type: application/json' \ 
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \ 
  --data '{
    "name": "my-awesome-snapshot",
    "imageName": "python:3.11-slim",
    "cpu": 2,
    "memory": 4
  }'

VM snapshots

Daytona provides methods to create VM snapshots for Linux VM and Windows.
VM snapshots are used to create VM sandboxes. VM snapshots are distinct from container snapshots and cannot be used to create container sandboxes. VM snapshots support VM-only capabilities such as creating a snapshot from a sandbox.

Creating a Linux VM snapshot

  1. Create a snapshot from an image
  2. Set the snapshot’s sandbox class to LINUX_VM

Code Examples

from daytona import Daytona, CreateSnapshotParams, SandboxClass

daytona = Daytona()

snapshot = daytona.snapshot.create(
    CreateSnapshotParams(
        name="my-vm-snapshot",
        image="ubuntu:22.04",
        sandbox_class=SandboxClass.LINUX_VM,
    )
)
import { Daytona, SandboxClass } from "@daytona/sdk";

const daytona = new Daytona();

const snapshot = await daytona.snapshot.create({
  name: "my-vm-snapshot",
  image: "ubuntu:22.04",
  sandboxClass: SandboxClass.LINUX_VM,
});
require 'daytona'

daytona = Daytona::Daytona.new

snapshot = daytona.snapshot.create(
  Daytona::CreateSnapshotParams.new(
    name: 'my-vm-snapshot',
    image: 'ubuntu:22.04',
    sandbox_class: DaytonaApiClient::SandboxClass::LINUX_VM
  )
)
package main

import (
  "context"
  "github.com/daytona/clients/sdk-go/pkg/daytona"
  "github.com/daytona/clients/sdk-go/pkg/types"
)

func main() {
  client, _ := daytona.NewClient()
  ctx := context.Background()
  sandboxClass := types.SandboxClassLinuxVM
  snapshot, logCh, _ := client.Snapshot.Create(ctx, &types.CreateSnapshotParams{
    Name:         "my-vm-snapshot",
    Image:        "ubuntu:22.04",
    SandboxClass: &sandboxClass,
  })
  for range logCh {
  }
  _ = snapshot
}
import io.daytona.sdk.Daytona;
import io.daytona.api.client.model.SandboxClass;
import io.daytona.sdk.model.Snapshot;

final class CreateVmSnapshot {
    public static void main(String[] args) {
        try (Daytona daytona = new Daytona()) {
            Snapshot snapshot = daytona.snapshot().create("my-vm-snapshot", "ubuntu:22.04", SandboxClass.LINUX_VM);
        }
    }
}
daytona snapshot create my-vm-snapshot --image ubuntu:22.04 --sandbox-class linux-vm
curl https://app.daytona.io/api/snapshots \ 
  --request POST \ 
  --header 'Content-Type: application/json' \ 
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \ 
  --data '{
    "name": "my-vm-snapshot",
    "imageName": "ubuntu:22.04",
    "sandboxClass": "linux-vm"
  }'

GPU snapshots

Create a GPU snapshot. GPU snapshots are used to create GPU sandboxes.

GPU snapshots on shared regions belong to the earth region. Daytona selects the shared region, ignores the requested regionId, and reports earth in the snapshot regionIds. GPU snapshots on dedicated and custom regions keep their real region ID.

  1. Go to Daytona Snapshots
  2. Click Create Snapshot
  3. Enter the snapshot name and image
  4. Select the Allocate GPU checkbox
  5. Specify the GPU type(s):
    • NVIDIA H100
    • NVIDIA H200
    • NVIDIA B200
    • NVIDIA B300
    • NVIDIA RTX PRO 6000
    • NVIDIA RTX 4090
    • NVIDIA RTX 5090
    • AMD Instinct MI355X
  6. Click Create

Code Examples

from daytona import CreateSnapshotParams, Daytona, Image, Resources

daytona = Daytona()

snapshot = daytona.snapshot.create(
    CreateSnapshotParams(
        name="my-gpu-snapshot",
        image=Image.base("python:3.12"),
        resources=Resources(cpu=1, memory=1, disk=1, gpu=1),
    )
)
import { Daytona } from "@daytona/sdk";

const daytona = new Daytona();

const snapshot = await daytona.snapshot.create({
  name: "my-gpu-snapshot",
  image: "python:3.12",
  resources: { cpu: 1, memory: 1, disk: 1, gpu: 1 },
});
require 'daytona'

daytona = Daytona::Daytona.new

snapshot = daytona.snapshot.create(
  Daytona::CreateSnapshotParams.new(
    name: 'my-gpu-snapshot',
    image: 'python:3.12',
    resources: Daytona::Resources.new(cpu: 1, memory: 1, disk: 1, gpu: 1)
  )
)
package main

import (
  "context"
  "github.com/daytona/clients/sdk-go/pkg/daytona"
  "github.com/daytona/clients/sdk-go/pkg/types"
)

func main() {
  client, _ := daytona.NewClient()
  ctx := context.Background()
  snapshot, logCh, _ := client.Snapshot.Create(ctx, &types.CreateSnapshotParams{
    Name:  "my-gpu-snapshot",
    Image: "python:3.12",
    Resources: &types.Resources{
      CPU: 1,
      Memory: 1,
      Disk: 1,
      GPU: 1,
    },
  })
  for range logCh {
  }
  _ = snapshot
}
import io.daytona.sdk.Daytona;
import io.daytona.sdk.Image;
import io.daytona.sdk.model.Resources;
import io.daytona.sdk.model.Snapshot;

final class CreateGpuSnapshot {
    public static void main(String[] args) {
        try (Daytona daytona = new Daytona()) {
            Resources resources = new Resources();
            resources.setCpu(1);
            resources.setMemory(1);
            resources.setDisk(1);
            resources.setGpu(1);
            Snapshot snapshot = daytona.snapshot().create(
                "my-gpu-snapshot",
                Image.base("python:3.12"),
                resources,
                null
            );
        }
    }
}
curl https://app.daytona.io/api/snapshots \ 
  --request POST \ 
  --header 'Content-Type: application/json' \ 
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \ 
  --data '{
    "name": "my-gpu-snapshot",
    "imageName": "python:3.12",
    "cpu": 1,
    "memory": 1,
    "disk": 1,
    "gpu": 1
  }'

Create snapshot from sandbox

Create a snapshot from a running or stopped sandbox.

Code Examples

sandbox.create_snapshot("my-snapshot")
await sandbox.createSnapshot('my-snapshot')
sandbox.create_snapshot(name: 'my-snapshot')
err := sandbox.CreateSnapshot(ctx, "my-snapshot")
if err != nil {
    return err
}
curl 'https://app.daytona.io/api/sandbox/{sandboxIdOrName}/snapshot' \ 
  --request POST \ 
  --header 'X-Daytona-Organization-ID: YOUR_ORGANIZATION_ID' \ 
  --header 'Content-Type: application/json' \ 
  --header 'Authorization: Bearer YOUR_API_KEY' \ 
  --data '{
  "name": "my-snapshot",
  "includeMemory": false
}'

Snapshots from private registries

Create a snapshot from images from private container registries.

  1. Go to Daytona Registries
  2. Click Add Registry and select your provider:
  3. Enter the required fields
  4. Go to Daytona Snapshots
  5. Click Create Snapshot
  6. Enter the snapshot name and the full image reference, including the registry host and repository (e.g. my-registry.com/<repo>/custom-alpine:3.21)

Docker Hub

Create a snapshot from Docker Hub images.

  1. Go to Daytona Registries
  2. Click Add Registry and select the Docker Hub tab
  3. Input the following fields:
    • Username: your Docker Hub username (the account with access to the image)
    • Personal Access Token: a Docker Hub PAT; not your account password
    • Registry URL: auto-filled with docker.io and not shown in the form
  4. Create the snapshot using the full image reference

docker.io/<username>/<image>:<tag>

Google Artifact Registry

Create a snapshot from images from Google Artifact Registry.

  1. Go to Daytona Registries,
  2. Click Add Registry and select the Google tab
  3. Input the following fields:
    • Registry URL: the base URL for your region https://<region>-docker.pkg.dev
    • Service Account JSON Key: the contents of your service account key JSON file
    • Google Cloud Project ID: your GCP project ID
    • Username: auto-filled with _json_key (required by Google for service-account auth)
  4. Create the snapshot using the full image reference

<region>-docker.pkg.dev/<project>/<repo>/<image>:<tag>

GitHub Container Registry

Create a snapshot from images from GitHub Container Registry.

  1. Go to Daytona Registries,
  2. Click Add Registry and select the GitHub tab
  3. Input the following fields:
    • GitHub Username: the account with access to the image
    • Personal Access Token: a GitHub PAT with read:packages scope (and write:packages / delete:packages for pushing or deleting)
    • Registry URL: auto-filled with ghcr.io and not shown in the form
  4. Create the snapshot using the full image reference

ghcr.io/<owner>/<image>:<tag>

Amazon ECR

Create a snapshot from images from Amazon Elastic Container Registry.

Daytona pulls private ECR images via cross-account IAM role assumption. You create a role in your AWS account that trusts Daytona’s broker principal, and Daytona assumes it on every pull to fetch a short-lived ECR token.

Creating an IAM role

  1. Create an IAM role in your AWS account

    • Trust policy
    {
      "Version": "2012-10-17",
      "Statement": [ {
        "Effect": "Allow",
        "Principal": { "AWS": "arn:aws:iam::967657494466:role/DaytonaEcrCredentialBroker" },
        "Action": "sts:AssumeRole",
        "Condition": {
          "StringEquals": {
            "sts:ExternalId": "<YOUR_EXTERNAL_ID>"
          }
        }
      } ]
    }
    
    • Permissions policy (read-only on ECR)
    {
      "Version": "2012-10-17",
      "Statement": [{
        "Effect": "Allow",
        "Action": [
          "ecr:GetAuthorizationToken",
          "ecr:BatchCheckLayerAvailability",
          "ecr:GetDownloadUrlForLayer",
          "ecr:BatchGetImage"
        ],
        "Resource": "*"
      }]
    }
    
  2. Go to Daytona Registries

  3. Click Add Registry and select the Amazon ECR tab

  4. Input the following fields:

    • Registry URL: <account_id>.dkr.ecr.<region>.amazonaws.com
    • Role ARN: the role you created in step 1

Password is not used for ECR. Daytona resolves credentials server-side by assuming the role you created in step 1, using your organization ID as the AssumeRole ExternalId.

  1. Go to Daytona Snapshots
  2. Click Create Snapshot
  3. Enter the snapshot name and the full image reference

<account_id>.dkr.ecr.<region>.amazonaws.com/<repo>/<image>:<tag>

  1. (Optional) Harden the trust policy Daytona sends a daytona-<orgId>-pull session name on every AssumeRole call. You can require it in your trust policy for CloudTrail audit visibility. Add inside Condition:
    "StringLike": {
      "sts:RoleSessionName": "daytona-<YOUR_EXTERNAL_ID>-*"
    }
    

Snapshots from local images

Create a snapshot from local images or from local Dockerfiles.

Daytona expects the local image to be built for AMD64 architecture. Therefore, the --platform=linux/amd64 flag is required when building the Docker image if your machine is running on a different architecture.

  1. Ensure the image and tag you want to use is available
    
    

docker images


2. Create a snapshot and push it to Daytona:
```bash
daytona snapshot push custom-alpine:3.21 --name alpine-minimal

Alternatively, use the --dockerfile flag under create to pass the path to the Dockerfile you want to use and Daytona will build the snapshot for you. The COPY/ADD commands will be automatically parsed and added to the context. To manually add files to the context, use the --context flag.

daytona snapshot create my-awesome-snapshot --dockerfile ./Dockerfile

Get snapshot

Get a snapshot by name.

daytona.snapshot.get("my-awesome-snapshot")
await daytona.snapshot.get('my-awesome-snapshot')
daytona.snapshot.get('my-awesome-snapshot')
_, err := client.Snapshot.Get(ctx, "my-awesome-snapshot")
daytona.snapshot().get("my-awesome-snapshot");
curl https://app.daytona.io/api/snapshots/my-awesome-snapshot \ 
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'

List snapshots

List snapshots and view their details.

daytona.snapshot.list(page=2, limit=10)
await daytona.snapshot.list(2, 10)
daytona.snapshot.list(page: 2, limit: 10)
page, limit := 2, 10
_, err := client.Snapshot.List(ctx, &page, &limit)
daytona.snapshot().list(2, 10);
curl 'https://app.daytona.io/api/snapshots?page=2&limit=10' \ 
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'

Activate snapshots

Activate an inactive snapshot.

Snapshots automatically become inactive after 2 weeks of not being used.

  1. Go to Daytona Snapshots
  2. Click the three dots at the end of the row for the snapshot you want to activate
  3. Click Activate
daytona.snapshot.activate("my-awesome-snapshot")
await daytona.snapshot.activate("my-awesome-snapshot")
daytona.snapshot.activate('my-awesome-snapshot')
curl https://app.daytona.io/api/snapshots/my-inactive-snapshot/activate \ 
  --request POST \ 
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'

Deactivate snapshots

Deactivate a snapshot.

Deactivated snapshots are not available for new sandboxes. Deactivating a snapshot also pauses top-ups of its warm pools; the pool reports the reason in its errorReason field.

  1. Go to Daytona Snapshots
  2. Click the three dots at the end of the row for the snapshot you want to deactivate
  3. Click Deactivate

Delete snapshots

Delete a snapshot.

Deleted snapshots cannot be recovered. Deleting a snapshot also deletes its warm pools and destroys their unclaimed warm sandboxes.

  1. Go to Daytona Snapshots
  2. Click the three dots at the end of the row for the snapshot you want to delete
  3. Click Delete
daytona.snapshot.delete(daytona.snapshot.get("my-awesome-snapshot"))
await daytona.snapshot.delete(await daytona.snapshot.get("my-awesome-snapshot"))
daytona.snapshot.delete(daytona.snapshot.get('my-awesome-snapshot'))
snapshot, err := client.Snapshot.Get(ctx, "my-awesome-snapshot")

err = client.Snapshot.Delete(ctx, snapshot)
daytona.snapshot().delete(daytona.snapshot().get("my-awesome-snapshot").getId());
daytona snapshot delete my-awesome-snapshot
curl https://app.daytona.io/api/snapshots/my-awesome-snapshot \ 
  --request DELETE \ 
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'

Snapshot lifecycle

A snapshot can have several different states. Each state reflects the snapshot’s current status.

State Description
Pending The snapshot creation has been requested.
Building The snapshot is being built.
Pulling The snapshot image is being pulled from a registry.
Snapshotting The snapshot is being created from a sandbox.
Active The snapshot is ready to use for creating sandboxes.
Inactive The snapshot is deactivated; must be explicitly activated before use.
Error The snapshot creation failed.
Build Failed The snapshot build process failed.
Removing The snapshot is being deleted.

State transitions

A snapshot can transition between states in response to various actions. The following table lists the initial state, target state, and trigger for the transition.

Initial state Target state Trigger
Pending Building A declarative image build starts.
Pending Pulling The snapshot image pull starts.
Pending Error Snapshot processing fails.
Pending Removing A delete is requested.
Building Active The build finishes and the snapshot is ready.
Building Build Failed The image build is rejected.
Building Error The build fails or times out.
Building Removing A delete is requested.
Pulling Active The image pull finishes and the snapshot is ready.
Pulling Error The image pull fails or times out.
Pulling Removing A delete is requested.
Snapshotting Active The snapshot from a sandbox finishes and is ready.
Snapshotting Error The snapshot from a sandbox fails or times out.
Snapshotting Removing A delete is requested.
Active Inactive A deactivate is requested or the organization is suspended.
Active Removing A delete is requested.
Inactive Pending An activate is requested.
Inactive Removing A delete is requested.
Error Removing A delete is requested.
Build Failed Removing A delete is requested.