Skip to content

Self-hosted ORC ​

This page covers running ORC on a server next to the ORC on your laptop: deploying it, connecting clients and agents to both, moving sessions and work to the server, and copying artifacts between the two.

Two installations, not one cluster ​

A laptop ORC and a server ORC are two independent installations. Each has its own database, config, secret, projects and runner. ORC does not replicate or federate between installations. What moves between them moves through explicit transfers, listed on this page.

Laptop ORCServer ORC
Typical installDesktop app or orc daemon startDocker Compose
Addresshttp://127.0.0.1:7700https://orc.example.com behind a reverse proxy
Data~/.orc on the laptop/data (ORC_HOME) inside the container, on a volume
Agents run onThe laptop (or its SSH execution host)The container (or its SSH execution host)
Sees live sessions fromAgents on the laptopAgents in the container or its SSH host

Deploy the server ​

Compose file ​

Use the repository's docker-compose.yml. Put secrets in a .env file next to it:

bash
# .env
ORC_API_SECRET=<output of: openssl rand -hex 32>
ANTHROPIC_API_KEY=sk-ant-...
OPENAI_API_KEY=sk-...

Add what a server needs to the environment: list:

yaml
      - ORC_AGENT_LOOP_ENABLED=true      # the task loop is off by default
      - ORC_AGENT_LOOP_MAX_WORKERS=2
bash
docker compose up -d
docker compose exec orc bun run packages/cli/src/index.ts doctor
curl -fs http://127.0.0.1:7700/api/health

The image includes Node, ACPX, Claude Code and Codex CLI. The default backend is claude through the Anthropic SDK. Installed tools do not bring credentials: set ANTHROPIC_API_KEY for claude, OPENAI_API_KEY or a container Codex login for codex-cli.

Volumes ​

MountHoldsRequired
orc-data:/dataORC_HOME: orc.db, secret.key, config.json, knowledge originals, logs, daemon PID/log filesYes
orc-home:/home/bunAgent CLI logins and session histories; user flows, agents, packages, handoffs and live-session files under ~/.orcOptional
${HOME}/.ssh:/ssh-host:roSSH keys and config, copied into /home/bun/.ssh at startOnly for Git over SSH or an SSH execution host
Your repositoriesCheckouts that projects point atFor any agent work

WARNING

The container runs as user bun with HOME=/home/bun. ORC_HOME=/data is the data root, so docker run with only -v orc-data:/data keeps projects, tasks, settings and encrypted secrets across container replacement. An existing deployment that stored its database in /home/bun/.orc has that state moved into /data on the first start of the updated image.

Project folders are container paths. Mount a repository, for example - /srv/repos/my-app:/repos/my-app, and set the project's folder to /repos/my-app.

Binding and authentication ​

The image sets ORC_API_HOST=0.0.0.0. The Compose file publishes the port on 127.0.0.1:7700 only, so the reverse proxy is the only way in. Keep it that way.

ORC_API_SECRET turns on authentication. Without it, every endpoint is open, including job execution. The daemon logs a SECURITY: warning when it binds a non-loopback address without a secret.

PathAuth
/api/*, /openapi.json, /docs, /mcpBearer secret, Bearer access token, or browser session cookie
/health, /api/health, /api/auth/session, /api/auth/tokenPublic
Webhook receiversPer-source HMAC signature
Handoff upload, session-sync, skill download, scratchpad content URLsSigned, scoped, expiring capability in the URL

Credential options for clients:

CredentialHow to get itLifetime
The API secretORC_API_SECRETUntil you change it
Access tokenPOST /api/auth/token with {"secret": "...", "expires_at": <unix seconds>}Default api.session_days (30), at most 365 days
Browser sessionSign in on the dashboard with the secretapi.session_days
bash
curl -s https://orc.example.com/api/auth/token \
  -H 'Content-Type: application/json' \
  -d "{\"secret\":\"$ORC_API_SECRET\"}"
# {"token":"eyJ...","expires_at":1767225600}

Give laptops and agents an access token instead of the secret. Rotating the secret revokes every token and browser session. Authentication is installation-wide: anyone with a credential has full access. There are no per-user accounts.

TLS and reverse proxy ​

ORC serves plain HTTP. Terminate TLS in a reverse proxy. The proxy must:

  • preserve the Host header and send X-Forwarded-Proto: https. ORC builds handoff, session-sync and download links from them; the session cookie is marked Secure on HTTPS.
  • pass WebSocket upgrades. Terminals use /api/terminals/{id}/ws.
  • not buffer Server-Sent Events, and allow idle reads of at least 255 seconds. The dashboard's live updates and chat streams use SSE.
  • accept request bodies of at least 64 MiB. Session handoff and archive uploads go up to that size.

Caddy does all of this by default:

text
orc.example.com {
    reverse_proxy 127.0.0.1:7700
}

nginx:

nginx
server {
    listen 443 ssl;
    server_name orc.example.com;
    client_max_body_size 70m;

    location / {
        proxy_pass http://127.0.0.1:7700;
        proxy_http_version 1.1;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-Proto https;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $http_connection;
        proxy_buffering off;
        proxy_read_timeout 300s;
    }
}

Set api.cors_origins (or ORC_API_CORS_ORIGINS) only if a dashboard on a different origin calls this API. The default is same-origin only.

Optional: run agents on an SSH host ​

The server ORC can run agents, terminals, Git and jobs on another machine over SSH instead of inside the container.

  1. Mount ~/.ssh (the Compose file does) with a Host alias for the machine.
  2. Set ORC_API_SECRET. Without it the reverse tunnel exposes an unauthenticated API on the SSH host's loopback.
  3. Select the host: ORC_SSH_HOST=<alias> in the environment (fixed), or the SSH row under Settings → Hosts → Change / PUT /api/ssh.
  4. Check it with the connection test in the SSH row's editor under Settings → Hosts or POST /api/ssh/test. It reports OS, shell, installed agent CLIs and Claude login.

ORC opens a multiplexed SSH connection with a reverse port forward, so agents on that host reach ORC at http://127.0.0.1:<port> and get ORC_API_BASE and ORC_API_SECRET in their environment. The SSH key must allow remote forwarding, or set ssh.remote_port to a port where the API is already reachable. Windows OpenSSH has no connection sharing, so native Windows ORC keeps one ssh -N -R tunnel per host for the callback and opens a separate connection for each command.

Connect a laptop to both ​

Each CLI process, MCP connection and browser tab targets one ORC at a time. The desktop app can remember one remote server in addition to its local daemon. Pick the target per process; switching does not copy data between installations.

CLI ​

The CLI calls the API at ORC_API_BASE with ORC_API_SECRET as the Bearer credential. Unset, it uses the local daemon from ~/.orc/config.json.

bash
orc task list                                   # laptop ORC

export ORC_CLOUD_TOKEN=eyJ...                   # from POST /api/auth/token
alias orc-cloud='ORC_API_BASE=https://orc.example.com ORC_API_SECRET=$ORC_CLOUD_TOKEN orc'
orc-cloud status
orc-cloud task list -p my-app
NoteDetail
Use ORC_API_BASE for HTTPSThe global --host and --port flags always build an http:// URL
Active project is localorc project use writes activeProject to the laptop's config, so it also applies to orc-cloud. Pass -p or set ORC_ACTIVE_PROJECT
Server-side pathsorc mem import/export, orc skill local, orc skill export-to and orc kb sources add read and write folders on the ORC server, not the laptop

Agents (MCP) ​

Connect agents to the server over HTTP MCP. Keep the local ORC as a second server with a different name.

bash
claude mcp add --transport http orc-cloud \
  "https://orc.example.com/mcp?project=my-app" \
  --header "Authorization: Bearer $ORC_CLOUD_TOKEN"

With the spec CLI bridge, register both once and pick per call:

bash
spec add orc-local --mcp-http http://127.0.0.1:7700/mcp \
  --header 'Authorization=Bearer ${ORC_LOCAL_SECRET}'
spec add orc-cloud --mcp-http https://orc.example.com/mcp \
  --header 'Authorization=Bearer ${ORC_CLOUD_TOKEN}'

spec call --spec orc-cloud context --data '{"project":"my-app"}'

/mcp query parameters set connection defaults: project=<name> or projects=a,b, and mode=meta|full. See MCP.

WARNING

Do not point stdio orc mcp at a remote server. Stdio MCP reads and writes the local ~/.orc/orc.db directly for most tools and only forwards a few calls (channels, human requests, session sync and handoff, skill and scratchpad downloads, knowledge-base digests) to ORC_API_BASE. Against a remote server it would split state between two databases. Use HTTP /mcp for any remote ORC.

Hooks and live sessions ​

Session lifecycle hooks and the live-session registry (~/.orc/live-sessions/) are local to the machine. Sessions you run on the laptop appear in the laptop ORC's chat session list only. To get their history onto the server, sync or hand them off (below).

Dashboard and desktop app ​

Open each ORC's dashboard in its own browser tab: http://127.0.0.1:7700 and https://orc.example.com. The server prompts for the secret and keeps a session cookie.

The desktop app keeps its local daemon and can also load a remote server:

  1. Open File → Servers… (or the tray's Servers…). This opens the local dashboard's Settings → Servers.
  2. Choose Add server, enter https://orc.example.com, and optionally an access token and reverse-proxy headers.
  3. Choose Test connection, then Save and use.

The local daemon keeps running, so Use on Local switches back without a restart. Saved servers, tokens and headers are stored in the desktop app's data folder (connection.json), not in the server's ~/.orc/config.json. Use a revocable access token from the server's Settings → Security; leave the token blank to sign in with the server's normal prompt. The CLI and stdio MCP still target the local installation unless you set ORC_API_BASE. The integrated preview browser, local file picker, desktop update controls and native notifications are available only in the local dashboard, so a remote window does not show them. Links and pop-ups in a remote window open in your default browser.

Move work to the server ​

Hand off a running session ​

A handoff moves a Claude Code or Codex conversation from the laptop into a new native session on the server's execution host, in a fresh Git worktree, and opens it in a terminal there. The laptop's original stays untouched.

Prerequisites on the server:

RequirementWhy
The project exists with its folder pointing at a checkout on the execution hostORC creates the worktree inside that repository
The checkout's remote matches the repository you reportORC does not clone arbitrary URLs
Git can fetch from that remote on the execution hostORC fetches the branch and checks the commit
The agent CLI and its credentials are installed thereThe resumed session runs there
Python 3, for an SSH execution hostRemote file operations

Steps, from the laptop session, with orc-cloud connected over MCP:

  1. Commit and push the work. Confirm the remote branch tip equals your HEAD.

  2. Call session_handoff on orc-cloud with project, agent, native session ID, source cwd, repository, branch and the pushed commit. It returns a single-use upload URL valid for 15 minutes.

  3. Upload the transcript with the orc-platform skill's helper:

    bash
    python scripts/upload-session.py --agent claude \
      --session-file ~/.claude/projects/<dir>/<session-id>.jsonl \
      --upload-url '<upload_url>'
  4. On the server dashboard, the chat session list shows the session as Ready to resume. Click it to continue in chat, or copy its resume command from the session viewer.

The worktree is <repo>/.orc/worktrees/<handoff-id> on branch orc/handoff/<handoff-id>. Only Git-tracked state and the native transcript move. Ignored files, dependencies, environment variables and running processes do not. The agent can run the whole sequence when asked to hand off; the orc-platform skill documents it. Details: Session handoff.

Send a session from the dashboard ​

Without involving the agent, open the session's actions menu on the laptop dashboard and choose Send to host…. The picker lists the remote ORC hosts saved under Settings → Hosts; pick the host, then a project on it whose folder is a checkout of the same repository, and send. The laptop ORC snapshots the work (secret-looking files stay local), pushes it to the shared Git remote, uploads the conversation and prepares it on the server. The session shows Ready to resume there and Sent to … on the laptop; the first resumed turn carries a handoff briefing so the agent knows it changed machines. Both installations must reach the same Git remote, and the session must run on the laptop server's own machine. Details: Session handoff.

Sync session history ​

To make laptop history searchable on the server without running anything, sync it into the session archive.

  1. Ask an agent connected to orc-cloud to call session_sync({projects:["my-app"]}). It returns a private grant valid for one hour, scoped to those projects.

  2. Run the helper with the grant on stdin or in a private file:

    bash
    python scripts/sync-sessions.py --grant-file /private/grant.json \
      --project my-app --cwd ~/code/my-app --dry-run
    python scripts/sync-sessions.py --grant-file /private/grant.json \
      --project my-app --cwd ~/code/my-app

    Alternatively pass --url https://orc.example.com with ORC_API_SECRET in the environment. HTTPS is required except on loopback.

Synced sessions appear as archived rows in the chat session list and in session_search. Re-running uploads only changed sessions; diverged histories are kept as conflicts and never overwrite. An archived session can later be opened in the read-only viewer or resumed into chat from its prepare form, which runs the same handoff checks (POST /api/sessions/archive/{id}/resume).

Run tasks on the server runner ​

Tasks run on the installation that holds them. Create them on the server:

bash
orc-cloud task add "Implement user auth" -p my-app --flow orc-default --backend claude

or with task_create / task_batch_create on the orc-cloud MCP connection, or in the server dashboard. With ORC_AGENT_LOOP_ENABLED=true, the server's runner claims queued tasks and runs workers in the container or on its SSH execution host. Review and approve them in the server dashboard, the CLI, or Telegram/Slack connected to the server.

There is no command to move an existing task from the laptop ORC to the server ORC.

Terminals on remote hosts ​

The server dashboard's Terminals open shells and agents on the server. New terminal offers Local (the container) or any Host alias from the server's ~/.ssh/config. The choice scopes launchers, folder browsing, worktrees and Git to that host. Existing terminals keep their host. See Terminal workspace.

Share artifacts between installations ​

ArtifactCopy laptop → serverNotes
Session historysync-sessions.py or handoffSee above
Scratchpadsorc pad pull <id> plan.md, then orc-cloud pad new doc "Plan" -f plan.mdPlans, mermaid docs, Excalidraw diagrams, HTML pages
Skillsorc skill export <name> ./out, then orc-cloud skill create <name> -d ./outIncludes supporting files
Public skillsorc-cloud skill import <github-or-skills.sh source>Fetched by the server
Agent profilesorc agent export <id> ./a.agent.md, then orc-cloud agent create <id> --file ./a.agent.md
Agent packagesorc agent-package export <name> ./pkg, then orc-cloud agent-package import ./pkgFile contents are uploaded
Flowsorc --json flow show <name> | jq .definition > flow.json, then orc-cloud flow create -f flow.jsonOr copy ~/.orc/flows/<name>/flow.json
Knowledge base documentsorc-cloud kb add <kb> ./docs/*.pdfUploads from the laptop. kb sources add registers a folder on the server instead
MemoriesRecreate with orc-cloud mem addmem import/export use folders on the server; copy files into a mounted path first to use them
Tasks, jobs, webhooks, channels, rules, settingsRecreate on the serverNo export or import

Each installation keeps its own secret.key. Encrypted values such as embedding API keys and channel credentials do not transfer; enter them again on the server.

Backup ​

Stop the container, then copy the orc-home volume. It holds orc.db with its -wal and -shm files, knowledge/originals/ and secret.key. Search indexes rebuild on start.

Released under the MIT License.