# Containers page

> 🧪 Private preview
>
> 🚧 In development — hosted containers require an experimental build and are not included in standard agent downloads. In a build with them, **Containers** appears in the sidebar under **Configuration**, after **Kubernetes**. Other builds have no such page.

The page defines OCI images that Cruma runs through a local Docker- or Podman-compatible Engine, shows their state, and controls them. For the settings behind it see [Hosted containers](https://cruma.io/book/cruma-tunnels/configuration.md); to send a frontend to a container see [Routing](https://cruma.io/book/cruma-tunnels/desktop-routing.md).

## Engine bar

The bar at the top shows **Engine connected** with the Engine's kind (Docker or Podman), version and endpoint, **Engine unavailable**, or **Engine not checked yet**.

- When the Engine is unavailable, the bar shows the error, every endpoint Cruma tried and short steps for your operating system, such as starting the Docker service or Podman's socket.
- **Check again** probes the Engine on demand. It starts nothing.
- Opening the page checks the Engine only when at least one container is saved. With none, the bar stays at **Engine not checked yet** until you press **Check again**.
- **Engine socket** overrides discovery. Leave it empty to find the Engine from `DOCKER_HOST`, `CONTAINER_HOST` and the usual local sockets. On macOS, enter the Podman machine's API socket here. The value is saved with the containers.

## The list

Each saved container has a card with its ID, a status badge, its image and these buttons: **Start**, **Stop**, **Restart**, **Recreate**, **Remove** and **Edit**.

| Badge | Meaning |
| --- | --- |
| Not started | Saved, but Cruma is not managing it yet |
| Waiting | Managed, but not started: **Start with the agent** is off and you have not started it |
| Running | Running in the Engine |
| Stopped | The container exists and is stopped |
| Failed | The Engine reported an error, shown under the badge |
| Engine unavailable | The Engine cannot be reached |
| Not saved | Added or changed on this page and not saved yet |

A running container lists its **Endpoints** as `127.0.0.1:\<port>` and the **Environment for processes** names it hands to hosted processes: `CRUMA_CONTAINER_\<ID>_\<PORT>_HOST` and `CRUMA_CONTAINER_\<ID>_\<PORT>_PORT`, with the container and port names in upper case. Click an item to copy it. **Has problems** marks a container whose definition does not validate yet.

With no containers, the page explains the feature and offers **Add container**, which fills in a PostgreSQL example (`postgres`, image `docker.io/library/postgres:17-alpine`, port `db` = 5432, password `dev`). Change the password before saving it anywhere shared.

## Editing a container

**Edit** opens the container with three tabs, **Config**, **Runtime Info** and **Logs**. **← Back to list** returns to the list. **Delete** removes the definition once you save.

| Field | Meaning |
| --- | --- |
| Container ID | Lower-case name that frontends and environment names use |
| Image | The OCI image reference |
| Pull policy | **Always**, **If not present** or **Never** |
| Command, Arguments | Tick **Override…** to replace the image's entrypoint or arguments |
| Working directory | Empty uses the image default |
| Environment | Variables passed to the container |
| Ports | A name and a container port from 1 to 65535. Each port is published on a free loopback port |
| Volumes | A **Host directory** (for example `$cfg_dir/data`) or a **Named volume**, a path in the container and an optional **Read-only** |
| Start with the agent | Starts the container when the agent starts |
| Restart | **No**, **On failure** or **Always** |
| Upstream protocol, Backend timeout | How routes reach the container; an empty timeout uses the global default |
| Middlewares | Listed for information. Add them in the configuration file; they can be removed here |

Problems appear under the field that has them: a port that is not a number, a timeout that is not whole seconds, a variable set twice or without a name, and any invalid definition. **Save** appears in the header once something changed, with **Undo** beside it. If you save while problems remain, the page says **Fix the problems below before saving** and keeps your edits as not saved.

Changes to the image, command, arguments, working directory, environment, ports, volumes or restart policy make **Saving will recreate this container.** appear under the editor. Pull policy, start-with-the-agent, upstream protocol and timeout apply to the running container without recreating it.

**Runtime Info** shows the Engine's view: status, state, Engine container ID, name, exit code, last error, published ports and labels. It says the Engine has no container yet when none exists.

**Logs** shows the newest lines, up to 2,000, with stderr in red. **Tail** shows what exists now; **Follow** keeps streaming. The stream stops when you leave the page and starts again when you return. A container that is not saved has no logs yet.

## Starting, stopping and removing

The buttons act on saved containers only; save a new container first.

- **Start**, **Stop** and **Restart** act at once.
- **Recreate** asks first: the container is removed and created again from its definition, and named volumes are kept.
- **Remove** asks first: the container is stopped and removed from the Engine, named volumes are kept, and it stays absent until you start, restart or recreate it.
- **Stop all** at the top asks first, then stops every container this agent owns.

An action returns immediately; the card's badge and error show the outcome.

Closing the agent leaves containers running; the next launch adopts them. Containers that Cruma did not create, or that belong to another configuration, are never touched.

---

- Book: [Cruma Tunnels](https://cruma.io/book/cruma-tunnels.md)
- Previous: [Certificates, auth, and MCP](https://cruma.io/book/cruma-tunnels/desktop-security.md)
- Next: [Settings, profiles, and the assistant](https://cruma.io/book/cruma-tunnels/desktop-settings.md)
- Pages: [Home](https://cruma.io/home.md) · [Docs](https://cruma.io/docs.md) · [Pricing](https://cruma.io/pricing.md) · [Share localhost](https://cruma.io/share-localhost.md) · [Webhook testing](https://cruma.io/webhook-testing.md) · [Homelab](https://cruma.io/homelab.md) · [AI coding agents](https://cruma.io/ai-coding-agents.md) · [Cruma vs ngrok](https://cruma.io/ngrok-alternative.md) · [Cruma vs Cloudflare Tunnel](https://cruma.io/cloudflare-tunnel-alternative.md) · [Blog](https://cruma.io/blog.md)
