Environment Configuration
Daytona supports multiple methods to configure your environment, in order of precedence:
Configuration in code
To configure your environment in code, use the DaytonaConfig class. The DaytonaConfig class accepts the following parameters:
api_key: Your Daytona API Keyapi_url: URL of your Daytona APItarget: Target region to create the Sandboxes on (us/eu)
- Python
- TypeScript
- Ruby
- Go
- API
For more information, see the Python SDK, TypeScript SDK, Ruby SDK, Go SDK, and API references:
Environment variables
Daytona supports environment variables for configuration. The SDK automatically looks for these environment variables:
| Variable | Description | Required |
|---|---|---|
DAYTONA_API_KEY | Your Daytona API key. | Yes |
DAYTONA_API_URL | URL of your Daytona API. | No |
DAYTONA_TARGET | Daytona Target to create the sandboxes on. | No |
Shell
Set environment variables in your shell using the following methods:
- Bash/Zsh
- Windows PowerShell
.env file
Set the environment variables in a .env file using the following format:
DAYTONA_API_KEY=YOUR_API_KEY
DAYTONA_API_URL=https://your_api_url
DAYTONA_TARGET=us
Default values
If no configuration is provided, Daytona will use its built-in default values:
| Option | Value |
|---|---|
| API URL | https://app.daytona.io/api |
| Target | Default region for the organization |