A remote terminal API.
$git clone https://github.com/open-webui/open-terminalInstalls into the current project.
Install open-terminal by running `git clone https://github.com/open-webui/open-terminal`, then use it for the current task and follow its documentation at https://github.com/open-webui/open-terminal.
| 1 | # ⚡ Open Terminal |
| 2 | |
| 3 | A lightweight, self-hosted terminal that gives AI agents and automation tools a dedicated environment to run commands, manage files, and execute code — all through a simple API. |
| 4 | |
| 5 | ## Why Open Terminal? |
| 6 | |
| 7 | AI assistants are great at writing code, but they need somewhere to *run* it. Open Terminal is that place — a remote shell with file management, search, and more, accessible over a simple REST API. |
| 8 | |
| 9 | You can run it two ways: |
| 10 | |
| 11 | - **Docker (sandboxed)** — runs in an isolated container with a full toolkit pre-installed: Python, Node.js, git, build tools, data science libraries, ffmpeg, and more. Great for giving AI agents a safe playground without touching your host system. |
| 12 | - **Bare metal** — install it with `pip` and run it anywhere Python runs. Commands run directly on your machine with access to your real files, your real tools, and your real environment, perfect for local development, personal automation, or giving an AI assistant full access to your actual projects. |
| 13 | |
| 14 | ## Getting Started |
| 15 | |
| 16 | ### Docker (recommended) |
| 17 | |
| 18 | ```bash |
| 19 | docker run -d --name open-terminal --restart unless-stopped -p 8000:8000 -v open-terminal:/home/user -e OPEN_TERMINAL_API_KEY=your-secret-key ghcr.io/open-webui/open-terminal |
| 20 | ``` |
| 21 | |
| 22 | That's it — you're up and running at `http://localhost:8000`. |
| 23 | |
| 24 | > [!TIP] |
| 25 | > If you don't set an API key, one is generated automatically. Grab it with `docker logs open-terminal`. |
| 26 | |
| 27 | #### Image Variants |
| 28 | |
| 29 | | | `latest` | `slim` | `alpine` | `openshift` | |
| 30 | |---|---|---|---|---| |
| 31 | | **Best for** | AI agent sandboxes | Production / hardened | Edge / CI / minimal footprint | OpenShift restricted SCC | |
| 32 | | **Size** | ~4 GB | ~430 MB | ~230 MB | ~430 MB | |
| 33 | | **Bundled tooling** | Node.js, gcc, ffmpeg, LaTeX, Docker CLI, data science libs | git, curl, jq | git, curl, jq | git, curl, jq | |
| 34 | | **Install packages at runtime** | ✔ (has `sudo`) | ✘ | ✘ | ✘ | |
| 35 | | **Multi-user mode** | ✔ | ✘ | ✘ | ✘ | |
| 36 | | **Egress firewall** | ✔ | ✔ | ✔ | ✘ | |
| 37 | |
| 38 | **`slim`** and **`alpine`** have the same feature set. Slim uses Debian (glibc) for broader binary compatibility; Alpine uses musl libc and is smaller, but some C-extension pip packages may need to compile from source. |
| 39 | |
| 40 | ```bash |
| 41 | docker run -d -p 8000:8000 -e OPEN_TERMINAL_API_KEY=secret ghcr.io/open-webui/open-terminal:slim |
| 42 | docker run -d -p 8000:8000 -e OPEN_TERMINAL_API_KEY=secret ghcr.io/open-webui/open-terminal:alpine |
| 43 | docker run -d -p 8000:8000 -e OPEN_TERMINAL_API_KEY=secret ghcr.io/open-webui/open-terminal:openshift |
| 44 | ``` |
| 45 | |
| 46 | > [!NOTE] |
| 47 | > Slim and Alpine don't support `OPEN_TERMINAL_PACKAGES` / `OPEN_TERMINAL_PIP_PACKAGES` / `OPEN_TERMINAL_NPM_PACKAGES`. To add packages, extend [Dockerfile.slim](Dockerfile.slim) or [Dockerfile.alpine](Dockerfile.alpine). |
| 48 | |
| 49 | > [!NOTE] |
| 50 | > The OpenShift image is for restricted non-root pod policies. It does not support runtime package installs, Docker socket access, the iptables egress firewall, or `OPEN_TERMINAL_MULTI_USER=true`. Build a custom image ahead of time when OpenShift users need extra tools. |
| 51 | |
| 52 | #### Updating |
| 53 | |
| 54 | ```bash |
| 55 | docker pull ghcr.io/open-webui/open-terminal |
| 56 | docker rm -f open-terminal |
| 57 | ``` |
| 58 | |
| 59 | Then re-run the `docker run` command above. |
| 60 | |
| 61 | ### Bare Metal |
| 62 | |
| 63 | No Docker? No problem. Open Terminal is a standard Python package: |
| 64 | |
| 65 | ```bash |
| 66 | # One-liner with uvx (no install needed) |
| 67 | uvx open-terminal run --host 0.0.0.0 --port 8000 --api-key your-secret-key |
| 68 | |
| 69 | # Or install globally with pip |
| 70 | pip install open-terminal |
| 71 | open-terminal run --host 0.0.0.0 --port 8000 --api-key your-secret-key |
| 72 | ``` |
| 73 | |
| 74 | > [!CAUTION] |
| 75 | > On bare metal, commands run directly on your machine with your user's permissions. Use Docker if you want sandboxed execution. |
| 76 | |
| 77 | #### Customizing the Docker Environment |
| 78 | |
| 79 | The easiest way to add extra packages is with environment variables — no fork needed: |
| 80 | |
| 81 | ```bash |
| 82 | docker run -d --name open-terminal -p 8000:8000 \ |
| 83 | -e OPEN_TERMINAL_PACKAGES="cowsay figlet" \ |
| 84 | -e OPEN_TERMINAL_PIP_PACKAGES="httpx polars" \ |
| 85 | -e OPEN_TERMINAL_NPM_PACKAGES="typescript tsx" \ |
| 86 | ghcr.io/open-webui/open-terminal |
| 87 | ``` |