Welcome to Daytona
Relevant source files
The following files were used as context for generating this wiki page:
Daytona is an open-source, secure, and elastic infrastructure platform designed for running AI-generated code. It provides full, composable computers—referred to as sandboxes—that can be managed programmatically. The system is designed to provide lightning-fast infrastructure with sub-90ms sandbox creation, ensuring that AI-generated code can be executed in a separated and isolated runtime with zero risk to the underlying infrastructure.
Sources: README.md:1-4, README.md:47-51, libs/sdk-typescript/README.md:3-5
Core Features and Capabilities
Daytona offers several key features that enable professional development workflows for both human developers and AI agents:
| Feature | Description |
|---|---|
| Lightning-Fast Infra | Sandbox creation from code to execution in under 90ms. |
| Isolated Runtime | Secure execution environments that protect host infrastructure. |
| Programmatic Control | APIs for File systems, Git, LSP, and process execution. |
| OCI Compatibility | Support for any OCI/Docker image when creating sandboxes. |
| Persistence | Support for sandboxes that can live indefinitely. |
Sources: README.md:47-56
Sandbox Architecture
The sandbox is the fundamental unit of Daytona's infrastructure. It is a secure, isolated container environment where code is executed. Sandboxes can be customized with specific resources, initialized from snapshots, or set to be ephemeral.
Sandbox Lifecycle
The following diagram illustrates the typical lifecycle of a sandbox from creation to execution and eventual deletion.
Resource Management
Sandboxes can be configured with specific resource constraints, including CPU, memory, and disk space. Users can also define autoStopInterval settings to manage costs and resource usage effectively.
Sources: libs/sdk-typescript/README.md:52-61
Getting Started
To begin using Daytona, users typically follow a multi-step onboarding process through the dashboard or CLI.
Onboarding Flow
The onboarding process guides users through SDK installation, API key generation, and their first sandbox creation.
Installation
Daytona provides SDKs for multiple programming languages to ensure broad compatibility:
- Python:
pip install daytona - TypeScript:
npm install @daytonaio/sdk - Ruby:
gem install daytona - Go:
go get github.com/daytonaio/daytona/libs/sdk-go
Sources: README.md:27-44, libs/sdk-typescript/README.md:12-20, libs/sdk-ruby/README.md:7-19
Authentication
Authentication is handled via API keys generated in the Daytona Dashboard. These keys are used to initialize the Daytona client in various SDKs. Configuration can be passed through environment variables like DAYTONA_API_KEY and DAYTONA_API_URL or explicitly in code.
Sources: libs/sdk-typescript/README.md:22-42, libs/sdk-ruby/README.md:39-44
Developer Operations
Daytona provides comprehensive tools for interacting with the sandbox environment programmatically.
File and Git Operations
The SDKs provide interfaces for standard file system tasks (upload, download, search) and Git workflows (clone, branch management, adding files).
Sources: libs/sdk-typescript/README.md:88-109
Language Server Protocol (LSP)
For advanced IDE-like features, Daytona supports creating and starting LSP servers within the sandbox. This allows for:
- Code completions
- Document symbols retrieval
- Real-time file notifications (
didOpen)
Sources: libs/sdk-typescript/README.md:111-131
Deployment Options
While Daytona is available as a cloud service, it can also be deployed locally or in custom environments using Docker Compose.
Local Development Setup
The Docker Compose configuration includes several critical services:
- API: The main application server.
- Runner: The service hosting the Daytona Runner.
- SSH Gateway: Handles secure sandbox access.
- MinIO: Provides S3-compatible object storage.
- PostgreSQL/Redis: Data persistence and caching.
Sources: docker/README.md:7-27
Community and Contribution
Daytona is open-source and encourages community involvement. The project follows the Contributor Covenant Code of Conduct and requires contributors to sign off on commits to comply with the Developer's Certificate of Origin (DCO) v1.1.
Sources: CONTRIBUTING.md:1-20, CONTRIBUTING.md:65-71
Contribution Steps
- Fork the repository.
- Create a GitHub issue for the proposed change.
- Prepare changes (ideally one feature/change per PR).
- Sign-off commits using
git commit --signoff. - Ensure linting passes using
golangci-lint.
Sources: CONTRIBUTING.md:73-102
Daytona serves as a robust foundation for building AI agents and automated coding workflows by providing the necessary "hands" (file system, PTY, LSP) and "environment" (isolated sandboxes) for code execution and testing.