Skip to main content
This guide shows you how to start your first Sailbox, execute code inside it, and inspect the filesystem.

1. Create a Sail account

Sign up at the Sail dashboard and create an API key.

2. Set your environment variable

Set SAIL_API_KEY in your shell:
export SAIL_API_KEY=sk_...

3. Install the Sail SDK

Install the SDK in your project:
pip install "sail-sdk>=0.2.0"

4. Write code for starting a Sailbox

Create a file named quickstart.py:
import sail


app = sail.App.find(name="sailbox-quickstart", mint_if_missing=True)

sb = sail.Sailbox.create(
    app=app,
    image=sail.Image.debian_arm64,
    name="quickstart",
)

execution = sb.exec("python3 -c 'print(\"hello world\")'").wait()
print(execution.stdout)

files = sb.exec("ls -la /").wait()
print(files.stdout)

sb.terminate()
Sailbox.create() starts a persistent Linux VM. exec() runs a shell command inside it, and wait() returns stdout, stderr, and the process return code.

5. Run your first Sailbox

Run the script:
python quickstart.py
You should see hello world, followed by the contents of the Sailbox root directory.

Next steps

  • Build custom dependencies into the root filesystem with Images.
  • Learn runtime file transfer in Filesystem.
  • Expose HTTP, raw TCP, and SSH with Networking.
  • Checkpoint, fork, pause, and sleep VMs in Lifecycle.