This project runs the OpenClaw TUI on your host machine while isolating the agent's code execution inside a Docker Sandbox microVM. The agent connects back to the host Gateway over an HTTP proxy bridge through the sandbox proxy.
The default model is qwen2.5:32b.
Host: TUI -> Gateway:18789 -> Ollama:11434
^
| WebSocket (tunneled through proxy)
|
Sandbox: openclaw node -> gateway-bridge:18789 -> proxy:3128 -> host:18789
- The host runs the OpenClaw Gateway (port 18789) and TUI, connecting directly to Ollama at
127.0.0.1:11434. - The sandbox runs an OpenClaw Node that pairs with the host Gateway. An HTTP proxy bridge inside the sandbox forwards HTTP and WebSocket traffic through the Docker proxy to the host Gateway.
- Ollama is accessed directly by the host Gateway — no proxy bridge needed.
- Docker Desktop 4.58+ installed.
- Ollama installed and running on the host (
ollama serve). - The desired model pulled into Ollama (e.g.
ollama pull qwen2.5:32b). - OpenClaw CLI installed on the host (
~/.openclaw/openclaw.jsonconfigured with Gateway on port 18789).
From the repository root:
make setup
make runIf you already have the warm template baked:
make runFor a noninteractive validation run:
make doctorOr directly:
./scripts/run-openclaw.sh /absolute/path/to/your/projectIf you want a different model:
OPENCLAW_MODEL=qwen2.5-coder:32b make run- Verify the OpenClaw CLI is on the host.
- Verify Ollama is running and the model is available.
- Start the host Gateway if it is not already running.
- Create or reuse the Docker sandbox, configure proxy policy, and provision it.
- Launch
start-node.shinside the sandbox (background, no TTY). This starts the gateway bridge and runsopenclaw node run. - Auto-approve the node pairing request if not already paired.
- Run
openclaw tui --deliveron the host (foreground, blocks). - On exit: stop the sandbox and kill the host Gateway if this script started it.
make setup # Full setup: checks, template, doctor
make run # Launch host TUI + sandbox agent
make doctor # Validate Ollama + Gateway + sandbox + bridge connectivity
make shell # Interactive shell inside sandbox
make logs # Tail host Gateway + sandbox logs
make stop # Stop sandbox
make clean # Remove sandbox
make template # Bake warm template
make template-clean # Remove warm template- A sandbox named
openclaw-<workspace>-<hash>unless you overrideOPENCLAW_SANDBOX_NAME. - An OpenClaw install inside the sandbox at
/opt/openclaw. - A gateway bridge at
/usr/local/lib/openclaw-docker/gateway-bridge.jsinside the sandbox. - Host Gateway logs at
~/.openclaw/logs/gateway-host.log.
OPENCLAW_MODEL: choose a different Ollama model.OPENCLAW_GATEWAY_PORT: change the Gateway port (default18789).OPENCLAW_SANDBOX_NAME: choose the sandbox name.OLLAMA_HOST_PORT: change the host port where Ollama is listening (default11434).OPENCLAW_TEMPLATE_TAG: change the warm template image tag.OPENCLAW_VERSION: pin the OpenClaw CLI version during sandbox provisioning.OPENCLAW_KEEP_SANDBOX_RUNNING=1: leave the sandbox running after the TUI exits.
- The sandbox Node starts and connects to the host Gateway (authenticated via
OPENCLAW_GATEWAY_TOKEN). - The host script waits up to 60s for either the node to connect (existing pairing) or a pending pairing request.
- If a pending request appears, it extracts the
requestIdand runsopenclaw nodes approve <id>. - The Node is paired; credentials are stored in the sandbox at
~/.openclaw/node.json. - On subsequent runs with the same sandbox, the node reconnects automatically using its stored credentials.
Install the OpenClaw CLI on the host: https://openclaw.ai/install-cli.sh
- Check
~/.openclaw/logs/gateway-host.log. - Verify
~/.openclaw/openclaw.jsonexists and configures the Gateway on port 18789. - Try manually:
openclaw gatewayand checkopenclaw gateway call health.
- Check sandbox logs:
make logs. - Verify the gateway bridge can reach the host:
make doctor. - Ensure the proxy policy allows
localhost:18789: the scripts do this automatically. - If you ran
make cleanand recreated the sandbox, the old node entry may be stale on the gateway. The new sandbox will send a fresh pairing request that gets auto-approved. - To manually clear stale nodes: check
openclaw nodes statusand remove disconnected entries.
- Confirm Ollama is running:
ollama serve. - Confirm
curl http://127.0.0.1:11434/api/tagsworks on the host. - If you use a non-default port, set
OLLAMA_HOST_PORTaccordingly.
- Pull the model on the host:
ollama pull qwen2.5:32b.
- Install Docker Desktop 4.58+.
- Verify with
docker desktop versionanddocker sandbox version.