Docker Environments
Last reviewed October 28, 2026 (checked against the app).
A Docker environment chooses where CPLai runs containers: on the CPLai computer or on a remote Docker host. It applies to container tools and Camofox. It does not move the whole CPLai application or automatically turn an agent into a container-based worker.
How do I choose where containers run?
Open Settings -> Runtimes & Docker -> Docker engine on desktop or web.
- Set Where containers run to Local Docker engine or Remote Docker host.
- For a remote host, choose SSH or TCP with TLS and enter the connection fields below.
- Select Test connection. A successful result shows the engine version, operating system, and architecture.
- Select Save. Saving a remote environment runs the test again; if it fails, the previous setting stays in place.
- Open a new terminal or start a new agent run to use the saved environment. Existing sessions keep their current environment.
| Field | What to enter |
|---|---|
| SSH host and user | The Docker host and a login that can run Docker there. The login must work with a key, without a password prompt |
| Service setup SSH key path | Under Service access; used only for setup and removal from the desktop app. Docker itself uses your default key, or an IdentityFile line for the host in ~/.ssh/config |
| TLS host and port | The remote Docker endpoint; the port defaults to 2376 |
| TLS certificate folder | A folder on the CPLai host containing ca.pem, cert.pem, and key.pem |
| Service host | The hostname used to reach published container ports; defaults to the connection host |
| Path mappings | Corresponding local and remote project folders, such as C:\Projects and /mnt/projects |
A remote host does not need Docker Desktop on this PC. If this PC has no Docker command-line tools, the first remote test installs them (the Docker CLI and the compose plugin, about 75 MB) and says so under the result.
Before contacting the engine, an SSH test checks the login the way Docker will use it. A missing key, a host key this PC has not accepted yet, or a login that is not in the host's docker group fails within seconds and names the fix.
The web connection test runs on the CPLai service host, not in your browser. A successful desktop test does not establish that the service has the same SSH configuration or can read the same certificate files. Test from the surface whose connection you need to use.
Path mappings record the folder relationship. They do not copy files or make a local folder available remotely. Automatic rewriting of project-stack bind mounts is not currently available; confirm the remote paths before running a stack.
Tip: Explicit environment settings on an agent or terminal can override the shared Docker choice. If one session uses a different engine, check its overrides and launch a fresh session.
How do I run Camofox on the remote engine?
- Save and test the remote Docker environment.
- On desktop, open Settings -> Browser -> Browser Runtime and select Enable camofox.
- Wait for the Docker, image, and container steps to finish. CPLai uses the image for the selected engine's architecture, downloading it when needed.
- If moving existing local Camofox profiles, return to Docker engine and select Migrate camofox profiles. This desktop action copies the profiles into the selected engine's persistent volume; it is not continuous synchronization.
- In the agent editor, choose Camofox as the Browser engine and select the intended session.
The web dashboard can save the Docker environment, but Browser Runtime setup and profile migration use desktop controls. Local Docker installation prompts apply when you use the local engine.
Browser Watch can display a registered session on the configured remote engine. The Service host must be reachable from the CPLai host for screenshots and other published container services to work.
How do I run a containerized agent on the remote engine?
Check Runs in Docker under Agent containers for the agent's engine. Claude Code is supported by default. If the engine is unsupported, CPLai stops the Docker run before starting a container. To run it on the host, choose Native in the agent editor. See Execution Backend for the per-agent setting.
An agent whose execution backend is set to Docker runs its container on the saved engine. On a remote host, CPLai checks three things before the run starts and names the one that is missing:
- Path mappings cover the agent's folders. The agent workspace and the sentinel folder below must each sit under a mapped local root that the Docker host really has mounted. Your
~/.claudefolder does not: CPLai passes the container only the three files it needs (your Claude sign-in, settings and CLAUDE.md), and the container cannot see anything else in that folder, such as your other sessions. On any engine, while a run lives those three files are in its container's environment, where anyone who can use that Docker engine can read them (docker inspect): give access to the engine only to people you would trust with your Claude sign-in. - The run folder is on the share. Per-run files go to
<broadest mapped local root>\CloudPeakLabs\cloudpeaklabs-docker-sentinels\<run id>instead of this PC's temp folder, so the container and this PC see the same files. The share must pass container writes back to this PC promptly. The run's secret environment file stays in this PC's temp folder. - The CPL API listens on the LAN. The container reaches CPLai at
http://<this PC's name>:<port>, so Settings -> Webhooks & notifications -> Inbound Webhooks -> Bind Address must be0.0.0.0. This setting is in the desktop app. Restart the background service after changing it.
CPLai builds a separate image for each engine on the selected Docker host. The first run waits for that image if it is missing. During the build, the host needs internet access to download the engine from its maker. Later runs reuse the image, including after a CPLai update that keeps the same recipe. If the recipe changes or the image is removed, the host builds it again.
If the build fails, CPLai shows Docker's error. A Claude Code run can continue with the older cpl-agent:latest image if it is already on that Docker host. The run tells you when it uses this image, and the next run tries the build again. Without a usable image, the run stops.
If you set CPL_AGENT_IMAGE to an image of your own, it needs the base64 program, which the Debian and Node base images include. CPLai passes your Claude sign-in, settings and CLAUDE.md into the container encoded with it. In an image without it, every Docker Claude Code run stops before Claude starts, with "CPLai: the Claude sign-in could not be unpacked in the container; the run stops."
The container receives the agent's own variables: its Keychain entries, its per-agent variables and CPLai's run variables. It does not receive this PC's PATH, home and temp folders, Docker client settings or shared cargo folder; it uses the image's own.
A project pinned to local Docker keeps running its agents on this PC.
Agent containers
Open Settings -> Agent containers on desktop or web, or press Open Agent containers on the Docker engine card in Settings -> Runtimes & Docker. The page shows the Docker host's state in its header (Docker running, not running, or not installed) and two cards.
Engines lists Claude Code, Codex, OpenCode and Antigravity, each with three rows:
- Container shows whether the selected host has the engine's image. If it says Not built, choose Prepare to build the image ahead of the first run. The status changes to Preparing, then Ready with the engine version when available. Last try failed shows Docker's reason and offers Try again.
- Sign-in: whether this computer is signed in to the engine. The desktop app checks it; the web dashboard cannot read this computer's sign-ins and says Not checked. OpenCode signs in per model provider, and a local model needs none.
- Runs in Docker shows whether the engine supports Docker agent runs. Not yet can appear alongside a Ready image. If you want to run that engine on the host, select Native in the agent editor.
Sign-ins in containers holds one switch per engine, "Give ... containers only a short-lived sign-in". On, a container gets only the engine's short-lived access token, so nothing long-lived can leave it. Off, it gets this computer's full sign-in for that engine. Either way, anyone who can use that Docker engine can read what the container got while a run lives: with the switch off, the full sign-in, refresh token included; with it on, the access token only. On a remote engine shared with others, that includes everyone who can reach its Docker socket.
- Claude Code is off by default, which is how a Claude Code container has always been signed in. Claude Code renews its sign-in only shortly before it expires, so with the switch on, Docker Claude Code runs are refused for about the last 70 minutes of every 8 hours, until Claude Code renews its sign-in on this computer.
- Codex is on by default. Codex's sign-in lasts 240 hours, so its runs are almost never refused.
Only you, in person, can change these switches. A container never receives the sign-ins of your MCP servers.
What happens on a Linux computer?
This applies when Docker is installed directly on a Linux computer, without Docker Desktop. Windows, macOS and Docker Desktop are unchanged.
The first time CPLai runs an agent in a container there, it creates its own Docker network, cpl-agents, and runs its agent containers on it. Containers on that network cannot reach each other.
Agent containers reach CPLai at host.docker.internal. While one is running, CPLai listens on that network's gateway address at its API port and passes on connections from that network only. A container on any other Docker network cannot reach CPLai's API this way, and neither can other computers on your network. The listener stops a few minutes after the last agent container ends.
Only CPLai's API is passed on. A model server that listens only on this computer's 127.0.0.1 cannot be reached from a container; give the container the server's network address instead.
If a firewall such as ufw is on, allow the cpl-agents subnet to reach CPLai's port. docker network inspect cpl-agents shows the subnet; then, for example, sudo ufw allow from 172.19.0.0/16 to any port 9437.
If a Docker network named cpl-agents already exists and CPLai did not create it, or it no longer keeps agent containers apart from each other, agent runs stop and say so. Remove or rename that network, and CPLai creates its own on the next run.
Which Docker program does CPLai's service run?
CPLai's always-on service runs as the system account. While the protection below is on, the service runs only a Docker program that only an administrator can change, and only with its own settings and plugins. A Docker you installed only for yourself is not used by the service.
- When every Docker program on this PC is one your account can change, the service installs CPLai's own protected copy the first time it needs Docker and uses that. It is a one-time download of about 50 MB from Docker's site; building an agent's container adds its build plugin, about 70 MB, the first time. While it downloads, agent runs in Docker that the always-on background service starts wait for it. Everything else keeps working, including the tabs and agents you start in the desktop app.
- Without internet access, the service cannot install its copy: its Docker calls stop with the reason, this card says what it found and why, and it tries again a minute later.
- If that install fails, Try again on this card installs it right away. Test connection names any Docker program the service refused, and why.
When the service could not install its protected copy, CPLai tells you in two places: the Docker engine card (the row Background service's Docker program) and a row under Needs you on Today. The notice names what the service refused, where it is and why, says why the install failed, and offers two choices:
- Try again. Installs CPLai's protected copy now. The service also tries again by itself a minute later.
- Keep using my own Docker. This turns the switch below off, and Windows asks for an administrator first. If the prompt is declined, nothing changes and the notice says so. Programs, plugins and helpers your account can change would then run as the system account. Agents and the API cannot change it. The web dashboard does not offer this choice: its notice says to turn the protection off in CPLai's desktop app on that PC.
Until this is settled, agent runs in Docker that the always-on background service starts stop and say why. Everything else keeps working, including the tabs and agents you start in the desktop app. After Keep using my own Docker the row says "Using your own Docker." On Today, the dialog also says that the protection is now off and where to turn it back on. The background service uses your own Docker from its next Docker command.
At other times the same row is one quiet line: that CPLai installs its protected copy the first time the background service needs Docker, that the service uses that copy, or that it uses its own plugins or sign-in helper instead of ones your account can change.
The switch Commands CPLai runs as the system account use only a Docker client that only administrators can change on this card turns the protection off. It is on by default. Turning it off needs an administrator: CPLai's desktop app on this PC asks Windows, and Windows shows its administrator prompt. If the prompt is declined, nothing changes and the row says so. Agents and the API cannot change it, and the web dashboard can only turn it back on. A web dashboard page that was already open when you turned the protection off may turn it back on when that page next saves its settings; reload open dashboard pages after turning it off. It never turns it off. If CPLai cannot trust where this setting is kept (someone other than an administrator could change it), the protection stays on and the row says why. To clear that, an administrator deletes the registry key HKEY_LOCAL_MACHINE\SOFTWARE\CloudPeakLabs\CPLai\Protections; CPLai creates it again with the right access the next time its background service starts. The app on your desktop is not affected either way.
How do I troubleshoot the connection?
| Symptom | What to check |
|---|---|
| Save says the remote engine did not answer | Check the host, Docker service, SSH login or TLS certificate folder, then test again |
| The test says the SSH login needs a key | Add this PC's public key (create one with ssh-keygen) to ~/.ssh/authorized_keys for that user on the Docker host |
| The test says SSH does not trust the host yet | Run ssh user@host once in a terminal on this PC, accept the host key, then test again |
| The service test says it has no SSH access | On desktop, select Set up service access in the Docker engine card |
| Docker is reachable but Browser Watch is empty | Finish Camofox setup, confirm the selected account has an active registered session, and check the Service host |
| An old terminal still uses the previous host | Start a new terminal; saving does not alter open sessions |
| A remote container cannot find project files | Make the files available on the Docker host and use paths that exist there |
| Desktop works but the web test fails | Check Docker and connection credentials from the CPLai service host's execution environment |
| The test says CPLai's service will not run a Docker client | Install Docker for all users of this PC, or for a remote engine let the test install CPLai's own copy (see above) |
See Settings, Agents, and Terminal for the connected workflows.