open-webui/open-terminal

A computer you can curl ⚡

Open Terminal – A Remote Shell for AI Agents

What it is – Open Terminal is a self‑hosted service that exposes a Unix‑like shell, file browser and code‑execution capabilities through a simple REST API. It lets an LLM‑based assistant (or any automation tool) send commands, read/write files, and even run Docker inside the same environment.

Why it matters for AI – Large language models can generate code, but they need a place to run that code safely. Open Terminal provides a sandboxed (Docker) or direct (bare‑metal) execution host that can be called from an AI UI such as Open WebUI, enabling end‑to‑end “write‑code‑run‑inspect” loops.

Key features

  • Two deployment modes – Docker (isolated, pre‑installed toolchain) or Python package (runs on host).
  • Rich toolset – Python, Node.js, git, ffmpeg, LibreOffice, LaTeX, Docker CLI, data‑science libs, etc.
  • Configurable image variants – latest (full), slim (430 MB), alpine (230 MB), openshift (restricted).
  • Runtime package installation – Via environment variables (OPEN_TERMINAL_PACKAGES, *_PIP_PACKAGES, *_NPM_PACKAGES).
  • Multi‑user mode – Optional per‑user Linux accounts inside a single container (not a security boundary).
  • Docker‑socket access – Mount /var/run/docker.sock to let agents build/run containers (full host control, use with care).
  • File‑browser root hint – UI can show a friendly starting directory without restricting shell access.
  • Office preview – LibreOffice can convert DOCX/PPTX to PDF on‑the‑fly.

How to get started

  1. Docker (recommended)
    docker run -d --name open-terminal -p 8000:8000 \
      -v open-terminal:/home/user \
      -e OPEN_TERMINAL_API_KEY=your-secret-key \
      ghcr.io/open-webui/open-terminal
    
    The service will be reachable at http://localhost:8000 and its OpenAPI docs at /docs.
  2. Bare‑metal
    pip install open-terminal
    open-terminal run --host 0.0.0.0 --port 8000 --api-key your-secret-key
    
    (Or use uvx for a one‑off run without installing.)

Customization

  • Add extra apt/pip/npm packages via the three OPEN_TERMINAL_*_PACKAGES env vars, or build a custom Docker image from the provided Dockerfiles.
  • Adjust settings with a TOML config file (~/.config/open-terminal/config.toml) or environment variables; CLI flags override everything.
  • For production multi‑user isolation, the separate Terminals project (Enterprise) creates a dedicated container per user.

Integration – Open Terminal plugs directly into Open WebUI. In the UI you add the terminal URL and API key under Integrations → Open Terminal. The UI then shows a file‑browser sidebar and lets you execute commands from chat.

Security notes

  • Docker mode isolates the host; bare‑metal runs commands with your user’s permissions.
  • Mounting the Docker socket gives the container root‑level control over the host.
  • Built‑in multi‑user mode shares a single kernel and is only safe for trusted users.

License – MIT.


All details are taken from the repository’s README; no external assumptions are added.

Related

  • Project
  • Project
  • Project
  • Dispatch
  • Project