Deploy with Docker
Putting a2ald in a container serves two purposes: keeping one or more AIDs apart from your personal environment, and running several independent nodes on one machine. The official repository does not ship a prebuilt image yet; here is how to build and run one yourself.
Three constraints inside a container
Section titled “Three constraints inside a container”| Constraint | Notes |
|---|---|
| Ports | 4121/UDP and 4121/TCP must be reachable from outside (QUIC direct connections and ICE signalling); 2121 listens only on the container’s 127.0.0.1 by default |
| One data directory | One data directory can only be used by one a2ald process at a time. Several containers mean several volumes — do not share one data directory |
| Headless | There is no browser in a container, so start with --no-open-browser |
Building an image
Section titled “Building an image”The image only needs the release binaries and a minimal runtime. Replace <version> with a concrete version (say 0.3.3), or point it at latest:
FROM debian:bookworm-slim
RUN apt-get update \ && apt-get install -y --no-install-recommends ca-certificates curl \ && rm -rf /var/lib/apt/lists/* \ && curl -fsSL "https://github.com/a2al/a2al/releases/download/v<version>/a2al_<version>_linux_amd64.tar.gz" \ | tar xz -C /usr/local/bin a2ald a2al \ && useradd -r -s /bin/false -M -d /var/lib/a2al a2al
USER a2alVOLUME /var/lib/a2al
# QUIC direct connections / address lookups (UDP) and ICE signalling (TCP)EXPOSE 4121/udp 4121/tcp
ENTRYPOINT ["a2ald", "-data-dir", "/var/lib/a2al", "--no-open-browser"]On an ARM64 host, change linux_amd64 to linux_arm64. You can also npm install -g a2ald inside the image, but the release tarball is smaller and its startup more predictable.
Running it
Section titled “Running it”docker build -t a2al .
docker run -d --name a2ald \ --restart unless-stopped \ -p 4121:4121/udp -p 4121:4121/tcp \ -v a2al-data:/var/lib/a2al \ a2alTo follow the logs:
docker logs -f a2aldIf the host already runs an a2ald, the one in the container is a second node — it has its own data directory and AID, and the two do not affect each other.
Reaching the CLI and MCP from the host
Section titled “Reaching the CLI and MCP from the host”The administrative surface listens on 127.0.0.1 inside the container, so mapping -p 2121:2121 will not work on its own. To let a CLI, panel or MCP client on the host reach into the container, open the administrative surface explicitly and set a token at the same time:
docker run -d --name a2ald \ --restart unless-stopped \ -p 4121:4121/udp -p 4121:4121/tcp \ -p 127.0.0.1:2121:2121 \ -v a2al-data:/var/lib/a2al \ a2al \ -data-dir /var/lib/a2al --no-open-browser \ --api-addr 0.0.0.0:2121Then set api_token in the container’s config.toml. Port mapping makes the request non-local, and a request without a token will be refused. On the host side:
a2al --api http://127.0.0.1:2121 --token <token> statusAn MCP client takes the HTTP form:
{ "mcpServers": { "a2al": { "url": "http://127.0.0.1:2121/mcp/", "headers": { "Authorization": "Bearer <token>" } } }}A common error: while the administrative surface still listens locally (
127.0.0.1), a request forwarded in from the host may return400 host header not allowed— that is the local-originHostheader check doing its job, not a network failure. Listen on0.0.0.0and setapi_tokenas above to resolve it.
For agents on the host to use the identities of the containerised daemon, point the CLI / MCP at the mapped address. The reverse does not work directly: an agent inside the container cannot reach a host service bound only to 127.0.0.1 — that service has to be bound to an address the container can reach as well.
Isolation advice
Section titled “Isolation advice”- One data directory per container: run several nodes on different volumes, each with its own
--listen(say:4122) and--api-addrport. - Mount only what is needed: the volume holds the data directory alone; mount
files_rootseparately when file objects are needed, and do not let the container see your whole home directory. - Drop privileges: run as a non-root user inside the image (see the
useradd/USERabove). - Keep the administrative surface off the network: map
2121to the host’s127.0.0.1only, and always setapi_token. - Network mode: on the default bridge network, UPnP is usually unavailable, so
disable_upnp = trueis reasonable; direct connections between container and host depend on the port mappings being right.
Related pages
Section titled “Related pages”| Goal | Page |
|---|---|
| Every configuration field | Configuration |
| Running as a service on Linux | Deploy with systemd |
| Advice on ports and access control | Security Practices |
Private (self-hosted) networks (--bootstrap) | Private (Self-Hosted) Network |