Skip to main content

Overview

Daytona provides flexible network configuration options including network isolation, allow lists, and port preview functionality for accessing services running in sandboxes.

Network Security

Block All Network Access

Prevent sandboxes from accessing external networks:

Network Allow List

Allow access to specific CIDR network ranges:

Default Network Behavior

By default, sandboxes have full network access:

Port Previews

Port previews allow you to access web services running inside sandboxes through secure URLs.

Get Preview URL

Public vs Private Previews

Control whether preview links are publicly accessible:

Set Sandbox Visibility

Change the public/private status after creation:

Network Configuration Examples

Isolated Development Environment

Create a completely isolated sandbox for secure code execution:

Internal API Access

Allow access only to internal services:

Web Application with Preview

Develop and preview a web application:

Advanced Port Management

Multiple Port Previews

Security Best Practices

  1. Use network isolation for untrusted code: Set networkBlockAll: true when running untrusted or user-submitted code.
  2. Restrict API access: Use networkAllowList to limit access to only required internal services.
  3. Private by default: Create sandboxes with public: false unless public access is required.
  4. Secure preview tokens: For private sandboxes, treat preview tokens as sensitive credentials.
  5. Monitor network usage: Use labels to track and organize sandboxes by network configuration.

Network Configuration Reference