{"id":47754495,"url":"https://github.com/open-webui/terminals","last_synced_at":"2026-04-03T04:03:25.801Z","repository":{"id":341156503,"uuid":"1156736087","full_name":"open-webui/terminals","owner":"open-webui","description":null,"archived":false,"fork":false,"pushed_at":"2026-03-27T00:30:59.000Z","size":230,"stargazers_count":48,"open_issues_count":2,"forks_count":6,"subscribers_count":4,"default_branch":"main","last_synced_at":"2026-03-27T12:59:44.057Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/open-webui.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":"CLA.md"}},"created_at":"2026-02-13T01:47:38.000Z","updated_at":"2026-03-27T00:31:03.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/open-webui/terminals","commit_stats":null,"previous_names":["open-webui/terminals"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/open-webui/terminals","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-webui%2Fterminals","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-webui%2Fterminals/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-webui%2Fterminals/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-webui%2Fterminals/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/open-webui","download_url":"https://codeload.github.com/open-webui/terminals/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-webui%2Fterminals/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31333229,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-03T03:20:36.090Z","status":"ssl_error","status_checked_at":"2026-04-03T03:20:35.133Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-04-03T04:03:24.104Z","updated_at":"2026-04-03T04:03:25.789Z","avatar_url":"https://github.com/open-webui.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Terminals\n\n\u003e [!NOTE]\n\u003e This project is **actively under development**. APIs, configuration, and behavior may change between releases.\n\nPer-user [Open Terminal](https://github.com/open-webui/open-terminal) orchestration for Docker and Kubernetes.\n\nTerminals gives every Open WebUI user their own isolated container — with separate credentials, resource limits, and network rules. It handles the full lifecycle automatically: spinning up containers when a user connects, proxying traffic, enforcing limits, and cleaning up when they're done.\n\n```\nOpen WebUI  →  Terminals service  →  per-user containers\n               (this project)        (Open Terminal images)\n```\n\n\u003e [!IMPORTANT]\n\u003e **Production use requires an [Open WebUI Enterprise License](LICENSE) with Terminals access.** Contact the Open WebUI team to get started.\n\n## Quick Start\n\nThe fastest way to get running is with Docker. Terminals will manage sibling containers through the Docker socket.\n\n### Docker (recommended for single-node)\n\n```bash\ndocker run -p 3000:3000 \\\n  -v /var/run/docker.sock:/var/run/docker.sock \\\n  -v $(pwd)/data:/app/data \\\n  terminals\n```\n\n**Prerequisites:** Docker running on the host.\n\n### Kubernetes Operator (recommended for clusters)\n\nFor Kubernetes deployments, the operator manages `Terminal` custom resources automatically — handling pod creation, storage, and cleanup through CRDs.\n\n```bash\n# Install the CRD and operator\nkubectl apply -f manifests/terminal-crd.yaml\nkubectl apply -f manifests/operator-deployment.yaml\n```\n\nSet `TERMINALS_BACKEND=kubernetes-operator` when deploying the Terminals service.\n\n### From source (development)\n\n```bash\npip install -e .\nterminals serve\n```\n\n## Choosing a Backend\n\n| Backend | Best for | How it works |\n|---------|----------|-------------|\n| `docker` | Single-node, local dev | One container per user via Docker socket |\n| `kubernetes-operator` | Production K8s clusters | Operator watches `Terminal` CRDs for automated lifecycle |\n| `kubernetes` | K8s without CRDs | Direct Pod + PVC + Service per user (you manage resources) |\n\nSet the backend with `TERMINALS_BACKEND` (defaults to `docker`).\n\n## Policies\n\nPolicies let you define different environments — for example, a \"data-science\" environment with extra CPU and specific Python packages, or a \"sandbox\" environment with restricted network access.\n\nWithout any policies, Terminals uses the defaults from your configuration. Once you're ready to customize, manage policies through the REST API:\n\n```bash\n# Create a \"data-science\" policy\ncurl -X PUT http://localhost:3000/api/v1/policies/data-science \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"image\": \"ghcr.io/open-webui/open-terminal:python-ds\",\n    \"cpu_limit\": \"2\",\n    \"memory_limit\": \"4Gi\",\n    \"env\": {\n      \"OPENAI_API_KEY\": \"sk-proj-...\",\n      \"OPEN_TERMINAL_ALLOWED_DOMAINS\": \"*.pypi.org,github.com\"\n    },\n    \"idle_timeout_minutes\": 30\n  }'\n```\n\nRoute requests through a policy by adding `/p/{policy_id}/` to the URL:\n\n```bash\ncurl -X POST http://localhost:3000/p/data-science/execute \\\n  -H \"Authorization: Bearer $API_KEY\" -H \"X-User-Id: user-123\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"command\": \"echo hello\"}'\n```\n\n### Policy fields\n\n| Field | Type | Description |\n|-------|------|-------------|\n| `image` | string | Container image to use |\n| `env` | dict | Environment variables passed to the container |\n| `cpu_limit` | string | Max CPU (e.g. `\"2\"`) |\n| `memory_limit` | string | Max memory (e.g. `\"4Gi\"`) |\n| `storage` | string | Persistent volume size (omit for ephemeral storage) |\n| `storage_mode` | string | `per-user`, `shared`, or `shared-rwo` |\n| `idle_timeout_minutes` | int | Minutes of inactivity before the container is cleaned up |\n\n## Configuration\n\nAll settings are configured through environment variables prefixed with `TERMINALS_`, or via a `.env` file.\n\n| Variable | Default | Description |\n|----------|---------|-------------|\n| `TERMINALS_BACKEND` | `docker` | `docker`, `kubernetes`, or `kubernetes-operator` |\n| `TERMINALS_API_KEY` | *(auto-generated)* | Bearer token for API auth |\n| `TERMINALS_IMAGE` | `ghcr.io/open-webui/open-terminal:latest` | Default container image |\n| `TERMINALS_MAX_CPU` | | Hard cap on CPU per container |\n| `TERMINALS_MAX_MEMORY` | | Hard cap on memory per container |\n| `TERMINALS_MAX_STORAGE` | | Hard cap on storage per container |\n| `TERMINALS_ALLOWED_IMAGES` | | Comma-separated list of allowed image patterns |\n| `TERMINALS_KUBERNETES_STORAGE_MODE` | `per-user` | `per-user`, `shared`, or `shared-rwo` |\n\nSee [`config.py`](terminals/config.py) for the full list.\n\n## Authentication\n\n| Mode | How to enable |\n|------|---------------|\n| **API Key** | Set `TERMINALS_API_KEY` to a static token |\n| **Open (dev only)** | Leave unset — no auth, for local development only |\n\n## License\n\n[Open WebUI Enterprise License](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopen-webui%2Fterminals","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopen-webui%2Fterminals","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopen-webui%2Fterminals/lists"}