Skip to content

Port Forwarding & Nested Docker

offrig multiplexes TCP port forwarding and command streams over a single authenticated yamux connection to the Worker (offrigd)—no extra firewall rules or exposed public ports needed.

  • -p [LOCAL:]REMOTE (Sandbox → laptop): Access a dev server running inside the Sandbox from your laptop’s browser (localhost:LOCAL).
  • -R [REMOTE:]LOCAL (laptop → Sandbox): Let code inside the Sandbox reach a local database or service running on your laptop (localhost:REMOTE).
Terminal window
# Run a dev server remotely and open http://localhost:3000 locally
offrig -p 3000 pnpm dev
# Map Sandbox port 5173 to laptop port 8080, and expose local Postgres 5432 inside the Sandbox
offrig -p 8080:5173 -R 5432:5432 pnpm test:integration

Declare default ports for a repository under [run].ports in offrig.toml, and skip them on a specific Run with --no-ports.

Dedicated port-forwarding holds (offrig sandbox forward)

Section titled “Dedicated port-forwarding holds (offrig sandbox forward)”

Hold ports open against an active Sandbox without tying up an interactive command:

Terminal window
offrig sandbox forward -p 3000 -p 8080:5173

Pass --json to emit forward_ready and forward_closed NDJSON lifecycle events. Holds remain alive until Ctrl-C or the Sandbox’s Hold cap ([resources].hold_cap_minutes, default 60 minutes).

Configure Docker access inside a Sandbox with [run].docker:

Value Behavior Trust & Provider support
"off" (default) No Docker daemon inside the Sandbox. All Providers
"dind" Isolated Docker-in-Docker inside the Sandbox. Allowed in offrig.toml; supported on local, ssh, daytona, boat, cloudflare (--network=host for egress on Cloudflare), modal (runtime = "vm"), e2b, and sprites.
"host" Mounts the Rig host’s Docker socket into the Sandbox. User-local opt-in required (allow_host_docker = true on local or ssh Rig); never available on hosted cloud Providers.
offrig.toml
[run]
docker = "dind"