Use yacht-agent when you want a remote Docker host to be managed by a central Yacht server without exposing the remote Docker API directly.
YACHT_SERVER_URL: the base URL of the main Yacht server, with or without/apiYACHT_AGENT_ENROLLMENT_TOKEN: shared token matchingAGENT_ENROLLMENT_TOKENon the main Yacht server
YACHT_AGENT_NAME: logical host name shown in Yacht; defaults to the system hostnameYACHT_AGENT_VERIFY_SSL:trueorfalse; defaulttrueYACHT_AGENT_HEARTBEAT_INTERVAL: heartbeat interval in seconds; default30YACHT_AGENT_JOB_POLL_INTERVAL: job polling interval in seconds; default5YACHT_AGENT_VERSION: manual version override; default0.1.0YACHT_AGENT_LOG_LEVEL: log level; defaultINFOYACHT_AGENT_STATE: state file path; default/config/agent-state.json
The repo includes agent/docker-compose.yaml.
Example:
services:
yacht-agent:
image: ghcr.io/yacht-sh/yacht-agent:dev-latest
container_name: yacht-agent
restart: unless-stopped
environment:
YACHT_SERVER_URL: https://yacht.example.com
YACHT_AGENT_ENROLLMENT_TOKEN: replace-with-shared-enrollment-token
YACHT_AGENT_NAME: remote-docker-host
YACHT_AGENT_VERIFY_SSL: "true"
YACHT_AGENT_HEARTBEAT_INTERVAL: "30"
YACHT_AGENT_JOB_POLL_INTERVAL: "5"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- yacht-agent-config:/config
volumes:
yacht-agent-config:Start the agent:
docker compose -f agent/docker-compose.yaml up -d- Set
AGENT_ENROLLMENT_TOKENon the main Yacht server. - Set the same value as
YACHT_AGENT_ENROLLMENT_TOKENon the agent. - Start the agent container.
- The agent registers with the main Yacht server.
- The host appears in Yacht as an
agentconnection type.
View the running agent logs:
docker logs -f yacht-agentSuccessful startup should show:
- registration accepted
- heartbeat accepted
- inventory sync accepted
The agent stores its issued token and server-linked identifiers in:
/config/agent-state.json
If you need to force re-registration, remove that state and restart the container.
Example:
docker exec yacht-agent rm -f /config/agent-state.json
docker restart yacht-agentThe agent currently supports:
- registration
- heartbeat
- inventory sync
- queued container actions
The agent does not yet fully support:
- compose execution
- deploy jobs
- log streaming
- stats streaming
- image, volume, and network mutation