Install as a container stack
An agent can run as a container stack: one compose file that Caldera
generates, which you paste into Portainer, or run with docker compose or
podman compose. Nothing is installed on the host and nothing on the host is
changed. The runtime runs inside the stack, and so does the agent's work. This
is the way to put an agent on a server that allows nothing but containers, and
on most machines a customer has: if it runs containers, it can run a stack.
Only agents with a process runtime can run as a stack. An agent that keeps its
own machine (adapter mode) or brings its own compose file does not.
Install
-
In Caldera, open the blueprint, choose Install…, give the agent a name and create the install code. Under Or install as a container stack the dialog shows the compose file, with the code in it. Copy it. The code works once and for fifteen minutes, and like the commands it is shown once.
-
On the host, deploy it.
- Portainer: Stacks, Add stack, paste the file into the web editor, Deploy the stack.
- Docker or Podman: save the file and run
docker compose -f stack.yaml up -d(orpodman compose -f stack.yaml up -d).
-
The first start redeems the code and the agent appears in Caldera. Wait for the first report, then do the one thing that needs a person, once, in the console of the agent container (Portainer: the container, Console,
/bin/bash; Docker:docker exec -it <agent container> caldera-agent setup):caldera-agent setupIt signs in to Claude (Claude Code prints an address; you open it in a browser and paste the code back), switches Remote Control on, and asks for the workspace trust of the agent's folder. These are Claude Code's own questions and you answer them: the command answers none of them for you. Everything it sets up is kept on the volumes and survives restarts and image updates.
After that the agent works like one on a host: "Open session" and "Continue a conversation" open a session in the container, and the account line on the agent's page shows the Claude account.
What the file contains
- the agent service, from the image
ghcr.io/speedxy/caldera-agent:stable(since 0.52.2; before, the tag of your Caldera's version), or the image the blueprint names (container.image), with Caldera's address, the one-time install code and the image's own name (CALDERA_IMAGE) as environment; - the services the blueprint declares (
container.services), for example a database for tests; - named volumes:
agent(the agent's directory: its token, its versions and its clone),home(Claude Code and what the blueprint's setup script installed) andclaude(the sign-in, Remote Control, the workspace trust and the session transcripts, which "Continue a conversation" reads), plus one per service that asks for one; - one private network between them.
It never contains a published port, a path of the host, a privileged service, a
capability, a device, a host network or the Docker socket, and Caldera refuses a
blueprint that asks for one (see the manifest). The
install code in it is spent after the first start; the agent's token is then on
the agent volume and the file holds no credential. Secrets the blueprint asks
for appear as commented lines (CALDERA_SECRET_<NAME>): fill in the ones you
need before the first start, and take the values out of the stack afterwards, the
runtime keeps them on the volume. To change one later (a new token, a secret a new
version asks for), put the value into the stack again and restart it: a non-empty
value replaces the kept one at every start, an empty one changes nothing.
Optional services
A blueprint may offer services that run only when you want them, for example the project agent's
MariaDB (db, setting "MariaDB in the stack") and browser (browser, setting "Browser in the stack").
The stack file has them with a compose profile of their name, and its header lists them. To switch one
on after the install:
- Turn its setting on on the agent's page in Caldera. That tells the agent to use the service.
- Add the service's name to the stack's environment variable
COMPOSE_PROFILES(several separated by commas,db,browser): in Portainer under the stack's environment variables, then redeploy the stack; withdocker compose,COMPOSE_PROFILES=db docker compose -f <file> up -d.
Caldera cannot do the second step for you: it never reaches your host. Until it is done, the agent
reports the finding "Der Dienst db ist eingeschaltet, läuft aber nicht im Stack" with that step. To
switch a service off, take it out of COMPOSE_PROFILES, redeploy, and turn the setting off.
A speech-to-text service
A blueprint that wants voice messages as text can declare the service in its stack and point
transcription at it by name; the audio then never leaves the stack. The project-agent
blueprint of the catalog carries this as a commented example (remove the #~ in front of the
lines):
container:
services:
- name: whisper
image: onerahmet/openai-whisper-asr-webservice:latest
env: { ASR_ENGINE: faster_whisper, ASR_MODEL: small, ASR_MODEL_PATH: /models }
volume: /models
transcription: { backend: http, url: 'http://whisper:9000', language: de }
The image is a reference only (an MIT-licensed project; nothing of it is in the bundle). It downloads the model files once into the volume, so the first transcription takes longer. See the manifest.
What is in the image
The signed runtime, git, Python 3, Node.js (current LTS), common command-line
tools, a non-root user and an entrypoint that starts the runtime. Claude Code
is not in the image: it is installed at the first start with Anthropic's own
installer onto the home volume, so it keeps updating itself as it does on any
machine. The runtime keeps updating itself on press too, into the agent volume
(see the runtime); the image's own
copy is only the first start. PHP 8.4 is Debian's (since 0.52.2), with the
extensions the catalog's blueprints need and the settings of
/etc/php/8.4/cli/conf.d/99-caldera.ini.
Keeping the image current. The tag stable is moved by every release and
rebuilt every week from the newest release, so it carries Debian's current
security updates (PHP among them). Docker does not fetch a new image under the
same tag by itself, so the agent service of a stack file carries pull_policy: always: every start
and every redeploy fetches the current image first (a host that kept an older image of the same name
cannot run a runtime too old for the blueprint). A stack file from before 0.59 has no policy: pull once
by hand (Portainer: "Re-pull image and redeploy"; or docker compose pull && docker compose up -d). The
volumes, and with them the agent's state and sign-ins, stay. The agent's page
shows the image and the day it was built, and says so once it is older than 14
days. A stack on a version tag (such as v0.52.2, which a stack file before
0.52.2 named) keeps that one image forever: the page then says to set the tag
to stable, in image and in CALDERA_IMAGE. To hold one image on purpose,
for example to go back after a bad week, put a version tag there instead; each
release tag stays published.
The image is public, like caldera.pyz, so a host needs no registry login. Public
is not open source: the image carries a licence notice and all rights stay
reserved.
The blueprint's setup script
A blueprint can name a script, container.setup. The runtime runs it once per
blueprint version, inside the container, as the agent's user (not as root), in
the blueprint's directory, before the agent is started on that version. Use it to
add what the project needs, for example a package manager or a toolchain, into
$HOME (a volume). A marker on the home volume records that it ran, so a
restart does not repeat it; a new version runs it again. A script that fails is
tried again after a pause and the agent does not start until it works; its output
is in .caldera/setup.log in the agent's directory. When an update brings a new
version, the script runs first, and a failed script is a failed update that goes
back to the version before.
What several blueprints need is in the standard library, which is on the script's import path:
python3 -m toolchain php composer checks the image's PHP and installs Composer at a pinned
version (see the standard library).
The way back, without Caldera
The commands of the host install work in the container:
docker exec <agent container> caldera status
docker exec <agent container> caldera pause
docker exec <agent container> caldera resume
docker exec <agent container> caldera session off
In Portainer the same commands run in the container's console. Stopping the stack stops the agent.
What a stack cannot do
- Start containers of its own. There is no Docker inside the stack, and the stack gets no access to the host's Docker. A project that must build images or run its own container setup needs a host install.
- Show a preview to the outside. No port is published; reaching a stage needs a name and the host's proxy, which are the host's business. Tests and merge requests work.