Server reference
Advanced install & configuration
The full reference for installing and configuring AgentsServer. For day-to-day commands (update, token, restart, logs) see Manage your server; for a first-time walkthrough see the Setup guide.
Requirements
- Host: Linux, or Apple-silicon macOS. Intel macOS is not supported; the installer stops before changing anything.
uvpreinstalled onPATH(brew install uvon macOS; your distro's package manager on Linux). It provisions the isolated Python 3.10+ runtime. The installer never downloads a bootstrap script.- Any provider CLIs you plan to use — Claude Code, Codex, or Cursor — installed and signed in on the host, in the same user account that runs the server.
- tmux (optional) — enables the in-app terminal, live pane inspection, and in-app managed updates. On macOS with Homebrew, the installer offers to install it; otherwise it prints the command and continues.
- Tailscale (optional) — for reaching the server from other devices without exposing the port.
- A working user service session:
launchctl(macOS) orsystemctl --user(Linux). Nosudois ever used.
Installer options
./install.sh [--port PORT] [--bind ADDRESS] [--release-version VERSION]
[--non-interactive] [--allow-port-fallback | --no-port-fallback]
[--show-token] [--instance NAME]
--port PORT— pin an exact port. Without it the default is7850.--bind ADDRESS— address to listen on. Default0.0.0.0(all interfaces, so other devices can connect).--release-version VERSION— install a specific published release instead of the latest.--non-interactive— never prompt (skips the tmux offer and clipboard copy). Use for scripts and SSH-driven runs.--allow-port-fallback/--no-port-fallback— control automatic nearby-port selection (see below).--show-token— print the access token and exit without reinstalling or restarting.--instance NAME— act on a named instance instead of the default server. See Multiple servers.
Every run is idempotent: it keeps the previous healthy release for rollback, preserves the access token and configuration, and never touches chat state. A failed run leaves the active release unchanged and prints recovery guidance. An install lock stops a cancelled SSH attempt from racing a retry.
Ports & bind address
If the default port is already held by something that isn't the AgentsServer being replaced, the installer reports the listener (using lsof when available) and picks one of up to five higher free ports. The chosen port is printed at the end of the run.
--portalone pins that exact port and fails if it's taken.--port … --allow-port-fallbacklets an explicit port fall back to a nearby free one.--no-port-fallbackdisables fallback for the default port too.
Bind to 0.0.0.0 (default) to accept connections from other devices; bind to 127.0.0.1 only if the app runs on the same machine. A server bound to loopback is not reachable over Tailscale.
Remote access (Tailscale)
Remote access is expected to go through Tailscale, which keeps the server reachable from phones, tablets, and laptops without publishing the port on the internet. It is optional; the installer only prints a reminder if Tailscale isn't on the host.
On the server:
tailscale status tailscale ip -4
On each device, join the same tailnet and use the server URL:
http://<tailscale-ip>:7850
If a browser on the device can open /api/health but the app can't connect, check that the device is on Tailscale, the URL includes the port, the same access token is entered in the app, and the server is bound to 0.0.0.0 (not only 127.0.0.1).
Never expose port 7850 to the public internet. Use Tailscale or another private network, and keep the access token enabled.
Access tokens
The installer generates a private bearer token and prints it once. It is required for every HTTP call, upload, file/video fetch, and WebSocket stream. Retrieve it any time with:
./install.sh --show-token
Clients send it as Authorization: Bearer <token> (or the X-AgentsDock-Token header). When running the server manually, set AGENTSDOCK_AGENT_TOKEN yourself; leave it unset only for trusted local development.
Manual install & run
If you'd rather not use the installer or the service, run the server directly from a checkout:
git clone https://github.com/ZhengyiLuo/AgentsServer.git cd AgentsServer uv venv uv sync --frozen # confirm the CLIs work in this same shell/user command -v claude && claude --version command -v codex && codex --version export AGENTSDOCK_AGENT_TOKEN='replace-with-a-long-random-token' uv run python agent_server.py serve --bind 0.0.0.0 --port 7850
Check it from the server machine:
curl -H 'Authorization: Bearer replace-with-a-long-random-token' http://127.0.0.1:7850/api/health
Use AGENTSDOCK_STATE_DIR to keep state somewhere other than ~/.agentsdock, and AGENTSDOCK_BACKEND if you only install one of the CLIs.
Service templates
The installer creates and manages the user service for you: the LaunchAgent com.agentsdock.server on macOS, or agents-server.service on Linux. You only need the template below for custom deployments.
mkdir -p ~/.config/systemd/user cp systemd/agents-server.service.example ~/.config/systemd/user/agents-server.service systemctl --user daemon-reload systemctl --user enable --now agents-server.service systemctl --user status agents-server.service --no-pager -l
Start, stop, restart, and log commands for both platforms are on Manage your server.
Environment variables
Most settings are environment variables read by the server. New configurations should use the AGENTSDOCK_* names; historical ZENITHBOT_* / ZENITHDOCK_AGENT_TOKEN names are accepted only as compatibility aliases. Defaults in parentheses.
Network & access
AGENTSDOCK_AGENT_BIND— bind address (0.0.0.0)AGENTSDOCK_AGENT_PORT— port (7850)AGENTSDOCK_AGENT_TOKEN— shared bearer token (unset)
Paths
AGENTSDOCK_STATE_DIR— session, job, and file state (~/.agentsdock)AGENTSDOCK_AGENT_CWD— default working directory for new chats (your home)AGENTS_SERVER_INSTALL_DIR— versioned runtime root (~/.local/share/agents-server)CLAUDE_PROJECTS_ROOT— Claude history search root (~/.claude/projects)CODEX_SESSIONS_ROOT— Codex history search root (~/.codex/sessions)
Backends
AGENTSDOCK_BACKEND— default backend,claudeorcodex(claude)CLAUDE_BIN/CODEX_BIN— executable name or path (claude/codex)AGENTSDOCK_CLAUDE_TRANSPORT— interactive Claude transport:auto,agent-sdk, orprint(auto)AGENTSDOCK_CLAUDE_SDK_IDLE_TTL_SECONDS— idle per-chat SDK client retention (300)AGENTSDOCK_CLAUDE_SDK_MAX_LOADED_CHATS— maximum retained per-chat SDK clients (4)AGENTSDOCK_RUNTIME_CATALOG_TIMEOUT_SECONDS— per-command CLI version/help/model probe timeout (6)AGENTSDOCK_CLAUDE_AUTH_PROBE_TIMEOUT_SECONDS— timeout forclaude auth status(15)AGENTSDOCK_RUNTIME_DIAGNOSTIC_TTL_SECONDS— cache lifetime for CLI version/auth probes (60)
Jobs & guardrails
AGENTSDOCK_JOB_MAX_ACTIVE_RUNS— scheduled-job concurrency cap;0disables (0)AGENTSDOCK_MAX_ACTIVE_AGENT_RUNS— server-wide cap for chat, cron, and goal runs;0= no limit (0)AGENTSDOCK_JOB_MIN_AVAILABLE_MEM_MB— job launch memory guardrail (4096)AGENTSDOCK_MIN_START_AVAILABLE_MEM_MB— interactive launch memory guardrail (2048)AGENTSDOCK_CODE_DIFF_SNAPSHOT_TIMEOUT_SECONDS— max time per isolated Git worktree snapshot (120)
Context digests
AGENTSDOCK_HANDOFF_DIGEST_BACKEND—claudeorcodex(claude)AGENTSDOCK_HANDOFF_DIGEST_MODEL— model (sonnet)AGENTSDOCK_HANDOFF_DIGEST_EFFORT— optional reasoning/effort setting (unset)AGENTSDOCK_HANDOFF_DIGEST_TIMEOUT_SECONDS— summarizer timeout (180)AGENTSDOCK_HANDOFF_DIGEST_CHARS— final digest character cap (56000)
File locations
~/.agentsdock— state: chats, jobs, files, uploads, tokens, secure-peer credentials~/.config/agents-server— generated configuration and the access token~/.local/share/agents-server— versioned releases;currentpoints at the active one~/Library/Logs/AgentsServer/(macOS) ·journalctl --user -u agents-server.service(Linux) — logs
Named instances use sibling paths of their own — see Where each instance lives.