Migrate from Daytona

Move a Daytona sandbox integration to Sandal: call-by-call mapping (TypeScript), a before/after, and what Sandal does not have yet.


Daytona sandboxes and Sandal sandboxes have the same lifecycle (create, run, stop/start, archive, delete), so the move is mostly renaming. Sandal runs each sandbox as a microVM with its own kernel.

1. Install and sign in#

Follow the quickstart steps 1 and 2: install the CLI and SDK, then sandal login. The SDKs read that profile; in CI set SANDAL_API_KEY (the key alone is enough; organization and project ids are optional overrides).

2. API mapping#

DaytonaSandal
new Daytona()new Sandal()
daytona.create() / create({ snapshot })sandal.createSandbox() / createSandbox({ template })
daytona.get(id)sandal.sandbox(id)
sandbox.process.executeCommand(cmd)sb.exec(cmd) (exitCode, stdout, stderr)
sandbox.process.codeRun(code)sb.writeText(path, code) + sb.exec("python3 " + path)
sessions / async commandssb.startCommand(cmd); CLI sandal exec --detach + `exec logs
sandbox.fs.uploadFile(buf, path) / downloadFile(path)sb.writeBytes(path, data) / sb.readBytes(path); sb.push(dir) for a folder
sandbox.getPreviewLink(port)sb.expose(port) (needs your key) or sb.share(port) (link, no key)
sandbox.stop() / start() / archive()sb.stop() / sb.start() / sb.archive()
sandbox.delete()sb.delete()
sandbox.git.clone(url, path)environments with repositories (sandal env add-repo) or sandal git clone

3. Before and after#

Before

import { Daytona } from "@daytonaio/sdk";

const daytona = new Daytona();
const sandbox = await daytona.create();
try {
  await sandbox.fs.uploadFile(Buffer.from("print(6 * 7)"), "main.py");
  const r = await sandbox.process.executeCommand("python3 main.py");
  console.log(r.exitCode, r.result);
  await sandbox.process.executeCommand("nohup python3 -m http.server 8000 &");
  console.log((await sandbox.getPreviewLink(8000)).url);
} finally {
  await sandbox.delete();
}

After

import { Sandal } from "@sandal-dev/sdk";

const sandal = new Sandal();
const sb = await sandal.createSandbox();
try {
  await sb.writeText("/workspace/main.py", "print(6 * 7)");
  const r = await sb.exec("python3 /workspace/main.py");
  console.log(r.exitCode, r.stdout);
  await sb.startCommand("python3 -m http.server 8000");
  console.log((await sb.share(8000)).url);
} finally {
  await sb.delete();
}

What Sandal does not have yet#

Said plainly, so you can plan around it (no dates promised):

  • Root in the guest. On the default template commands run as uid 2000 without sudo; exec as root (sandal exec --root, user: "root") is refused with 422 capability_unavailable. A root + FUSE template is in preview; no root-capable template is generally offered yet.
  • FUSE and S3 mounts. The default template has no /dev/fuse, so s3fs / mountpoint-s3 cannot run there, and there is no native bucket mount. Use persistent volumes or copy objects in and out, or ask for the root + FUSE preview template.
  • Memory snapshots. Not offered: pause/resume keeps memory on the same sandbox only; snapshots and forks are disk-only.
  • Region choice. Sandal runs in the EU only (Germany, Finland, Luxembourg).
  • Outbound IPv6. IPv4 only today.
  • Volume snapshots and OpenTelemetry export are not offered yet.