Quickstart
Start an isolated Linux sandbox and run a command in it, from the terminal and from code. It takes about 5 minutes.
Using an AI coding agent? Paste this into Claude Code, Cursor or another agent. It reads our docs and asks you before it runs anything.
I want to use Foundational Compute (https://fdtn.dev) to run code in cloud sandboxes. Read https://fdtn.dev/llms.txt first, and follow only what it says. Explain each command before you run it, and ask me before you install anything. I will sign in myself with fdtn auth. Never ask me to paste my API key into this chat.
1Create an API key
- Sign in at compute.fdtn.dev with Google or GitHub. The first sign-in creates your personal workspace.
- Open API keys and create a key. It starts with
fdtn_. - Copy it. The page shows it only once. Do not paste it into a chat or a project file.
A personal workspace starts with a $20 welcome credit, with no card. Credit
2Install the CLI
The fdtn command needs Node.js 22.19 or newer and npm (nodejs.org). Do not type the $.
$ curl -fsSL https://compute.fdtn.dev/install | sh$ curl -fsSL https://compute.fdtn.dev/install | sh# The install line needs sh. Run it in WSL: $ curl -fsSL https://compute.fdtn.dev/install | sh # Or skip the CLI and set the key for the SDKs (then open a new terminal): > setx FDTN_API_KEY fdtn_...
The script checks the sha256 checksum and installs with npm i -g. It does not touch your API key. Install errors
3Sign in and test
$ fdtn auth
Paste your API key from https://compute.fdtn.dev, then press Return:
Key saved. You are signed in.The key goes to ~/.fdtn/key, readable only by you. The CLI and SDKs read it there. On a server or in CI, set FDTN_API_KEY; it wins over the file. API keys
Test the setup. This starts a small sandbox, runs a command and stops it:
$ fdtn doctor --create
✓ api key: from key file, starts with fdtn_, 45 characters
✓ dns: api.sbx.fdtn.dev -> 203.0.113.10
✓ tls: certificate for api.sbx.fdtn.dev accepted
✓ key accepted: listed your sandboxes
✓ sandbox round trip: i... started in 111 ms, ran a command, stoppedA failed check starts with ✗ and has a fix: line under it. fdtn doctor results
4Start a sandbox
A sandbox is a separate Linux computer. A template is the system it starts from; base is the default.
$ fdtn create base
Starting a sandbox from template base...
Terminal connecting to template base with sandbox ID i...
user@fdtn:~$You get a terminal inside the sandbox. Type exit to leave; the sandbox then stops.
| Size | 2 vCPU, 512 MiB, 5 GiB disk: $0.039 an hour. Pricing |
|---|---|
| Installed | Debian 12, Python 3.11, pip, Node.js 20, git, curl |
| Lifetime | 5 minutes by default, up to 24 hours |
| Start | Under 500 ms |
| CPU | arm64 |
5Control it from your terminal
$ fdtn create base -d --name worker # start only, print the id $ fdtn exec @worker echo hello # run a command, get its output and exit code $ fdtn connect @worker # open a terminal inside $ fdtn cp -r @worker:/tmp ./out # download files $ fdtn ls # list your running sandboxes $ fdtn pause @worker # keep memory and files, stop the clock $ fdtn resume @worker # bring it back $ fdtn kill @worker # stop it for good
-dstarts without a terminal. The sandbox stops after 5 minutes, or after--timeout <seconds>.- Each command that uses the sandbox sets its time left to at least 5 minutes.
@namereplaces the ID. A new name can take a few seconds to resolve.
6Use it from code
Python needs 3.11 or newer; install into a virtual environment (python3 -m venv .venv && . .venv/bin/activate). TypeScript needs Node.js 22.19 or newer. The SDKs do not need the fdtn command: set FDTN_API_KEY.
- Install the SDK:
$ pip install https://compute.fdtn.dev/install/fdtn-0.1.5-py3-none-any.whl$ npm i https://compute.fdtn.dev/install/fdtn-sdk-0.1.5.tgz- Save this file and run
python hello.pyornode hello.mjs(the TypeScript SDK is ESM). It printshello.
from fdtn import Sandbox # timeout: how long the sandbox lives, in seconds. # request_timeout: how long the SDK waits for the start, in seconds. sbx = Sandbox.create("base", timeout=300, request_timeout=120) try: result = sbx.commands.run("echo hello") print(result.stdout) finally: sbx.kill()
import { Sandbox } from '@fdtn/sdk' // timeoutMs: how long the sandbox lives. requestTimeoutMs: how long the SDK waits for the start. const sbx = await Sandbox.create('base', { timeoutMs: 300_000, requestTimeoutMs: 120_000 }) try { const result = await sbx.commands.run('echo hello') console.log(result.stdout) } finally { await sbx.kill() }
The SDK waits 60 seconds for a start by default. A create can wait up to 30 minutes in the queue; for batches, set request_timeout=1800 or requestTimeoutMs: 1_800_000. The queue