Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 16 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,29 @@ Requirements:
- Docker (required for local execution)
- Python 3.10+ (recommended for examples and local runtime)

#### 1. Clone the Repository
#### 1. Install and Configure the Sandbox Server

```bash
git clone https://github.com/alibaba/OpenSandbox.git
cd OpenSandbox
uv pip install opensandbox-server
curl -o ~/.sandbox.toml https://raw.githubusercontent.com/alibaba/OpenSandbox/main/server/example.config.toml
```
Comment on lines 38 to +41

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Avoid pulling config from main for PyPI installs

These steps tell users to install opensandbox-server from PyPI but download example.config.toml from the repository’s main branch. If the PyPI release lags or leads main, the downloaded config can include fields not supported by the installed version (or omit required fields), and Pydantic validation in server/src/config.py will reject it at startup. This creates a real setup failure for users who follow the documented flow; consider pointing to a version-matched config (tagged release) or the packaged example instead.

Useful? React with 👍 / 👎.

Copy link
Collaborator

@ninan-nn ninan-nn Feb 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

example toml is already package in opensandbox-server, can be copied from dist.


> If you prefer working from source, you can still clone the repo for development, but server startup no longer requires it.
>
> ```bash
> git clone https://github.com/alibaba/OpenSandbox.git
> cd OpenSandbox/server
> uv sync
> cp example.config.toml ~/.sandbox.toml # Copy configuration file
> uv run python -m src.main # Start the service
```

#### 2. Start the Sandbox Server

```bash
cd server
uv sync
cp example.config.toml ~/.sandbox.toml # Copy configuration file
uv run python -m src.main # Start the service
opensandbox-server

# opensandbox-server -h # Show help
```

#### 3. Create a Code Interpreter and Execute Commands
Expand Down
23 changes: 16 additions & 7 deletions docs/README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,29 @@ OpenSandbox 是一个面向 AI 应用场景设计的「通用沙箱平台」,
- Docker(本地运行必需)
- Python 3.10+(本地 runtime 和快速开始)

#### 1. 克隆仓库
#### 1. 安装并配置 Server

```bash
git clone https://github.com/alibaba/OpenSandbox.git
cd OpenSandbox
uv pip install opensandbox-server
curl -o ~/.sandbox.toml https://raw.githubusercontent.com/alibaba/OpenSandbox/main/server/example.config.zh.toml
```

> 如果需要开发或使用源码编译,可通过clone仓库进行开发。
>
> ```bash
> git clone https://github.com/alibaba/OpenSandbox.git
> cd OpenSandbox/server
> uv sync
> cp example.config.toml ~/.sandbox.toml # Copy configuration file
> uv run python -m src.main # Start the service
```

#### 2. 启动沙箱 Server

```bash
cd server
uv sync
cp example.config.zh.toml ~/.sandbox.toml # 复制配置文件
uv run python -m src.main # 启动服务
opensandbox-server

# opensandbox-server -h # Show help
```

#### 3. 创建代码解释器,并在沙箱中执行命令
Expand Down
9 changes: 4 additions & 5 deletions examples/agent-sandbox/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ executes `echo hello world` via the OpenSandbox Python SDK.

## Start OpenSandbox server

1. Copy the example config and edit it for agent-sandbox:
1. Install the server package and fetch the example config for agent-sandbox:

```shell
cd server
cp example.config.toml ~/.sandbox.toml
uv pip install opensandbox-server
curl -o ~/.sandbox.toml https://raw.githubusercontent.com/alibaba/OpenSandbox/main/server/example.config.toml
```

2. Update `~/.sandbox.toml` with the following sections:
Expand All @@ -37,8 +37,7 @@ shutdown_policy = "Delete"
3. Start the server:

```shell
cd server
uv sync && uv run python -m src.main
opensandbox-server
```

## Run the example
Expand Down
10 changes: 4 additions & 6 deletions examples/aio-sandbox/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,11 @@ docker pull ghcr.io/agent-infra/sandbox:latest
Then, start the OpenSandbox server, you can obtain stdout log from terminal.

```shell
git clone git@github.com:alibaba/OpenSandbox.git
cd OpenSandbox/server
cp example.config.toml ~/.sandbox.toml
uv sync && uv run python -m src.main
uv pip install opensandbox-server
curl -o ~/.sandbox.toml https://raw.githubusercontent.com/alibaba/OpenSandbox/main/server/example.config.toml
opensandbox-server
```
> Note: `uv run python -m src.main` runs the server in the foreground and will keep the current terminal session busy.
> Open a new terminal window/tab, `cd` into the project root (`OpenSandbox/`), then run the AIO sandbox creation steps below.
> Note: `opensandbox-server` runs in the foreground and will keep the current terminal session busy. The example code lives in this repository—clone it and, in a new terminal window/tab, `cd` into the project root before running the AIO sandbox creation steps below.
If you see errors like `FileNotFoundError: [Errno 2] No such file or directory` from `docker/transport/unixconn.py`, it usually means the Docker unix socket is missing / Docker daemon is not running.

## Create and Access the AIO Sandbox Instance
Expand Down
7 changes: 3 additions & 4 deletions examples/chrome/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,9 @@ docker pull opensandbox/chrome:latest
Start the OpenSandbox server and tail stdout from the terminal:

```shell
git clone git@github.com:alibaba/OpenSandbox.git
cd OpenSandbox/server
cp example.config.toml ~/.sandbox.toml
uv sync && uv run python -m src.main
uv pip install opensandbox-server
curl -o ~/.sandbox.toml https://raw.githubusercontent.com/alibaba/OpenSandbox/main/server/example.config.toml
opensandbox-server
```

## Create and access a Chrome sandbox
Expand Down
8 changes: 3 additions & 5 deletions examples/claude-code/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,9 @@ docker pull sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/code-int
Then start the local OpenSandbox server, stdout logs will be visible in the terminal:

```shell
git clone git@github.com:alibaba/OpenSandbox.git
cd OpenSandbox/server
cp example.config.toml ~/.sandbox.toml
uv sync
uv run python -m src.main
uv pip install opensandbox-server
curl -o ~/.sandbox.toml https://raw.githubusercontent.com/alibaba/OpenSandbox/main/server/example.config.toml
opensandbox-server
```

## Create and Access the Claude Sandbox
Expand Down
18 changes: 7 additions & 11 deletions examples/code-interpreter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,9 @@ docker pull sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/code-int
Start the local OpenSandbox server:

```shell
git clone git@github.com:alibaba/OpenSandbox.git
cd OpenSandbox/server
cp example.config.toml ~/.sandbox.toml
uv sync
uv run python -m src.main
uv pip install opensandbox-server
curl -o ~/.sandbox.toml https://raw.githubusercontent.com/alibaba/OpenSandbox/main/server/example.config.toml
opensandbox-server
```

## Create and access the Code Interpreter Sandbox
Expand Down Expand Up @@ -149,15 +147,13 @@ spec:
Start the k8s OpenSandbox server:

```shell
git clone git@github.com:alibaba/OpenSandbox.git
cd OpenSandbox/server
uv pip install opensandbox-server

# replace with your k8s cluster config, kubeconfig etc.
cp example.config.k8s.toml ~/.sandbox.toml
cp example.batchsandbox-template.yaml ~/batchsandbox-template.yaml
curl -o ~/.sandbox.toml https://raw.githubusercontent.com/alibaba/OpenSandbox/main/server/example.config.k8s.toml
curl -o ~/batchsandbox-template.yaml https://raw.githubusercontent.com/alibaba/OpenSandbox/main/server/example.batchsandbox-template.yaml

uv sync
uv run python -m src.main
opensandbox-server
```

## Create and access the Code Interpreter Sandbox
Expand Down
8 changes: 3 additions & 5 deletions examples/codex-cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,9 @@ docker pull sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/code-int
Start the local OpenSandbox server, logs will be visible in the terminal:

```shell
git clone git@github.com:alibaba/OpenSandbox.git
cd OpenSandbox/server
cp example.config.toml ~/.sandbox.toml
uv sync
uv run python -m src.main
uv pip install opensandbox-server
curl -o ~/.sandbox.toml https://raw.githubusercontent.com/alibaba/OpenSandbox/main/server/example.config.toml
opensandbox-server
```

## Create and Access the Codex Sandbox
Expand Down
8 changes: 3 additions & 5 deletions examples/desktop/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,9 @@ docker pull opensandbox/desktop:latest
Start the local OpenSandbox server:

```shell
git clone git@github.com:alibaba/OpenSandbox.git
cd OpenSandbox/server
cp example.config.toml ~/.sandbox.toml
uv sync
uv run python -m src.main
uv pip install opensandbox-server
curl -o ~/.sandbox.toml https://raw.githubusercontent.com/alibaba/OpenSandbox/main/server/example.config.toml
opensandbox-server
```

## Create and Access the Desktop Sandbox
Expand Down
8 changes: 3 additions & 5 deletions examples/gemini-cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,9 @@ docker pull sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/code-int
Start the local OpenSandbox server, logs will be visible in the terminal:

```shell
git clone git@github.com:alibaba/OpenSandbox.git
cd OpenSandbox/server
cp example.config.toml ~/.sandbox.toml
uv sync
uv run python -m src.main
uv pip install opensandbox-server
curl -o ~/.sandbox.toml https://raw.githubusercontent.com/alibaba/OpenSandbox/main/server/example.config.toml
opensandbox-server
```

## Create and Access the Gemini Sandbox
Expand Down
8 changes: 3 additions & 5 deletions examples/google-adk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,9 @@ docker pull sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/code-int
Start the local OpenSandbox server, logs will be visible in the terminal:

```shell
git clone git@github.com:alibaba/OpenSandbox.git
cd OpenSandbox/server
cp example.config.toml ~/.sandbox.toml
uv sync
uv run python -m src.main
uv pip install opensandbox-server
curl -o ~/.sandbox.toml https://raw.githubusercontent.com/alibaba/OpenSandbox/main/server/example.config.toml
opensandbox-server
```

## Run the example
Expand Down
8 changes: 3 additions & 5 deletions examples/iflow-cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,9 @@ docker pull sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/code-int
Start the local OpenSandbox server, logs will be visible in the terminal:

```shell
git clone git@github.com:alibaba/OpenSandbox.git
cd OpenSandbox/server
cp example.config.toml ~/.sandbox.toml
uv sync
uv run python -m src.main
uv pip install opensandbox-server
curl -o ~/.sandbox.toml https://raw.githubusercontent.com/alibaba/OpenSandbox/main/server/example.config.toml
opensandbox-server
```

## Create and Access the iFlow Sandbox
Expand Down
8 changes: 3 additions & 5 deletions examples/langgraph/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,9 @@ docker pull sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/code-int
Start the local OpenSandbox server, logs will be visible in the terminal:

```shell
git clone git@github.com:alibaba/OpenSandbox.git
cd OpenSandbox/server
cp example.config.toml ~/.sandbox.toml
uv sync
uv run python -m src.main
uv pip install opensandbox-server
curl -o ~/.sandbox.toml https://raw.githubusercontent.com/alibaba/OpenSandbox/main/server/example.config.toml
opensandbox-server
```

## Run the example
Expand Down
8 changes: 3 additions & 5 deletions examples/playwright/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,9 @@ docker pull sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/playwrig
Start the local OpenSandbox server:

```shell
git clone git@github.com:alibaba/OpenSandbox.git
cd OpenSandbox/server
cp example.config.toml ~/.sandbox.toml
uv sync
uv run python -m src.main
uv pip install opensandbox-server
curl -o ~/.sandbox.toml https://raw.githubusercontent.com/alibaba/OpenSandbox/main/server/example.config.toml
opensandbox-server
```

## Create and Access the Playwright Sandbox
Expand Down
8 changes: 3 additions & 5 deletions examples/rl-training/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@ Demonstrates running a basic RL training loop (CartPole + DQN) inside an isolate
Start the local OpenSandbox server:

```shell
git clone git@github.com:alibaba/OpenSandbox.git
cd OpenSandbox/server
cp example.config.toml ~/.sandbox.toml
uv sync
uv run python -m src.main
uv pip install opensandbox-server
curl -o ~/.sandbox.toml https://raw.githubusercontent.com/alibaba/OpenSandbox/main/server/example.config.toml
opensandbox-server
```

## Run the Example
Expand Down
8 changes: 3 additions & 5 deletions examples/vscode/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,9 @@ docker pull sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/vscode:l
Start the local OpenSandbox server:

```shell
git clone git@github.com:alibaba/OpenSandbox.git
cd OpenSandbox/server
cp example.config.toml ~/.sandbox.toml
uv sync
uv run python -m src.main
uv pip install opensandbox-server
curl -o ~/.sandbox.toml https://raw.githubusercontent.com/alibaba/OpenSandbox/main/server/example.config.toml
opensandbox-server
```

## Create and Access the VS Code Sandbox
Expand Down
22 changes: 9 additions & 13 deletions server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,29 +40,25 @@ A production-grade, FastAPI-based service for managing the lifecycle of containe

### Installation

1. **Clone the repository** and navigate to the server directory:
1. **Install from PyPI** (no repository clone required):
```bash
cd server
```

2. **Install dependencies** using `uv`:
```bash
uv sync
uv pip install opensandbox-server
```
> For source development or contributions, you can still clone the repo and run `uv sync` inside `server/`.

### Configuration

The server uses a TOML configuration file to select and configure the underlying runtime.

**Create configuration file**:
```bash
cp example.config.toml ~/.sandbox.toml
curl -o ~/.sandbox.toml https://raw.githubusercontent.com/alibaba/OpenSandbox/main/server/example.config.toml
```
**[optional] Create K8S configuration file:
**[optional] Create K8S configuration file:**
The K8S version of the Sandbox Operator needs to be deployed in the cluster, refer to the Kubernetes directory.
```bash
cp example.config.k8s.toml ~/.sandbox.toml
cp example.batchsandbox-template.yaml ~/batchsandbox-template.yaml
curl -o ~/.sandbox.toml https://raw.githubusercontent.com/alibaba/OpenSandbox/main/server/example.config.k8s.toml
curl -o ~/batchsandbox-template.yaml https://raw.githubusercontent.com/alibaba/OpenSandbox/main/server/example.batchsandbox-template.yaml
```

**[optional] Edit `~/.sandbox.toml`** for your environment:
Expand Down Expand Up @@ -145,10 +141,10 @@ cp example.batchsandbox-template.yaml ~/batchsandbox-template.yaml

### Run the server

Start the server using `uv`:
Start the server using the installed CLI (reads `~/.sandbox.toml` by default):

```bash
uv run python -m src.main
opensandbox-server
```

The server will start at `http://0.0.0.0:8080` (or your configured host/port).
Expand Down
Loading
Loading