Skip to main content
BoxRun provides a single boxrun command with subcommands for managing boxes, executing commands, transferring files, and more. BOX arguments accept either a box ID (box_abc123) or a name (dev).

Server

boxrun serve [--host 127.0.0.1] [--port 9090] [--socket PATH]
Start the BoxRun server. By default it listens on TCP 127.0.0.1:9090. Use --socket to bind to a Unix domain socket instead. The web dashboard is available at http://<host>:<port>/ui when running in TCP mode.
The server starts automatically on your first command — you rarely need to run this manually.

Box lifecycle

Create

boxrun create [IMAGE] [--name NAME] [--cpu 2] [--memory 1024] [--disk 8] [--network] [-v /host:/guest[:ro]]
Create a new box from a container image. If IMAGE is omitted, defaults to ubuntu:24.04.
FlagDefaultDescription
--name, -n(auto)Human-readable name
--cpu2CPU cores
--memory, -m1024Memory in MB
--disk8Disk size in GB
--networkfalseEnable networking
-v, --volume(none)Volume mount (repeatable)

List

boxrun ls [--status running|stopped|all]

Stop

boxrun stop BOX
Stop a running box. Disk state is preserved — restart it later with boxrun start.

Start

boxrun start BOX
Restart a previously stopped box with its disk intact.

Remove

boxrun rm BOX [--force]
Remove a box permanently. Use --force to remove a running box without stopping it first.

Interactive terminal

boxrun attach BOX [--shell /bin/bash]
Open a full interactive terminal session inside a running box.
  • Full PTY support — vim, htop, tmux all work
  • Automatic terminal resize handling
  • Raw terminal mode — same experience as SSH
  • The box keeps running if you disconnect — reattach anytime
Exit with Ctrl-D or type exit.

Shell shortcut

boxrun shell IMAGE [--name NAME] [--cpu 2] [--memory 1024] [--disk 8] [--shell /bin/bash] [-v /host:/guest[:ro]]
Create a box and immediately attach to it — combines create + attach in one command. Accepts the same resource flags as create.
boxrun shell ubuntu
boxrun shell python --name pydev --memory 2048

Command execution

boxrun exec BOX -- CMD [ARGS...]
Execute a command in a box. Output streams to your terminal in real time via SSE.
FlagDescription
--detach, -dReturn the exec ID immediately without waiting
--timeout, -tTimeout in seconds
# Run a command
boxrun exec dev -- uname -a

# With timeout
boxrun exec dev --timeout 30 -- python3 train.py

# Detached (background)
boxrun exec dev --detach -- long-running-job.sh

File transfer

boxrun cp LOCAL_PATH BOX:REMOTE_PATH    # upload
boxrun cp BOX:REMOTE_PATH LOCAL_PATH    # download
Direction is inferred from the BOX:PATH syntax.
# Upload a file
boxrun cp ./data.csv dev:/root/data.csv

# Download results
boxrun cp dev:/root/results.csv ./results.csv

Ephemeral run

boxrun run IMAGE -- CMD [ARGS...] [--timeout SECONDS] [--disk 8]
Create a box, run a command, print the output, and destroy the box — all in one step.
boxrun run ubuntu -- echo "hello"
boxrun run python --timeout 30 -- python3 -c "print(42)"

Volume mounts

Share host directories into VMs using Docker-style -v syntax:
# Read-write mount
boxrun create ubuntu:24.04 --name dev -v ~/project:/root/project

# Read-only mount
boxrun create ubuntu:24.04 --name dev -v ~/data:/mnt/data:ro

# Multiple mounts
boxrun create ubuntu:24.04 -v /src:/root/src -v /data:/mnt/data:ro
Volumes persist across stop/start cycles. Host paths are validated at creation time.

Garbage collection

boxrun gc [--older-than 3600]
Remove boxes that have been stopped for longer than --older-than seconds (default: 1 hour).

Images

boxrun images
List available images with their aliases.

Image aliases

BoxRun provides built-in aliases for common images so you can use short names:
AliasImageDescription
defaultubuntu:24.04General purpose (used when no image is specified)
ubuntuubuntu:24.04Ubuntu 24.04 LTS
pythonpython:3.12-slimPython 3.12 pre-installed
nodenode:22-slimNode.js 22 LTS pre-installed
golanggolang:1.22Go 1.22 pre-installed
rustrust:1.77-slimRust 1.77 pre-installed
alpinealpine:3.20Lightweight Linux (5 MB)
# These are equivalent
boxrun shell ubuntu
boxrun shell ubuntu:24.04

# Use aliases anywhere an image is accepted
boxrun create python --name pydev
boxrun run node -- node -e "console.log('hello')"
Run boxrun images to see all available aliases.

Shell completions

# Zsh (add to ~/.zshrc)
eval "$(boxrun completion zsh)"

# Bash (add to ~/.bashrc)
eval "$(boxrun completion bash)"

# Fish
boxrun completion fish | source