Skip to main content

Set Up a Worker

A Worker is what actually runs your agents — a small process you run yourself, next to your own infrastructure or CI. AgentMesh ships a ready-to-use Docker image, so there's no build step on your side.

info

agmesh/claude-base:latest ships JDK 21 + Maven out of the box, so agents can run mvn test against Java repos out of the box. Need another toolchain (Go, Rust, .NET, ...)? See step 6.

1. Get an enrollment token

Org admin only: Workers menu → Enrollment TokensCreate token. The plaintext token is shown once — copy it immediately, it can't be retrieved again.

2. Find your organization ID

Pick your organization in the switcher at the top of the page — its ID is shown right there. (Or open Organizations, each org's detail view shows its ID.)

3. Copy this docker-compose.yml

Fill in the two marked lines, then start it — no build step, this pulls the published image:

services:
worker:
image: agmesh/claude-base:latest
restart: unless-stopped
environment:
AGENTMESH_WORKER_ID: my-worker-1 # pick a unique name
AGENTMESH_ORG_ID: "1001" # <- your organization id, from step 2
AGENTMESH_ENROLLMENT_TOKEN: "wtok_..." # <- from step 1, keep secret
volumes:
- agentmesh-home:/home/agentmesh # persists your one-time Claude login
- agentmesh-runtime:/var/lib/agentmesh # persists run workspaces across restarts
volumes:
agentmesh-home:
agentmesh-runtime:

4. Log in to Claude (one-time) & start

docker compose run --rm worker claude auth login
docker compose up -d

The login persists in the agentmesh-home volume — upgrading the image later doesn't remove it.

5. Verify

docker compose logs -f worker

Then check Workers. A new worker first appears as Pending approval. An organization admin must approve it, which changes it to Online. If it remains pending, do not regenerate the enrollment token—the worker has already claimed it.

6. Add more tools (optional)

Write your own Dockerfile on top of the base image — USER root to install, then back to USER agentmesh before it ends, or the worker ends up running as root:

FROM agmesh/claude-base:latest
USER root
RUN curl -fsSL https://go.dev/dl/go1.23.4.linux-amd64.tar.gz | tar -xz -C /opt \
&& ln -s /opt/go/bin/go /usr/local/bin/go
USER agentmesh

Build it, then point your docker-compose.yml's image: at the result instead of agmesh/claude-base:latest.

Next

With a worker online, move on to Connect a Git Repository.