Skip to content

Quickstart in 5 minutes

This page takes you from the source code to a forked sandbox. It is the short path. The tutorial gives each step in full.

  • A Linux machine with Docker, or a Mac with Docker or Podman.
  • Go 1.26 or later, to build boxfork.
  • Python 3.9 or later, for the last part.
  1. Get the source and build it:

    Terminal window
    git clone https://github.com/mvplab-ai/boxfork.git
    cd boxfork
    make build
  2. If you use Podman on a Mac, start the Podman machine and give its socket to the daemon:

    Terminal window
    podman machine start
    export DOCKER_HOST=unix://$(podman machine inspect --format '{{.ConnectionInfo.PodmanSocket.Path}}')
  3. Start the daemon, and keep its terminal open:

    Terminal window
    ./bin/boxfork serve

    On the first start, the daemon prints an API key one time. The CLI on the same machine finds the key itself.

Open a second terminal.

  1. Create a sandbox. The command prints its ID:

    Terminal window
    $ ./bin/boxfork create --image python:3.12
    sbx_uulezsidjhktd4lb

    The first create of an image pulls the image, so it is slower.

  2. Run a command in the sandbox:

    Terminal window
    $ ./bin/boxfork exec sbx_uulezsidjhktd4lb -- python3 -c 'print(6 * 7)'
    42
  3. Copy a file into the sandbox:

    Terminal window
    ./bin/boxfork cp ./data.csv sbx_uulezsidjhktd4lb:/work/data.csv

A sandbox has a timeout. When the timeout ends, the daemon kills the sandbox. --timeout 30m gives a longer life.

A fork makes new sandboxes with the same files. This command makes three copies:

Terminal window
$ ./bin/boxfork fork --count 3 sbx_uulezsidjhktd4lb
sbx_ww35nl5skarr6d2y
sbx_eq3pjkqbrx3sysm5
sbx_ba322nviqowim5x4

Each copy has /work/data.csv. A change in one copy does not go to the other copies.

  1. Install the Python SDK from the repository:

    Terminal window
    pip install ./sdk/python
  2. Run this program:

    from boxfork import Sandbox
    with Sandbox.create("python:3.12-slim") as sbx:
    sbx.files.write("/work/hello.py", "print('hello')")
    print(sbx.run("python3 /work/hello.py").stdout)
    sbx.run("pip install --quiet cowsay") # prepare one time
    for copy in sbx.fork(3): # three copies with the package
    print(copy.id)
    copy.kill()

At the end of the with block, the SDK kills the first sandbox.

  1. Kill each sandbox that you made: ./bin/boxfork kill <id>.
  2. Stop the daemon with Ctrl+C.
  • Use with any LLM: give the sandbox to Claude Code, or to any model through tool calls.
  • How it works: the daemon, the gVisor wall and the helper.
  • Deploy: one machine, a cloud, or Kubernetes.