agent-swarm.devagent-swarm.dev

Getting Started

Install Agent Swarm, configure your first lead and worker agents, and run your first multi-agent task in minutes

This guide walks you through setting up a fully operational Agent Swarm with a lead agent and workers.

Agent Swarm supports multiple AI providers via the harness system. The default is Claude Code (recommended), with Codex, opencode, pi-mono, Devin, Claude Managed Agents, Amp, Cursor, Grok, fx, DeepSeek dsh, and ACP-compatible agents also supported. See the Harness Configuration guide for details.

Prerequisites

Using Templates

Agent Swarm ships with official templates that give your agents pre-configured identities, skills, and setup scripts. Instead of starting from scratch, pick a template that matches the role you need.

TemplateRoleBest for
LeadleadOrchestrating workers, decomposing tasks, coordinating projects
CoderworkerImplementation, PRs, code reviews
ResearcherworkerWeb research, analysis, documentation
ReviewerworkerCode review, quality assurance
TesterworkerTesting, validation, CI/CD
Forward Deployed EngineerworkerClient-facing work, rapid prototyping

To use a template, set the TEMPLATE_ID environment variable when starting an agent:

# Use the coder template for a worker
TEMPLATE_ID=official/coder docker compose up worker-1 -d

# Use the lead template
TEMPLATE_ID=official/lead docker compose up lead -d

Templates are fetched from the Templates Registry and cached locally for 24 hours. You can also create your own templates and contribute them to the community.

Browse all available templates at templates.agent-swarm.dev.

docker-compose.example.yml is the reference deployment for every option below. Deploy every agent in it by default (1 lead and 11 workers on the official templates), and trim the roster only when you have a reason to.

No server yet? Deploy one

One-click deploy sets up a cloud server with HTTPS from one cloud-init paste: Docker, Caddy on <ip>.sslip.io or your domain, and the swarm. It also tracks the DigitalOcean 1-Click and Railway template options.

To look around before you pick a server, try it for an hour on E2B. That is a trial: the database is deleted with the sandboxes.

The fastest way to get a full swarm running. The interactive wizard collects credentials, generates docker-compose.yml + .env, starts the stack, and verifies health.

bunx @desplega.ai/agent-swarm onboard

Or use the one-shot installer. It checks Docker and Compose v2, installs Bun when missing, runs onboard --yes --preset full (every official template) in ~/agent-swarm, waits for /health, and prints the dashboard /setup link:

curl -fsSL https://agent-swarm.dev/install.sh | bash
# Options: --dir <path>, --version <ver>, --tunnel, --no-tunnel, --public-url <url>, --bind <addr>, --no-agent-fs, --dry-run
curl -fsSL https://agent-swarm.dev/install.sh | bash -s -- --no-tunnel

The raw GitHub URL (https://raw.githubusercontent.com/desplega-ai/agent-swarm/main/install.sh) serves the same script. Behind your own reverse proxy, pass --public-url https://<host> (sets PUBLIC_MCP_BASE_URL, no tunnel, and the /setup link uses it) and --bind 127.0.0.1 (publishes the ports on loopback only, because Docker-published ports bypass host firewalls). The installer exposes the API through localtunnel and sets PUBLIC_MCP_BASE_URL, so the dashboard works from anywhere. The API key still protects every route except /health. Pass --no-tunnel (or set AGENT_SWARM_TUNNEL=0) to keep the API local. The tunnel stays off when .env already holds your own PUBLIC_MCP_BASE_URL. --tunnel forces it on. The installer saves an explicit choice as AGENT_SWARM_TUNNEL in .env, so a re-run keeps it.

A new install also runs two more services: agent-fs (shared files on local disk, read in the dashboard's Comb) and tei (a local embeddings server for memory search, so memory needs no second API key). Comb is on, and file links open in the dashboard. Neither service has a host port: the browser reaches agent-fs through the API at /agentfs. The bundle adds about 1 GB of RAM at idle, 2.5 GB of images and 1.5 GB of volumes, and the first boot downloads about 1.5 GB. Memory search uses keywords only until TEI is ready. Pass --no-agent-fs to the installer (or to onboard --yes) to skip both. Running the installer again on an existing install changes nothing: when docker-compose.yml exists, it skips onboarding and only starts the stack. See agent-fs Co-deployment.

Or in non-interactive mode with a preset:

ANTHROPIC_API_KEY=sk-... bunx @desplega.ai/agent-swarm onboard --yes --preset=full

Available presets: full, dev, content, research, solo. Use full by default: it deploys the same official templates as the Compose example, with one coder where the example runs two. The interactive wizard preselects it. Use --max-concurrent-tasks to set each generated agent's task capacity from 1 to 100 (defaults: lead 2, worker 1), or --dry-run to preview without writing files. --yes no longer requires a Claude, OpenAI or OpenRouter credential: without one, workers wait in credential-wait until you add a credential on /setup (Bedrock settings stay required). It stops after the health check instead of opening the post-deploy prompts. When the wizard finishes, it prints a dashboard URL that already includes the generated apiUrl and apiKey, so the dashboard opens with the connection filled in. Check the address, then click Connect.

Fresh self-hosted installs also seed a disabled starter catalog of schedules and workflows. Each bundled automation declares the parameters and integrations it needs. When you enable one with missing setup, Agent Swarm marks it needs_setup, shows the missing fields in the dashboard, and does not dispatch it until configuration is complete.

Option B: Manual Docker Compose

Set up manually with Docker Compose for full control. Start from docker-compose.example.yml and keep every agent service in it by default.

git clone https://github.com/desplega-ai/agent-swarm.git
cd agent-swarm

# Configure environment
cp .env.docker.example .env
# Edit .env — set API_KEY and CLAUDE_CODE_OAUTH_TOKEN at minimum
# Optionally set TEMPLATE_ID=official/coder for workers, TEMPLATE_ID=official/lead for leads

# Create the secrets encryption key (back it up with the database)
openssl rand -base64 32 > encryption_key
chmod 600 .env encryption_key

# Start everything
docker compose -f docker-compose.example.yml --env-file .env up -d

The API runs on port 3013. For the dashboard, use the hosted app.agent-swarm.dev or run it yourself — see Dashboard UI.

Agent ID variables in .env are optional. Each container generates a UUID on first boot and keeps it in its personal volume. Set one only to keep an existing identity or to survive removing volumes. The Compose example mounts encryption_key as a secret, so create it before the first up; see Secrets Encryption.

Finish setup in the browser

Open the dashboard and connect it to http://localhost:3013 with your API_KEY. A new install redirects to /setup, a guided first run that checks the API, then walks through naming the swarm, how you heard about us (optional), AI providers, agents and their models, memory, integrations, your files account (only while Comb is on), and a first task. Existing installs skip it.

Option C: Local API + Docker Workers

Run the API locally and connect Docker workers to it.

git clone https://github.com/desplega-ai/agent-swarm.git
cd agent-swarm
bun install

# 1. Configure and start the API server
cp .env.example .env
# Edit .env — set API_KEY
bun run start:http

In a new terminal, start a worker:

# 2. Configure and run a Docker worker
cp .env.docker.example .env.docker
# Edit .env.docker — set API_KEY (same as above) and CLAUDE_CODE_OAUTH_TOKEN
bun run docker:build:worker
mkdir -p ./logs ./work/shared ./work/worker-1
bun run docker:run:worker

Option D: Claude Code as Lead Agent

Use Claude Code directly as the lead agent — no Docker required for the lead.

# After starting the API server (Option C, step 1):
bunx @desplega.ai/agent-swarm connect

This configures Claude Code to connect to the swarm. Start Claude Code and tell it:

Register yourself as the lead agent in the agent-swarm.

Verifying Your Setup

Once your swarm is running, you can verify it's working:

  1. Check the API — Visit http://localhost:3013/health
  2. Check agents — Use the dashboard or API to see registered agents
  3. Send a test task — Message the lead agent via Slack or the API

Configuration

Required Environment Variables

VariableDescription
API_KEYSecret key for API authentication
CLAUDE_CODE_OAUTH_TOKENOAuth token for Claude CLI (default provider)

Credential requirements depend on your chosen harness provider. See Harness Configuration for alternatives like ANTHROPIC_API_KEY or OPENROUTER_API_KEY.

Optional Variables

VariableDefaultDescription
PORT3013API server port
HARNESS_PROVIDERclaudeAI provider: claude, codex, opencode, pi, devin, claude-managed, acp, dsh, amp, cursor, grok, or fx. See Harness Configuration
AGENT_IDAuto-generatedStable UUID for task resume
AGENT_NAMEAuto-generatedDisplay name for the agent
AGENT_ROLEworkerRole: worker or lead
MCP_BASE_URLhttp://host.docker.internal:3013MCP server URL

For the complete list, see Environment Variables.

Next Steps

On this page