Termbridge
Sandboxes

Daytona

Daytona lets Termbridge run your terminal and preview in a cloud sandbox. Use this when you want a reproducible environment, a cloud preview, or to keep your laptop idle.

Requirements

  • A Daytona API key
  • A repository URL the sandbox can clone
  • Git credentials if the repo is private

Quick start

Set the backend to Daytona and provide the repo configuration:

export TERMBRIDGE_BACKEND=sandbox-daytona
export TERMBRIDGE_DAYTONA_API_KEY=your_key
export TERMBRIDGE_DAYTONA_API_URL=https://app.daytona.io/api
export TERMBRIDGE_SANDBOX_REPO=https://github.com/inline0/termbridge-test-app.git
export TERMBRIDGE_SANDBOX_BRANCH=main
export TERMBRIDGE_SANDBOX_PATH=termbridge-test-app
export TERMBRIDGE_SANDBOX_NAME=termbridge-sandbox
export TERMBRIDGE_SANDBOX_PUBLIC=true
export TERMBRIDGE_SANDBOX_PREVIEW_PORT=5173
export TERMBRIDGE_SANDBOX_DELETE_ON_EXIT=true

Then run Termbridge as usual:

npx termbridge

Direct sandbox mode (no tunnel)

Direct mode runs the Termbridge server inside the sandbox and skips Cloudflare entirely. The share URL is the Daytona preview link to the sandboxed server.

export TERMBRIDGE_BACKEND=sandbox-daytona
export TERMBRIDGE_SANDBOX_DIRECT=true
export TERMBRIDGE_SANDBOX_SERVER_PORT=8080

You can still enable preview by setting TERMBRIDGE_SANDBOX_PREVIEW_PORT; in direct mode it is forwarded as the server --proxy port.

Repository cloning

Termbridge will create a sandbox and clone your repo into the sandbox working directory.

Use these settings:

VariablePurpose
TERMBRIDGE_SANDBOX_REPORepo URL to clone (required)
TERMBRIDGE_SANDBOX_BRANCHBranch to check out (optional)
TERMBRIDGE_SANDBOX_PATHPath for the repo in the sandbox (optional)
TERMBRIDGE_SANDBOX_NAMESandbox name (optional)

If TERMBRIDGE_SANDBOX_PATH is not set, Termbridge derives it from the repo name.

Private repositories

Provide git credentials when cloning private repos:

export TERMBRIDGE_SANDBOX_GIT_USERNAME=your_github_username
export TERMBRIDGE_SANDBOX_GIT_TOKEN=your_github_token

TERMBRIDGE_SANDBOX_GIT_PASSWORD is also supported and overrides the token if set.

Coding agents

Termbridge can install coding agents inside the sandbox and sync your local auth so they are ready immediately.

See the Coding agents guide for the full setup, automatic mode, and security details.

Preview mode

To show the preview view, set TERMBRIDGE_SANDBOX_PREVIEW_PORT to the port your dev server uses inside the sandbox.

For Vite, make sure you bind to all interfaces:

npm run dev -- --host 0.0.0.0 --port 5173

Termbridge fetches the Daytona preview link and proxies it through the Termbridge server so the preview loads inside the UI.

Public vs private sandboxes

VariableWhat it does
TERMBRIDGE_SANDBOX_PUBLIC=trueCreates a public sandbox
TERMBRIDGE_SANDBOX_PUBLIC=falseCreates a private sandbox

For private sandboxes, Termbridge forwards the preview token automatically when proxying the preview.

Cleanup and lifecycle

To delete sandboxes when Termbridge exits:

export TERMBRIDGE_SANDBOX_DELETE_ON_EXIT=true

For short-lived or test sandboxes, use a prefix:

export TERMBRIDGE_SANDBOX_NAME=termbridge-test-$(date +%s)
export TERMBRIDGE_SANDBOX_DELETE_ON_EXIT=true

This keeps sandbox usage under control and avoids disk quota issues.

CLI flags

You can also configure Daytona via flags:

FlagPurpose
--backend sandbox-daytonaUse the Daytona backend
--sandbox-daytona-repo <url>Repo URL
--sandbox-daytona-branch <branch>Branch
--sandbox-daytona-path <path>Repo path in sandbox
--sandbox-daytona-name <name>Sandbox name
--sandbox-daytona-preview-port <port>Preview port
--sandbox-daytona-publicCreate a public sandbox
--sandbox-daytona-directRun the server inside the sandbox (no tunnel)

Troubleshooting

Preview view is blank

  • Ensure the dev server is running inside the sandbox.
  • Use --host 0.0.0.0 so the preview port is reachable.
  • Confirm TERMBRIDGE_SANDBOX_PREVIEW_PORT matches the dev server port.

Sandbox creation fails with quota errors

  • Delete old sandboxes in the Daytona dashboard.
  • Use TERMBRIDGE_SANDBOX_DELETE_ON_EXIT=true for short-lived sessions.

Repo clone fails

  • Double-check repo URL, branch, and credentials.
  • Ensure the Git token has repo read access.

On this page