Self-hosted alternative to Claude Code Web, Codex in the Cloud, and similar managed agent environments. Runs isolated AI coding workers in Incus virtual machines, with explicit migration from existing Docker workers. Each worker has a live terminal, VS Code editor (browser + native tunnel), virtual desktop, TCP port + domain mapping, and GitHub integration, all managed through a web dashboard. Full control over the runtime environment.
All agents are installed in a single unified worker image. Start any agent via init script presets or manually in the terminal. Credentials are scoped per user — each user logs in (or sets their own API key) once, and that account's tokens are shared across all of their workers.
| Agent | OAuth Login (per user, inside any worker) | Or set as API key (per user, in Account modal) | |
|---|---|---|---|
| Claude | anthropics/claude-code | claude → /login |
ANTHROPIC_API_KEY (or CLAUDE_CODE_OAUTH_TOKEN) |
| Codex | openai/codex | codex login --device-auth |
OPENAI_API_KEY |
| Gemini | google-gemini/gemini-cli | gemini → /auth |
GEMINI_API_KEY |
- User authentication & RBAC — email/password/passkey login powered by better-auth with admin and user roles; admins create and manage other users, each user sees only their own workers/mappings/environments/etc. First-run setup creates the initial admin.
- Live terminal — xterm.js WebSocket terminal with tmux session management, OSC52 clipboard handling with a selectable fallback, and resize handling during asynchronous attachment
- VS Code editor — code-server per worker with Kilo Code preinstalled and per-user config, provider keys, login, and Kilo sessions shared across that user's workers
- Virtual desktop — Xvfb + fluxbox + noVNC, accessible in-browser, with a keyboard-transparent Ctrl/Cmd+V clipboard bridge (host-clipboard images/text synced to the worker's X11 CLIPBOARD, then the paste key is replayed so GUI apps and Codex paste the synced content)
- Workspace file manager — an optional Files popup on each running worker card to browse
/workspace, upload/download (single file or true ZIP), mkdir, rename, move, and delete with symlink-escape protection (the quick Upload/Download/Export card actions remain) - Offline workspace storage — an owner-scoped inventory and read-only browser for running, stopped, and archived workspaces, with safe text/image preview, bounded search, metadata, and browser-streamed file/directory downloads
- Worker-local configuration — source-aware variables, encrypted write-only secrets, and ephemeral secret files with orchestrator/user/environment/worker precedence and explicit rebuild application
- Multi-repo cloning — clone one or more git repos into each worker at startup
- App system — launch Chromium (with CDP), Persistent VS Code (a noVNC-hosted client that stays alive when the viewer disconnects), SOCKS5 proxy, VS Code Tunnel (native VS Code client via Microsoft's relay), or OpenSSH server from the Apps pane
- Port & domain mapping — unified Traefik reverse proxy handling both TCP port forwarding (localhost- or network-bound) and subdomain-based HTTP/HTTPS/TCP routing with TLS (Let's Encrypt HTTP-01/DNS-01 or self-signed CA), optional HTTP basic auth
- Auto-updates — per-image or bulk image updates in production mode with registry-agnostic digest comparison (GHCR + Docker Hub), orchestrator self-replaces
- Resource limits — per-environment CPU and memory constraints applied to every worker on that environment (plus a global default)
- Hardware grants — cataloged, authorized devices with capability reporting and ownership checks; native vGPU profiles, full physical GPU passthrough, Intel GVT-g sharing and serial USB use explicit operator opt-ins; see Hardware permissions and NVIDIA vGPU setup
- Governed host mounts — an empty-by-default platform path catalog, per-account entitlements, all/group/worker assignments, read-only-by-default access, downward-only group-admin delegation, and immediate stop/rebuild enforcement on revocation; see Host mount permissions
- Persistent VM storage — workspace, agent/editor state, selected persistent paths, managed volumes and optional native Docker data survive compute rebuilds and archiving; the VM root disk is disposable
- Bounded worker recovery — durable running/stopped intent survives daemon restarts; unresponsive runtimes report safe diagnostics and can be recovered through UI/API/MCP while preserving canonical data; ambiguous operations retain explicit recovery fences
- Worker archiving — archive workers to free resources while preserving workspace data; unarchive to restore
- Worker groups and managed networks — organize related experiments, create all/group/selected-worker bridge networks, keep the internal management network unavailable to ordinary workers, and allow/deny the worker-self orchestrator API live per worker or inherited group
- Worker protection locks — optional write-only per-worker passwords protect lifecycle/configuration, running-workspace file changes, apps/exposure mappings, rebuilds, archive/unarchive, in-place restore, and deletion across UI, API, and MCP routes
- File upload/download — upload files/folders to running workers or during creation, download workspace as
.tar.gz - Docker inside VMs — opt-in per-environment Docker daemon for build, run and Compose, with a separate persistent guest block volume; legacy Docker workers retain Docker-in-Docker support
- Usage monitoring — real-time usage/rate limit indicators for OAuth-authenticated agents (Claude, Codex, Gemini)
- Per-worker resource monitoring — live CPU / RAM / disk / network metrics through the selected Incus or Docker runtime
- Durable worker export/import — background jobs with progress, cancellation, expiry, and browser-streamed downloads produce portable
.tarbundles; workspace-only is fast/default and advanced rootfs capture uses parallel level-1 gzip to avoid the historical single-core compression timeout, with legacy and transitional bundle import compatibility - Storage visibility and cleanup — administrator disk inventory covers workspace, images, cache, staging, and helpers, with conservative cleanup that preserves referenced images, active jobs, workspaces, and retained artifacts
- Encrypted backup and restore — manual or exact-minute scheduled multi-workspace backups, retention, retry/resume/cancel, integrity verification, retroactive per-worker selection from existing multi-workspace artifacts, safe original/new-worker restore, local/fake providers, and independently linked Google Drive OAuth (administrator-configured in the dashboard with a write-only encrypted client secret). Archived-worker selections no longer block settings updates, and indexed archive verification avoids the previous slowdown on file-heavy backups.
- Whole-instance disaster recovery — platform-admin encrypted snapshots combine a consistent
auth.dbbackup, versionedDATA_DIRstate (including image/template/plugin catalogs and desired plugin installations), and optional Agentor-owned Docker/native persistent data; snapshots can be downloaded or synchronized through Google Drive, discovered/adopted on an empty installation, preflighted, and applied by a rollback-capable helper. Host files, deployment secrets, and Docker image layers remain explicit external dependencies; see Instance disaster recovery - Google Drive backup setup — follow the step-by-step OAuth guide to configure the Google Cloud client, link an account, and verify recovery
- Controlled custom images — approved-base Dockerfile fragments and bounded uploaded contexts build asynchronously into immutable digest-pinned OCI catalog versions; the approved OCI source and packaged VM bootstrap produce a local Incus image, with test workers, promotion/rollback and source retention
- Git-backed image recovery — optional public/private GitHub catalog sync with conflict preservation, fine-grained PAT or short-lived GitHub App authentication, branch/PR workflows, Actions dispatch, and immutable GHCR recovery references
- Administrative VMs and internal MCP — dedicated platform and group admin VMs with persistent terminal/editor/desktop workspaces, private management networks, Codex auto-discovery with rotating short-lived workload identity, live fail-closed tool policy, audited calls, native worker-console access, and optional dashboard review of immutable configuration proposals
- Worker plugin catalog — scoped, versioned declarative plugins with bounded command/resource manifests, authenticated sandboxed private panes, per-worker lifecycle control, and a narrow worker-self MCP interface; see Worker plugins
- Centralized logging — runtime-aware worker logs plus orchestrator/Traefik logs, NDJSON storage, rotation and live dashboard viewing; platform admins can read bounded, redacted server logs through MCP and download filtered JSONL
- Theme toggle — switch between system default, light, and dark mode
- API docs — auto-generated OpenAPI 3.1.0 spec with interactive Scalar UI at
/api/docs
The orchestrator and Traefik still run in Docker. On a prepared host, enable Incus
through the rollout guide and
docker-compose.incus.yml. The tested VM deployment
is Ubuntu 24.04 amd64 with KVM; publishing an arm64 OCI image does not establish
arm64 VM support. Native VMs use a 4 GiB memory default when no environment or
shared limit is set; operator configuration can override it.
Existing ordinary Docker workers migrate only through an explicit platform-admin operation. Successful migration retains the stopped Docker source for rollback until deliberate finalization. New and rebuilt platform/group admins require Incus VMs and fail closed when native provisioning is unavailable; existing Docker admin data needs an explicit operator transfer. See administrative networking.
Approved custom images remain OCI software sources. Agentor derives a local VM image using the packaged bootstrap rather than treating a Docker image as a VM disk. Rebuild preserves canonical persistent volumes; arbitrary changes to the root filesystem need a custom image, setup script or selected persistent path.
Intel UHD620 mediated GPU use has passed real migration, rebuild, host reboot and Whisper/Vulkan workload checks. Native mdev profiles and full physical GPU passthrough are available through platform-admin Hardware controls; see NVIDIA vGPU setup. Raw PCI, direct SR-IOV and native-context assignment remain unsupported. Physical USB attach/detach/revocation acceptance is still open in #12. Native-admin encrypted disaster recovery and compound updater/recovery tests remain tracked in #13; representative backup performance in #10; browser terminal retests in #7, #14 and #15.
The internal administrative MCP's current UI/API parity, intentional secret and streaming boundaries, capability policy, and remaining gaps are documented in Management MCP parity.
Whole-instance backup creation, Google Drive discovery/adoption, verification, restore preflight, and staged restore are also available through the platform-management MCP as durable asynchronous jobs. Recovery-key reveal and export remain fresh-reauthenticated human actions. See Instance disaster recovery.
Start the Docker control plane from GHCR; VM operation also requires the host preparation linked below.
curl -fsSL https://raw.githubusercontent.com/candlelightner/agentor/main/install.sh | bashThis downloads docker-compose.yml and .env into the current directory. Then:
docker compose up -d- Open http://localhost:3000 and create your admin account
- Click your name in the sidebar footer → Account → fill in API keys / GitHub token, or follow the Agent login (per user) section to sign in via OAuth
The installer downloads the Docker control-plane configuration; it does not prepare Incus. Follow the VM rollout guide before creating VMs or administrative workspaces.
.env only contains orchestrator-wide settings (logging, Traefik, dashboard auth). All agent API keys, the GitHub token, and any custom env vars are configured per user from the dashboard.
- Docker Engine 24+ with Compose v2 for the control plane
- For VM workers and administrative workspaces: a prepared Linux/KVM host, Incus and the operator-generated restricted-project/TLS configuration from the rollout guide
-
Copy the example file:
cp .env.example .env
-
Edit
.envif you want to override any orchestrator-wide settings (VM settings require host preparation). All user-scoped secrets — agent API keys, GitHub token, custom env vars — are configured per user from the Account modal in the dashboard, not via.env.
Development mode mounts the orchestrator source code into the container with hot reload.
-
Build the worker image locally (Traefik is pulled from Docker Hub automatically):
docker build -t agentor-worker:latest ./worker
-
Start the dev server:
docker compose -f docker-compose.dev.yml up
-
Open http://localhost:3000 — you'll be redirected to
/setupto create the first admin account on a fresh install.
Production mode uses pre-built OCI images from GHCR. Native VM image conversion happens locally after host preparation; see the rollout guide.
docker compose -f docker-compose.prod.yml up -dNote
The production compose file sets WORKER_IMAGE_PREFIX=ghcr.io/candlelightner/ so the orchestrator pulls this fork's worker image from GHCR automatically. Docker will pull images on first container creation.
Note
The Traefik reverse proxy (agentor-traefik) is managed automatically by the orchestrator and handles both port mappings and domain mappings on the same container. It is created when the first port/domain mapping is added (or the dashboard subdomain is configured) and removed when all of those are gone. Mapped ports are arbitrary — no fixed ranges — but 80/443 are reserved when domain routing is active.
The image workflow builds these OCI images for amd64 and arm64:
ghcr.io/candlelightner/agentor-worker— the worker software base used by the VM converter.ghcr.io/candlelightner/agentor-orchestrator— the control plane and its matching VM bootstrap assets.
Pull requests validate and build without publishing. Applicable successful main,
release-tag and manual runs publish multiarchitecture manifests to GHCR. Main
uses latest, main and sha-… tags; releases also use semantic-version tags.
VM disks, workspaces and backup data stay on the host and are never published.
Publishing does not rebuild existing VMs. Worker Apply stages and converts the approved OCI update before promoting the native default; existing workers retain their pinned source. See native image updates for configuration, failure handling and remaining live acceptance.
Each user signs in to their own agent subscriptions and stores their own API keys. There is no shared credential pool — what you log in to is yours, and the same tokens are reused across all of your workers.
Log in once inside any of your workers — the agent CLI writes its OAuth token into your account, and every other worker you create (or restart) inherits it automatically.
| Agent | Command |
|---|---|
| Claude (Pro/Max) | claude → /login |
| Codex (ChatGPT) | codex login --device-auth |
| Gemini (Code Assist) | gemini → /auth |
Important
OAuth refresh tokens rotate on use. Always log in inside a worker — never copy tokens from your local machine, or both copies will desync and break authentication on both sides.
Tokens live at <DATA_DIR>/users/<your-user-id>/credentials/{claude,codex,gemini}.json (and Kilo's shared auth at <DATA_DIR>/users/<your-user-id>/kilo/data/auth.json). To force a fresh login, click Reset next to the agent in Account → Agent OAuth credentials. (Kilo is a fourth Account credential row; it has no usage monitoring and no separately installed Kilo CLI — the Kilo Code experience is delivered via the kilocode.kilo-code@7.4.16 code-server extension preinstalled in the worker image. Kilo's complete ~/.local/share/kilo data directory — login, provider API keys configured through Kilo's VS Code UI, and Kilo SQLite sessions/history — is shared per user across that user's workers via a directory bind, which is required because Kilo atomically temp+renames auth.json.)
Open the sidebar footer, click your name, then Account → API keys & tokens. Set any of:
ANTHROPIC_API_KEY/CLAUDE_CODE_OAUTH_TOKENOPENAI_API_KEYGEMINI_API_KEYGITHUB_TOKEN(used for cloning private repos andghinside your workers)
You can also add arbitrary KEY=value pairs in Custom environment variables — these get exported into every worker you create.
Codex can use a self-hosted gateway, proxy, or load balancer that implements the OpenAI Responses API. Codex's user-level ~/.codex/config.toml is per-worker, so use a custom Environment setup script to distribute the same provider configuration while keeping the API key in the owning user's Account variables.
- Open Environments, click New (the built-in Default environment is read-only), and give the environment a name.
- Paste the script below into Setup Script. Replace only
CODEX_MODEL,CODEX_BASE_URL, and optionallyCODEX_API_KEY_ENV. - Under Account → API keys & tokens, add the variable named by
CODEX_API_KEY_ENVwith the secret as its value. - Select the custom Environment when creating a worker. For an existing worker, assign the Environment and rebuild it.
#!/bin/bash
set -euo pipefail
CODEX_MODEL="your-model-id-or-stable-alias"
CODEX_BASE_URL="https://api.example.com/v1"
CODEX_API_KEY_ENV="CUSTOM_CODEX_API_KEY"
install -d -m 700 "$HOME/.codex"
tmp_file=$(mktemp "$HOME/.codex/config.toml.XXXXXX")
trap 'rm -f "$tmp_file"' EXIT
cat > "$tmp_file" <<EOF
model = "$CODEX_MODEL"
model_provider = "custom_endpoint"
# Enable only when the endpoint supports the Responses API hosted web-search tool.
web_search = "disabled"
[model_providers.custom_endpoint]
name = "Custom OpenAI-compatible endpoint"
base_url = "$CODEX_BASE_URL"
env_key = "$CODEX_API_KEY_ENV"
wire_api = "responses"
request_max_retries = 4
stream_idle_timeout_ms = 300000
[projects."/workspace"]
trust_level = "trusted"
[mcp_servers.playwright]
command = "npx"
args = ["-y", "@playwright/mcp@latest"]
[mcp_servers.chrome-devtools]
command = "npx"
args = ["-y", "chrome-devtools-mcp@latest"]
EOF
chmod 600 "$tmp_file"
mv "$tmp_file" "$HOME/.codex/config.toml"
trap - EXITThe endpoint must support /v1/responses, streaming response events, and tool calls; a Chat-Completions-only endpoint is not sufficient. Custom providers authenticated through env_key are not automatically populated from /v1/models, so configure a stable model ID or gateway alias. Set web_search = "live" only when the endpoint implements the hosted web-search tool; otherwise add a search MCP such as Tavily. For restricted-network Environments, add the endpoint hostname (and any MCP API hostname) to the allowed domains.
Note
The setup script intentionally manages the complete Codex config on every worker start and retains Agentor's workspace trust plus Playwright and Chrome DevTools MCP defaults. Account variable changes require rebuilding existing workers because container environment variables are fixed at creation time.
For a credential-safe, reproducible example using the exact Codex-LB, OmniRoute, and Tavily MCP upstreams, see Reference routed-agent workflow. It distinguishes automated Agentor setup from the third-party login steps that only the account holder can complete.
The control plane keeps account/configuration state and backup metadata in its
/data mount, backed by ./data/ or a named Docker volume. Native VM disks and
persistent worker volumes live separately in the configured Incus storage pool
(INCUS_STORAGE_POOL); set that pool up on the intended host drive or SSD.
Converter scratch can use a separate INCUS_CONVERTER_STORAGE_POOL.
To use a Docker named volume for the control plane, change its /data mount:
# Directory mode (default):
- ./data:/data
# Volume mode:
- agentor-data:/dataThe control-plane storage mode is auto-detected from the mount type. Legacy
Docker workers in directory mode use
./data/users/<userId>/workspaces/<workerId>/. Native workspace/agent state uses
Incus custom filesystem volumes, while optional Docker data uses a guest block
volume; rebuild replaces compute while retaining those volumes. Other root-disk
paths are not automatically persistent.
Canonical workspace/agent virtiofs mounts currently use io.cache=unsafe for
SQLite shared-memory compatibility and require exclusive access by the owning
guest while running. Shared account and authorized host mounts retain their own
policies. Back up control-plane state, native persistent data and recovery keys;
./data/ alone is not a complete VM backup.
| Port | Binding | Purpose |
|---|---|---|
3000 |
127.0.0.1 |
Web dashboard (includes proxied desktop and editor access) |
80, 443 |
0.0.0.0 |
Traefik reverse proxy for domain routing (only when BASE_DOMAINS is set) |
| user-defined | 127.0.0.1 or 0.0.0.0 |
Traefik TCP port mappings (localhost or external type, one entrypoint per mapping) |
Agentor has mixed provenance. Upstream work remains MIT-licensed and retains its original notice; downstream Agentor-specific work is intended for Elastic License 2.0 where the applicable rights holder has authority to grant it. Previously released MIT grants are not revoked. See LICENSING.md, LICENSE, and LICENSE-ELASTIC-2.0.
