Skip to content

Open Source Deployment

This guide will walk you through running Daytona Open Source locally using Docker Compose.

The compose file can be found in the docker folder of the Daytona repository.

Overview

The Docker Compose configuration includes all the necessary services to run Daytona:

  • API: Main Daytona application server
  • Proxy: Request proxy service
  • Runner: Service that hosts the Daytona Runner
  • SSH Gateway: Service that handles sandbox SSH access
  • Database: PostgreSQL database for data persistence
  • Redis: In-memory data store for caching and sessions
  • Dex: OIDC authentication provider
  • Registry: Docker image registry with web UI
  • MinIO: S3-compatible object storage
  • MailDev: Email testing service
  • Jaeger: Distributed tracing
  • PgAdmin: Database administration interface

Quick Start

  1. Clone the Daytona repository

  2. Install Docker and Docker Compose

  3. Run the following command (from the root of the Daytona repo) to start all services:

    Terminal window
    docker compose -f docker/docker-compose.yaml up -d
  4. Access the services:

DNS Setup for Proxy URLs

For local development, you need to resolve *.proxy.localhost domains to 127.0.0.1:

Terminal window
./scripts/setup-proxy-dns.sh

This configures dnsmasq with address=/proxy.localhost/127.0.0.1.

Without this setup, SDK examples and direct proxy access won’t work.

Development Notes

  • The setup uses shared networking for simplified service communication
  • Database and storage data is persisted in Docker volumes
  • The registry is configured to allow image deletion for testing
  • Sandbox resource limits are disabled due to inability to partition cgroups in DinD environment where the sock is not mounted

Additional Network Options

HTTP Proxy

To configurate an outbound HTTP proxy for the Daytona services, you can set the following environment variables in the docker-compose.yaml file for each service that requires proxy access (the API service is the only that requires outbound access to pull images):

  • HTTP_PROXY: URL of the HTTP proxy server
  • HTTPS_PROXY: URL of the HTTPS proxy server
  • NO_PROXY: Comma-separated list of hostnames or IP addresses that should bypass the proxy

The baseline configuration for the API service should be as follows:

environment:
- HTTP_PROXY=<your-proxy>
- HTTPS_PROXY=<your-proxy>
- NO_PROXY=localhost,runner,dex,registry,minio,jaeger,otel-collector,<your-proxy>

Extra CA Certificates

To configure extra CA certificates (for example, paired with DB_TLS env vars), set the following environment variable in the API service:

environment:
- NODE_EXTRA_CA_CERTS=/path/to/your/cert-bundle.pembundle

The provided file is a cert bundle. Meaning it can contain multiple CA certificates in PEM format.

Environment Variables

You can customize the deployment by modifying environment variables in the docker-compose.yaml file. Below is a full list of environment variables with their default values:

API Service

VariableTypeDefault ValueDescription
PORTnumber3000API service port
DB_HOSTstringdbPostgreSQL database hostname
DB_PORTnumber5432PostgreSQL database port
DB_USERNAMEstringuserPostgreSQL database username
DB_PASSWORDstringpassPostgreSQL database password
DB_DATABASEstringdaytonaPostgreSQL database name
DB_TLS_ENABLEDbooleanfalseEnable TLS for database connection
DB_TLS_REJECT_UNAUTHORIZEDbooleantrueReject unauthorized TLS certificates
REDIS_HOSTstringredisRedis server hostname
REDIS_PORTnumber6379Redis server port
OIDC_CLIENT_IDstringdaytonaOIDC client identifier
OIDC_ISSUER_BASE_URLstringhttp://dex:5556/dexOIDC issuer base URL
PUBLIC_OIDC_DOMAINstringhttp://localhost:5556/dexPublic OIDC domain
OIDC_AUDIENCEstringdaytonaOIDC audience identifier
OIDC_MANAGEMENT_API_ENABLEDboolean(empty)Enable OIDC management API
OIDC_MANAGEMENT_API_CLIENT_IDstring(empty)OIDC management API client ID
OIDC_MANAGEMENT_API_CLIENT_SECRETstring(empty)OIDC management API client secret
OIDC_MANAGEMENT_API_AUDIENCEstring(empty)OIDC management API audience
DEFAULT_SNAPSHOTstringdaytonaio/sandbox:0.4.3Default sandbox snapshot image
DASHBOARD_URLstringhttp://localhost:3000/dashboardDashboard URL
DASHBOARD_BASE_API_URLstringhttp://localhost:3000Dashboard base API URL
POSTHOG_API_KEYstringphc_bYtEsdMDrNLydXPD4tufkBrHKgfO2zbycM30LOowYNvPostHog API key for analytics
POSTHOG_HOSTstringhttps://d18ag4dodbta3l.cloudfront.netPostHog host URL
POSTHOG_ENVIRONMENTstringlocalPostHog environment identifier
TRANSIENT_REGISTRY_URLstringhttp://registry:6000Transient registry URL
TRANSIENT_REGISTRY_ADMINstringadminTransient registry admin username
TRANSIENT_REGISTRY_PASSWORDstringpasswordTransient registry admin password
TRANSIENT_REGISTRY_PROJECT_IDstringdaytonaTransient registry project ID
INTERNAL_REGISTRY_URLstringhttp://registry:6000Internal registry URL
INTERNAL_REGISTRY_ADMINstringadminInternal registry admin username
INTERNAL_REGISTRY_PASSWORDstringpasswordInternal registry admin password
INTERNAL_REGISTRY_PROJECT_IDstringdaytonaInternal registry project ID
SMTP_HOSTstringmaildevSMTP server hostname
SMTP_PORTnumber1025SMTP server port
SMTP_USERstring(empty)SMTP username
SMTP_PASSWORDstring(empty)SMTP password
SMTP_SECUREboolean(empty)Enable SMTP secure connection
SMTP_EMAIL_FROMstring"Daytona Team <no-reply@daytona.io>"SMTP sender email address
S3_ENDPOINTstringhttp://minio:9000S3-compatible storage endpoint
S3_STS_ENDPOINTstringhttp://minio:9000/minio/v1/assume-roleS3 STS endpoint
S3_REGIONstringus-east-1S3 region
S3_ACCESS_KEYstringminioadminS3 access key
S3_SECRET_KEYstringminioadminS3 secret key
S3_DEFAULT_BUCKETstringdaytonaS3 default bucket name
S3_ACCOUNT_IDstring/S3 account ID
S3_ROLE_NAMEstring/S3 role name
ENVIRONMENTstringdevApplication environment
MAX_AUTO_ARCHIVE_INTERVALnumber43200Maximum auto-archive interval (seconds)
OTEL_ENABLEDbooleantrueEnable OpenTelemetry tracing
OTEL_COLLECTOR_URLstringhttp://jaeger:4318/v1/tracesOpenTelemetry collector URL
MAINTENANCE_MODEbooleanfalseEnable maintenance mode
PROXY_DOMAINstringproxy.localhost:4000Proxy domain
PROXY_PROTOCOLstringhttpProxy protocol
PROXY_API_KEYstringsuper_secret_keyProxy API key
PROXY_TEMPLATE_URLstringhttp://{{PORT}}-{{sandboxId}}.proxy.localhost:4000Proxy template URL pattern
PROXY_TOOLBOX_BASE_URLstring{PROXY_PROTOCOL}://{PROXY_DOMAIN}Proxy base URL for toolbox requests
DEFAULT_RUNNER_DOMAINstringrunner:3003Default runner domain
DEFAULT_RUNNER_API_URLstringhttp://runner:3003Default runner API URL
DEFAULT_RUNNER_PROXY_URLstringhttp://runner:3003Default runner proxy URL
DEFAULT_RUNNER_API_KEYstringsecret_api_tokenDefault runner API key
DEFAULT_RUNNER_CPUnumber4Default runner CPU allocation
DEFAULT_RUNNER_MEMORYnumber8Default runner memory allocation (GB)
DEFAULT_RUNNER_DISKnumber50Default runner disk allocation (GB)
DEFAULT_RUNNER_GPUnumber0Default runner GPU allocation
DEFAULT_RUNNER_GPU_TYPEstringnoneDefault runner GPU type
DEFAULT_RUNNER_CAPACITYnumber100Default runner capacity
DEFAULT_RUNNER_REGIONstringusDefault runner region
DEFAULT_RUNNER_CLASSstringsmallDefault runner class
DEFAULT_ORG_QUOTA_TOTAL_CPU_QUOTAnumber10000Default organization total CPU quota
DEFAULT_ORG_QUOTA_TOTAL_MEMORY_QUOTAnumber10000Default organization total memory quota
DEFAULT_ORG_QUOTA_TOTAL_DISK_QUOTAnumber100000Default organization total disk quota
DEFAULT_ORG_QUOTA_MAX_CPU_PER_SANDBOXnumber100Default organization max CPU per sandbox
DEFAULT_ORG_QUOTA_MAX_MEMORY_PER_SANDBOXnumber100Default organization max memory per sandbox
DEFAULT_ORG_QUOTA_MAX_DISK_PER_SANDBOXnumber1000Default organization max disk per sandbox
DEFAULT_ORG_QUOTA_SNAPSHOT_QUOTAnumber1000Default organization snapshot quota
DEFAULT_ORG_QUOTA_MAX_SNAPSHOT_SIZEnumber1000Default organization max snapshot size
DEFAULT_ORG_QUOTA_VOLUME_QUOTAnumber10000Default organization volume quota
SSH_GATEWAY_API_KEYstringssh_secret_api_tokenSSH gateway API key
SSH_GATEWAY_COMMANDstringssh -p 2222 {{TOKEN}}@localhostSSH gateway command template
RUNNER_DECLARATIVE_BUILD_SCORE_THRESHOLDnumber10Runner declarative build score threshold
RUNNER_AVAILABILITY_SCORE_THRESHOLDnumber10Runner availability score threshold
RUN_MIGRATIONSbooleantrueEnable database migrations on startup
ADMIN_API_KEYstring(empty)Admin API key, auto-generated if empty, used only upon initial setup, not recommended for production
ADMIN_TOTAL_CPU_QUOTAnumber0Admin total CPU quota, used only upon initial setup
ADMIN_TOTAL_MEMORY_QUOTAnumber0Admin total memory quota, used only upon initial setup
ADMIN_TOTAL_DISK_QUOTAnumber0Admin total disk quota, used only upon initial setup
ADMIN_MAX_CPU_PER_SANDBOXnumber0Admin max CPU per sandbox, used only upon initial setup
ADMIN_MAX_MEMORY_PER_SANDBOXnumber0Admin max memory per sandbox, used only upon initial setup
ADMIN_MAX_DISK_PER_SANDBOXnumber0Admin max disk per sandbox, used only upon initial setup
ADMIN_SNAPSHOT_QUOTAnumber100Admin snapshot quota, used only upon initial setup
ADMIN_MAX_SNAPSHOT_SIZEnumber100Admin max snapshot size, used only upon initial setup
ADMIN_VOLUME_QUOTAnumber0Admin volume quota, used only upon initial setup

Runner

VariableTypeDefault ValueDescription
VERSIONstring0.0.1Runner service version
ENVIRONMENTstringdevelopmentApplication environment
API_PORTnumber3003Runner API service port
API_TOKENstringsecret_api_tokenRunner API authentication token
LOG_FILE_PATHstring/home/daytona/runner/runner.logPath to runner log file
RESOURCE_LIMITS_DISABLEDbooleantrueDisable resource limits for sandboxes
AWS_ENDPOINT_URLstringhttp://minio:9000AWS S3-compatible storage endpoint
AWS_REGIONstringus-east-1AWS region
AWS_ACCESS_KEY_IDstringminioadminAWS access key ID
AWS_SECRET_ACCESS_KEYstringminioadminAWS secret access key
AWS_DEFAULT_BUCKETstringdaytonaAWS default bucket name
SERVER_URLstringhttp://api:3000/apiDaytona API server URL

SSH Gateway

VariableTypeDefault ValueDescription
API_URLstringhttp://api:3000/apiDaytona API URL
API_KEYstringssh_secret_api_tokenAPI authentication key
SSH_PRIVATE_KEYstring(Base64-encoded OpenSSH private key)SSH private key for auth
SSH_HOST_KEYstring(Base64-encoded OpenSSH host key)SSH host key for server
SSH_GATEWAY_PORTnumber2222SSH gateway listening port

Proxy

VariableTypeDefault ValueDescription
DAYTONA_API_URLstringhttp://api:3000/apiDaytona API URL
PROXY_PORTnumber4000Proxy service port
PROXY_DOMAINstringproxy.localhost:4000Proxy domain
PROXY_API_KEYstringsuper_secret_keyProxy API authentication key
PROXY_PROTOCOLstringhttpProxy protocol (http or https)
OIDC_CLIENT_IDstringdaytonaOIDC client identifier
OIDC_CLIENT_SECRETstring(empty)OIDC client secret
OIDC_DOMAINstringhttp://dex:5556/dexOIDC domain
OIDC_PUBLIC_DOMAINstringhttp://localhost:5556/dexOIDC public domain
OIDC_AUDIENCEstringdaytonaOIDC audience identifier
REDIS_HOSTstringredisRedis server hostname
REDIS_PORTnumber6379Redis server port
TOOLBOX_ONLY_MODEbooleanfalseAllow only toolbox requests

[OPTIONAL] Configure Auth0 for Authentication

The default compose setup uses a local Dex OIDC provider for authentication. However, you can configure Auth0 as an alternative OIDC provider by following these steps:

Step 1: Create Your Auth0 Tenant

Begin by navigating to https://auth0.com/signup and start the signup process. Choose your account type based on your use case - select Company for business applications or Personal for individual projects.
On the “Let’s get setup” page, you’ll need to enter your application name such as My Daytona and select Single Page Application (SPA) as the application type. For authentication methods, you can start with Email and Password since additional social providers like Google, GitHub, or Facebook can be added later. Once you’ve configured these settings, click Create Application in the bottom right corner.

Step 2: Configure Your Single Page Application

Navigate to Applications > Applications in the left sidebar and select the application you just created. Click the Settings tab and scroll down to find the Application URIs section where you’ll configure the callback and origin URLs. In the Allowed Callback URIs field, add the following URLs:

http://localhost:3000
http://localhost:3000/api/oauth2-redirect.html
http://localhost:4000/callback
http://proxy.localhost:4000/callback

For Allowed Logout URIs, add:

http://localhost:3000

And for Allowed Web Origins, add:

http://localhost:3000

Remember to click Save Changes at the bottom of the page to apply these configurations.

Step 3: Create Machine-to-Machine Application

You’ll need a Machine-to-Machine application to interact with Auth0’s Management API. Go to Applications > Applications and click Create Application. Choose Machine to Machine Applications as the type and provide a descriptive name like My Management API M2M. After creating the application, navigate to the APIs tab within your new M2M application. Find and authorize the Auth0 Management API by clicking the toggle or authorize button.
Once authorized, click the dropdown arrow next to the Management API to configure permissions. Grant the following permissions to your M2M application:

read:users
update:users
read:connections
create:guardian_enrollment_tickets
read:connections_options

Click Save to apply these permission changes.

Step 4: Set Up Custom API

Your Daytona application will need a custom API to handle authentication and authorization. Navigate to Applications > APIs in the left sidebar and click Create API. Enter a descriptive name such as My Daytona API and provide an identifier like my-daytona-api. The identifier should be a unique string that will be used in your application configuration.
After creating the API, go to the Permissions tab to define the scopes your application will use. Add each of the following permissions with their corresponding descriptions:

PermissionDescription
read:nodeGet workspace node info
create:nodeCreate new workspace node record
create:userCreate user account
read:usersGet all user accounts
regenerate-key-pair:usersRegenerate user SSH key-pair
read:workspacesRead workspaces (user scope)
create:registryCreate a new docker registry auth record
read:registriesGet all docker registry records
read:registryGet docker registry record
write:registryCreate or update docker registry record

Step 5: Configure Environment Variables

Once you’ve completed all the Auth0 setup steps, you’ll need to configure environment variables in your Daytona deployment. These variables connect your application to the Auth0 services you’ve just configured.

Finding Your Configuration Values

You can find the necessary values in the Auth0 dashboard. For your SPA application settings, go to Applications > Applications, select your SPA app, and click the Settings tab. For your M2M application, follow the same path but select your Machine-to-Machine app instead. Custom API settings are located under Applications > APIs, then select your custom API and go to Settings.

API Service Configuration

Configure the following environment variables for your API service:

Terminal window
OIDC_CLIENT_ID=your_spa_app_client_id
OIDC_ISSUER_BASE_URL=your_spa_app_domain
OIDC_AUDIENCE=your_custom_api_identifier
OIDC_MANAGEMENT_API_ENABLED=true
OIDC_MANAGEMENT_API_CLIENT_ID=your_m2m_app_client_id
OIDC_MANAGEMENT_API_CLIENT_SECRET=your_m2m_app_client_secret
OIDC_MANAGEMENT_API_AUDIENCE=your_auth0_managment_api_identifier

Proxy Service Configuration

For your proxy service, configure these environment variables:

Terminal window
OIDC_CLIENT_ID=your_spa_app_client_id
OIDC_CLIENT_SECRET=
OIDC_DOMAIN=your_spa_app_domain
OIDC_AUDIENCE=your_custom_api_identifier (with trailing slash)

Note that OIDC_CLIENT_SECRET should remain empty for your proxy environment.