Snapshots
Persistent captures of sandbox state you can use to create sandboxes.
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:
- Create snapshots from an image: define the base operating system, language runtimes, packages, and project-level setup in an image or Dockerfile, and Daytona builds it into a snapshot you can use to create sandboxes
- Create snapshots from a sandbox: captures and persists a sandbox's current state; container sandboxes capture filesystem state only (cold snapshots), VM sandboxes capture filesystem and memory state (hot snapshots)
- Warm pools: keep a configured number of pre-created, running sandboxes built from a snapshot; matching sandbox create requests claim one warm sandbox from the pool instantly instead of provisioning a new sandbox
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 |
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 |
| Package | Version |
|---|---|
@anthropic-ai/claude-code | v2.1.220 |
@openai/codex | v0.146.0 |
bun | v1.3.6 |
openclaw | v2026.7.1-2 |
opencode-ai | v1.18.14 |
ts-node | v10.9.2 |
typescript | v5.9.3 |
typescript-language-server | v5.1.3 |
- Go to Daytona Sandboxes ↗
- Click Create Sandbox
- Select a
snapshot - Click Create
from daytona import Daytona, CreateSandboxFromSnapshotParams
daytona = Daytona()
sandbox = daytona.create(
CreateSandboxFromSnapshotParams(
snapshot="daytona-small",
)
)Create snapshots
Create a snapshot.
- Go to Daytona Snapshots ↗
- Click Create Snapshot
- Enter the snapshot
nameandimageof 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); thelatest/lts/stabletags are not supported
- Click Create
from daytona import Daytona, CreateSnapshotParams
daytona = Daytona()
snapshot = daytona.snapshot.create(
CreateSnapshotParams(name="my-awesome-snapshot", image="ubuntu:22.04"),
)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.
Create a Linux VM snapshot.
- Create a snapshot from a base
image - Set the snapshot's sandbox class to
LINUX_VM
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,
)
)GPU snapshots
Create a GPU snapshot. GPU snapshots are used to create GPU sandboxes.
-
Go to Daytona Snapshots ↗
-
Click Create Snapshot
-
Enter the snapshot
nameandimage -
Select the
Allocate GPUcheckbox -
Specify the
GPU type(s):NVIDIA H100NVIDIA H200NVIDIA RTX PRO 6000NVIDIA RTX 4090NVIDIA RTX 5090
-
Click Create
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),
),
)Create snapshot from sandbox
Create a snapshot from a running or stopped sandbox.
Container sandboxes capture filesystem state only (cold snapshot):
| Snapshot type | Include memory | Snapshot contents | Required sandbox state |
|---|---|---|---|
| Cold | false (default) | Filesystem only | Stopped |
sandbox._experimental_create_snapshot("my-snapshot")Snapshots from private registries
Create a snapshot from images from private container registries.
-
Go to Daytona Registries ↗
-
Click Add Registry and select your provider:
-
Enter the required fields
-
Go to Daytona Snapshots ↗
-
Click Create Snapshot
-
Enter the snapshot
nameand the fullimagereference, 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.
-
Go to Daytona Registries ↗
-
Click Add Registry and select the Docker Hub tab
-
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.ioand not shown in the form
-
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.
-
Go to Daytona Registries ↗,
-
Click Add Registry and select the Google tab
-
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)
-
-
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.
-
Go to Daytona Registries ↗,
-
Click Add Registry and select the GitHub tab
-
Input the following fields:
- GitHub Username: the account with access to the image
- Personal Access Token: a GitHub PAT with
read:packagesscope (andwrite:packages/delete:packagesfor pushing or deleting) - Registry URL: auto-filled with
ghcr.ioand not shown in the form
-
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.
-
Daytona Broker ARN
The IAM principal Daytona uses to assume into your role. Self-hosted: substitute the IAM role your API pods assume (e.g. via IRSA).
arn:aws:iam::967657494466:role/DaytonaEcrCredentialBroker -
External ID
Your Daytona organization ID, visible in the dashboard URL (
/dashboard/<orgId>/...) and on your organization settings page.
-
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": "*" }] } -
Go to Daytona Registries ↗
-
Click Add Registry and select the Amazon ECR tab
-
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. - Registry URL:
-
Go to Daytona Snapshots ↗
-
Click Create Snapshot
-
Enter the snapshot
nameand the fullimagereference<account_id>.dkr.ecr.<region>.amazonaws.com/<repo>/<image>:<tag> -
(Optional) Harden the trust policy
Daytona sends a
daytona-<orgId>-pullsession name on every AssumeRole call. You can require it in your trust policy for CloudTrail audit visibility. Add insideCondition:"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.
- Ensure the image and tag you want to use is available
docker images- Create a snapshot and push it to Daytona:
daytona snapshot push custom-alpine:3.21 --name alpine-minimalAlternatively, 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 ./DockerfileGet snapshot
Get a snapshot by name.
daytona.snapshot.get("my-awesome-snapshot")List snapshots
List snapshots and view their details.
daytona.snapshot.list(page=2, limit=10)Activate snapshots
Activate an inactive snapshot.
Snapshots automatically become inactive after 2 weeks of not being used.
- Go to Daytona Snapshots ↗
- Click the three dots at the end of the row for the snapshot you want to activate
- Click Activate
daytona.snapshot.activate("my-awesome-snapshot")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.
- Go to Daytona Snapshots ↗
- Click the three dots at the end of the row for the snapshot you want to deactivate
- 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.
- Go to Daytona Snapshots ↗
- Click the three dots at the end of the row for the snapshot you want to delete
- Click Delete
daytona.snapshot.delete(daytona.snapshot.get("my-awesome-snapshot"))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, the organization is suspended, or the deactivation timeout is exceeded. |
| 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. |
Run Docker in a sandbox
Sandboxes can run Docker containers inside them (Docker-in-Docker), enabling you to build, test, and deploy containerized applications.
Agents can interact with these services since they run within the same sandbox environment, providing better isolation and security compared to external service dependencies.
- Run databases (PostgreSQL, Redis, MySQL) and other services
- Build and test containerized applications
- Deploy microservices and their dependencies
- Create isolated development environments with full container orchestration
Create a Docker-in-Docker snapshot
Daytona provides an option to create a snapshot with Docker support using pre-built Docker-in-Docker images as a base or by manually installing Docker in a custom image.
Using pre-built images
The following base images are widely used for creating Docker-in-Docker snapshots or can be used as a base for a custom Dockerfile:
docker:28.3.3-dind: official Docker-in-Docker image (Alpine-based, lightweight)docker:28.3.3-dind-rootless: rootless Docker-in-Docker for enhanced securitydocker:28.3.2-dind-alpine3.22: Docker-in-Docker image with Alpine 3.22
Manual installation
Alternatively, install Docker manually in a custom Dockerfile:
FROM ubuntu:22.04
# Install Docker using the official install script
RUN curl -fsSL https://get.docker.com | VERSION=28.3.3 sh -Run Docker Compose in a sandbox
Define and run multi-container applications. With Docker-in-Docker enabled in a Daytona sandbox, you can use Docker Compose to orchestrate services like databases, caches, and application containers.
- Create a Docker-in-Docker snapshot with one of the pre-built images
- Run Docker Compose services inside a sandbox
from daytona import Daytona, CreateSandboxFromSnapshotParams
# Initialize the Daytona client
daytona = Daytona()
# Create a sandbox from a Docker-in-Docker snapshot
sandbox = daytona.create(CreateSandboxFromSnapshotParams(snapshot='docker-dind'))
# Create a docker-compose.yml file
compose_content = '''
services:
web:
image: nginx:alpine
ports:
- "8080:80"
'''
sandbox.fs.upload_file(compose_content.encode(), 'docker-compose.yml')
# Start Docker Compose services
result = sandbox.process.exec('docker compose -p demo up -d')
print(result.result)
# Check running services
result = sandbox.process.exec('docker compose -p demo ps')
print(result.result)
# Clean up
sandbox.process.exec('docker compose -p demo down')Run Kubernetes in a sandbox
Sandboxes can run a Kubernetes cluster inside the sandbox. Kubernetes runs entirely inside the sandbox and is removed when the sandbox is deleted, keeping environments secure and reproducible.
- Create a sandbox
- Install and start a k3s cluster inside the sandbox
from daytona import Daytona, SessionExecuteRequest
import time
# Initialize the Daytona client
daytona = Daytona()
# Create the sandbox instance
sandbox = daytona.create()
# Run the k3s installation script
response = sandbox.process.exec('curl -sfL https://get.k3s.io | sh -')
# Run k3s
session_name = 'k3s-server'
sandbox.process.create_session(session_name)
sandbox.process.execute_session_command(
session_name,
SessionExecuteRequest(
command='sudo /usr/local/bin/k3s server',
run_async=True,
),
)
# Give time to k3s to fully start
time.sleep(30)
# Get all pods
pods = sandbox.process.exec('sudo /usr/local/bin/kubectl get pod -A')
print(pods.result)