---
title: "Strata in Docker"
type: concept
tags: [docker, compose, containers, nvidia, amd, intel, podman]
created: 2026-11-24
updated: 2026-11-24
confidence: medium
sources: ["raw/github_doc-docs-docker-md.md", "raw/github_doc-tools-docker-dockerfile.md", "raw/github_doc-tools-docker-compose-docker-compose-nvidia-yml.md", "raw/github_doc-tools-docker-compose-docker-compose-amd-yml.md", "raw/github_doc-tools-docker-compose-docker-compose-intel-yml.md", "raw/github_doc-tools-docker-compose-env-example.md", "raw/github_doc-tools-docker-compose-mac-md.md"]
---

# Strata in Docker

## Definition

Strata can run in a container with a prebuilt engine. NVIDIA and AMD images can download and prepare a model on first start; Intel Arc needs prepared model files. Keep the data volume to reuse downloads and settings. Images are Linux x86-64 only. Everything inside the container uses the Terminal's `strata launch` interface, configured through environment variables. Other install routes: [[concepts/install-desktop-and-terminal]], [[concepts/source-install]].

Platform limits:

- **Mac:** Docker runs Linux in a VM with no access to the Mac GPU (no Metal), and Strata has no CPU-only mode worth running. Use the Mac app or Terminal (the XL edition page "Apple Silicon Mac (Metal)").
- **Windows:** Docker Desktop (WSL 2) passes NVIDIA cards through, not Radeon or Arc cards. Use the native app for supported NVIDIA or AMD cards. Intel Arc has no native Windows engine; follow the Linux guide.

## How It Works

### Which image

Images are on the GitHub Container Registry as `ghcr.io/niko1221/strata:<version>-<flavor>`, plus `ghcr.io/niko1221/strata:latest-<flavor>` for the newest release of that flavor. Ready-made images are published from version 0.2.1 on. The guide's examples use version tag `0.2.20` (the guide itself is for docs version 0.2.21). Pin the version tag to update only when you decide.

| Graphics card | Image tag | Needs on the computer |
| --- | --- | --- |
| NVIDIA RTX 20, 30, 40, 50 (and matching RTX A / Quadro) | `0.2.20-cuda13` | NVIDIA driver 580 or newer, NVIDIA Container Toolkit |
| NVIDIA GTX 10 (Pascal), Tesla P100, V100 (Volta), or any NVIDIA card with driver 575 to 579 | `0.2.20-cuda12` | NVIDIA driver 575 or newer, same toolkit |
| AMD RX 9000 and Radeon AI PRO R9700 (RDNA 4, gfx1200 / gfx1201) | `0.2.20-rocm-gfx120x` | `amdgpu` kernel driver (Linux 6.8+) |
| AMD RX 7000 (RDNA 3, gfx1100 / gfx1101 / gfx1102) | `0.2.20-rocm-gfx110x` | `amdgpu` kernel driver |
| AMD Ryzen AI Max (Strix Halo, Radeon 8060S, gfx1151) | `0.2.20-rocm-gfx1151` | `amdgpu` kernel driver |
| AMD Ryzen AI 300 / 7040 / 8040 (Radeon 890M / 880M / 780M, gfx1150 / gfx1103) | `0.2.20-rocm-igpu` when published for a release, else build it | `amdgpu` kernel driver |
| Intel Arc A-series and B-series (including Arc Pro B70) | `0.2.20-sycl` (build it if no image exists for a release) | `i915` or `xe` kernel driver; prepared model files |

Unsure about NVIDIA: take `cuda13` when `nvidia-smi` shows driver 580 or newer and the card is an RTX; otherwise `cuda12`. A wrong pick does no harm: the container says the engine does not fit this card and stops.

Sizes, measured on the 0.2.16 images (engine 0.1.62) pulled with Podman; current sizes may differ. On disk / download: `cuda13` 1.32 GB / 713 MB, `cuda12` 1.65 GB / 904 MB, `rocm-gfx120x` 2.73 GB / 778 MB, `rocm-gfx110x` 1.6 GB / 415 MB, `rocm-gfx1151` 1.48 GB / 408 MB, `sycl` 1.47 GB / 446 MB. The model comes on top at first start.

Every `0.2.20` image bundles three engines (`strata`, `strata-hy4`, `strata-inkling`), so switching model families changes only `FAMILY` and `MODEL`.

### One command per card

NVIDIA:

```sh
docker run -d --name strata --gpus all -p 127.0.0.1:8080:8080 \
  --ulimit memlock=-1:-1 --shm-size 2g --stop-timeout 120 \
  -v strata-data:/data -e FAMILY=qwen -e MODEL=IQ3_XXS -e API_KEY=$(openssl rand -hex 24) \
  ghcr.io/niko1221/strata:0.2.20-cuda13
```

AMD replaces `--gpus all` with `--device /dev/kfd --device /dev/dri --group-add video --group-add $(getent group render | cut -d: -f3)` and uses an image such as `ghcr.io/niko1221/strata:0.2.20-rocm-gfx120x`. Intel Arc uses `--device /dev/dri --group-add $(getent group render | cut -d: -f3)`, `-e MODEL=IQ3_S -e MODEL_PATH=/models -v /srv/gguf/IQ3_S:/models:ro` and `ghcr.io/niko1221/strata:0.2.20-sycl`.

Inkling-2-Mini: `-e FAMILY=inkling-2-mini -e MODEL=SQ-15` (also `SQ-10`, `SQ-20`, or an Unsloth GGUF size such as `UD-Q4_K_XL`). Hy4-Flash: `-e FAMILY=hy4-flash -e MODEL=SQ-64` (also `SQ-96`, `SQ-128`). Model details: [[concepts/other-models]].

The first start downloads the model; watch with `docker logs -f strata`. To use files you already have, add `-e MODEL_PATH=/models -v /your/folder:/models:ro`.

What the run options do: `--ulimit memlock=-1:-1` lets the engine pin RAM; `--shm-size 2g` gives shared memory; `--stop-timeout 120` gives the model two minutes to unload (Docker's default 10 seconds is too short for a big model). Do not put a memory limit on the container: Strata plans from the whole computer's RAM and loads tens of GB.

### Docker Compose

Files are in `tools/docker/compose/`: `docker-compose.nvidia.yml`, `docker-compose.amd.yml`, `docker-compose.intel.yml` and `.env.example`.

```sh
cd tools/docker/compose
cp .env.example .env              # set FAMILY=qwen, MODEL=..., API_KEY=...
docker compose -f docker-compose.nvidia.yml up -d
docker compose -f docker-compose.nvidia.yml logs -f
```

The compose files default to images `ghcr.io/niko1221/strata:0.2.20-cuda13` (NVIDIA), `0.2.20-rocm-gfx120x` (AMD) and `0.2.20-sycl` (Intel), overridable with `STRATA_IMAGE` (the AMD file's comments name the gfx120X image for RX 9000 / R9700 and the gfx110X image for RX 7000). They set the GPU (NVIDIA: `deploy.resources.reservations.devices`; AMD: `/dev/kfd` and `/dev/dri` plus the `video` and `render` groups; Intel: `/dev/dri`), `ulimits.memlock`, `shm_size: 2gb`, `stop_grace_period: 2m`, the `strata-data` volume, and the port bound to `127.0.0.1`. Compose defaults: `CONTEXT` `32k`, `VISION` `off`, `TUNE` `skip`. `.env.example` variables (all optional): `STRATA_IMAGE`, `FAMILY`, `MODEL`, `MODEL_PATH`, `CONTEXT`, `PARALLEL`, `VISION`, `TUNE`, `API_KEY`, `STRATA_BIND`, `STRATA_PORT`, `RENDER_GID` (AMD / Intel only: `getent group render | cut -d: -f3`). To let other computers reach it set `STRATA_BIND=0.0.0.0` and keep a real `API_KEY`. The NVIDIA file notes `GPUS: "0,1"` for several cards, and the AMD file has a commented `security_opt: [seccomp:unconfined]` only for when the log says a ROCm call was blocked.

### Intel Arc in a container

The downloader prepares NVIDIA and AMD cards only. For Arc the container uses prepared model files: the GGUF files in a mounted folder (`MODEL_PATH`), and the prepared pack and MTP layer in the data volume (`/data/Strata-data/packs/<model>` and `/data/Strata-data/mtp/rt`, made by the Intel installer on this or another computer, see the XL edition page "Intel Arc GPUs (SYCL engine)"). Without them the container names the missing file and stops. Nothing is downloaded or prepared for Arc inside the container. Arc B-series (xe driver) stream experts from the GGUF files, so put them on a fast SSD.

### Image internals

The Dockerfile builds the Terminal (bundled Python 3.12), verifies every engine package (every file's hash, and that every imported library is bundled or belongs to the OS/GPU driver), then adds a flavor-specific runtime (`cuda`, `hip` or `sycl`; the sycl flavor is Ubuntu 26.04 based). Container paths: `STRATA_COMPONENTS_DIR=/opt/strata/components`, `STRATA_INSTALL_DIR=/data/install`, `HOME=/data/home`, `PORT=8080`, `STRATA_IN_DOCKER=1`. The entrypoint uses `tini`; `docker stop` sends SIGTERM and the entrypoint runs `strata launch --stop`. The healthcheck has a 2 h start period, so "starting" is not "unhealthy" during a long first download.

## Key Parameters

Settings are environment variables (`-e NAME=value` or in compose):

| Variable | What it does | Default |
| --- | --- | --- |
| `MODEL` | model size (`IQ2_XS`, `IQ3_XXS`, `IQ3_S`, `Q2_0`, `UD-Q4_K_XL`, `SQ-10`/`SQ-15`/`SQ-20`, `SQ-64`/`SQ-96`/`SQ-128`, ...) | Strata picks for the card and says so in the log |
| `FAMILY` | `qwen`, `qwen36`, `hy4-flash`, `inkling-2-mini`, `unsloth`, `gyro`, `coder`, `swift`, `nvfp4`; `qwen` = original ISTA-DASLab packs | installer recommendation; may differ by hardware |
| `MODEL_PATH` | model files already on disk, as seen inside the container (a folder or one `.gguf`, `.strata`, or `.safetensors` file/folder) | download |
| `ALLOW_DOWNLOAD` | `1`: download although old-layout files were left in `/data/models` | stop |
| `CONTEXT` | `32k`, `64k`, `128k`, `256k` or a number | largest that fits (compose file: `32k`) |
| `PARALLEL` | simultaneous requests, 1 to 8 | fitted to the card |
| `VISION` | `off`, `on`, `gpu`, `cpu`; picture reader is about 0.9 GB | `off` |
| `KV` | `int8`, `q4_0` (half the memory), `k8v4`, `fp16` | `int8` |
| `DRAFTING` | `auto`, `mtp`, `dflash2`, `off` | `auto` |
| `DRAFT_VOCAB` | `cjk`, `en`, `cyrillic`, `fr`, `latin`, `arabic` | picked from container languages, else `cjk` |
| `GPU` / `GPUS` | card numbers `0` or `0,1`; empty or `all` = engine's choice | all that fit |
| `GPU_ROLES` | e.g. `1=main,0=helper` (`main`, `helper`, `off`); not with `GPU`/`GPUS`; passed to `launch --gpu-roles` ([[concepts/multi-gpu]]) | none |
| `TUNE` | `quick`, `thorough`, `skip`; done once and kept in the preset (`RETUNE=1` tunes again) | `skip` |
| `TUNE_ALLOW_SMALL` | `1` passes `--tune-allow-small` | `0` |
| `API_KEY` / `API_KEY_FILE` | key clients must send; file form for Docker secrets | made for you |
| `PORT` | port inside the container | `8080` |
| `PRESET` | preset name in `/data` | `docker` |
| `STRATA_SET` | advanced engine settings, space separated, like `strata launch --set` | none |

Route tail skip is off in the container as everywhere; `STRATA_SET="STRATA_ROUTE_TAIL_SKIP=7"` turns it on.

Settings are saved as a preset in the volume. Start with no settings and the saved preset is used; start with settings and they replace the saved ones (tuning results are kept). To change one thing, recreate the container with the new variable. To preview a choice without starting: `docker run --rm IMAGE strata launch --plan --family qwen --model q2_0`; all options: `docker exec strata strata launch --help`.

The volume `/data` holds `Strata-data/` (model files, prepared pack), `state/` (presets, tuning, the key), `install/` (run settings and logs), `home/`. The engine and Terminal are in the image, so updating the image never touches your files. To use a big disk, mount a folder: `-v /mnt/big/strata:/data` (writable by the container's user).

### Files you already have

Mount read-only and name it, for example `-v /srv/gguf/IQ3_XXS:/models:ro -e MODEL_PATH=/models -e FAMILY=qwen -e MODEL=IQ3_XXS`. The folder holds one model's files directly (not a folder of folders); a `MODEL_PATH` that is not mounted or has no `.gguf`, `.strata` or `.safetensors` files stops the start at once and nothing downloads. Measured with the IQ3_XXS files, the prepared pack is 1.5 GB, the DFlash2 drafter 0.8 GB on disk (1.2 GB download, once), and with `VISION=on` the picture reader 0.9 GB: 3.1 GB for the volume; with `DRAFTING=mtp` the MTP layer is about 6 GB, fetched once. Links to files work if their targets are mounted and `MODEL` is set.

### The API key

The server listens on every address inside the container, and Strata does not serve beyond this computer without a key, so a key is always on. Set it with `API_KEY` (16 characters or more; `openssl rand -hex 24`) or `API_KEY_FILE`; otherwise the first start makes one and keeps it in the volume. Show it: `docker exec strata strata launch --show-key --preset docker`. Publish `-p 127.0.0.1:8080:8080` to stay local; `-p 8080:8080` or `0.0.0.0` only when others should reach it, with a key you chose. Every request needs `Authorization: Bearer <key>`; `GET /health` answers without one. Security background: [[concepts/safety-and-privacy]].

### Connect, watch, stop, update

- OpenAI-compatible apps: base URL `http://127.0.0.1:8080/v1`, your key, model name from `GET /v1/models`. Anthropic-compatible apps (Claude Code): base URL `http://127.0.0.1:8080`, same key.
- `docker exec strata strata connect opencode` prints the file; add `--check` for one prompt and one tool call. It prints the address inside the container; use your published address. From a Terminal on the host: `strata connect opencode --url http://HOST:8080 --key <your key>` ([[concepts/connecting-coding-tools]]).
- `docker logs -f strata`; `docker exec -it strata strata monitor` (q leaves, server keeps running); `docker exec strata strata monitor --once`; `docker ps` shows "healthy" once loaded; `docker stop strata`; `docker start strata` (serving again in about a minute).
- Update: `docker pull ghcr.io/niko1221/strata:0.2.20-cuda13` (or `:latest-cuda13`), `docker stop strata && docker rm strata`, rerun the same `docker run` with the new tag (compose: `docker compose pull && docker compose up -d`). Models, pack, preset and tuning stay. A new engine can make old tuning less useful: start once with `-e TUNE=quick -e RETUNE=1`. `strata update` inside the container is not the way to update: the engine is part of the image (the XL edition page "Updating and Packaging").

## When To Use

- Linux server or workstation where you want a repeatable setup, a persistent volume and an always-on API.
- Not on a Mac (no Metal), and not for Radeon or Arc cards on Windows.
- Build it yourself when there is no registry access, no published image for a flavor, or you changed Strata: `tools/docker/build.sh --flavor cuda --engine ~/components/engine/<cuda13-package-folder> --tag strata:0.2.20-cuda13` (flavors `cuda`, `hip`, `sycl`); from source `docker build -t strata:src --build-arg STRATA_COMMIT=$(git rev-parse HEAD) -f tools/docker/Dockerfile.src .` (compiles CUDA 13 engines; `.git` is not copied, so `STRATA_COMMIT` is required). For GTX 10, P100 or V100 a CUDA 12 build is described in the guide.

## Risks & Pitfalls

- Wrong image or invisible card: "The engine in this image does not match this computer's graphics card", or the container stops at start (exit code 3 when no card reaches it).
- NVIDIA `could not select device driver ""` (the error continues with the gpu capability) or `unknown or invalid runtime name: nvidia`: the toolkit is missing. Fix: `sudo apt install nvidia-container-toolkit`, `sudo nvidia-ctk runtime configure --runtime=docker`, `sudo systemctl restart docker`, then `docker run --rm --gpus all ubuntu nvidia-smi`. If Strata says the driver is too old, you picked `cuda13` with a driver below 580.
- AMD `Permission denied` on `/dev/kfd`: add the two devices and the groups (use the render group's number, not the name); on SELinux add `--security-opt label=disable`.
- Intel no device: pass `--device /dev/dri` and the render group number; the host needs `i915` or `xe`.
- SELinux permission denied on a mount: add `:z` or `:Z` (named volume needs nothing).
- Killed or swapping: do not set a container memory limit; pick a smaller `MODEL`.
- `docker stop` slow or exit 137: use `--stop-timeout 120` (compose `stop_grace_period: 2m`).
- Port in use: `-p 127.0.0.1:9000:8080`.
- Older volumes: the 0.1.x image variables map to the new ones (`GGUF_DIR` to `MODEL_PATH`; `LOW_RAM`, `RESIDENT_BUDGET_GIB`, `KV_STREAMING`, `LAYER_SPLIT`, `CONFIG`, `REINSTALL` are ignored with a warning). If model files remain in `/data/models` and `MODEL_PATH` is unset, start stops to avoid a tens-of-GB re-download; name the folder or set `ALLOW_DOWNLOAD=1`.
- Podman (rootless Ubuntu 24.04, Podman 4.9.3, Tesla P100, `0.2.16-cuda12`): CDI may be unreadable with a newer `nvidia-ctk` (`unresolvable CDI devices nvidia.com/gpu=all`); the guide gives a manual device/library mount. A load can be killed by `systemd-oomd` (exit 137, `OOMKilled` false). From 0.2.17 the container frees that memory itself; `STRATA_OOMD_ROOM=0` turns it off. `--cgroups=disabled` is not a way out.
- Images run as root inside the container; do not mount folders you do not want it to read.
- Limits: Linux x86-64 hosts only; Radeon 780M (gfx1103) is experimental with its own engine package, not in the gfx110x image.
- A published result on one card does not establish support on others. The guide's history table records checks on specific cards (for example, 2026-11-23 `0.2.20-cuda13` on 2x RTX A4000 and `0.2.20-rocm-gfx120x` on Radeon AI PRO R9700 passed; `rocm-gfx110x` and `rocm-gfx1151` were not run on a card in the 2026-10-19 run).

## Related Concepts

- [[concepts/install-desktop-and-terminal]] - non-container install
- [[concepts/source-install]] - source builds
- the XL edition page "Intel Arc GPUs (SYCL engine)" - Arc model preparation
- [[concepts/multi-gpu]] - `GPUS` and `GPU_ROLES`
- [[concepts/connecting-coding-tools]] - `strata connect`
- [[concepts/safety-and-privacy]] - API key and network exposure

## Sources

- raw/github_doc-docs-docker-md.md - image table, commands, variables, troubleshooting, build steps
- raw/github_doc-tools-docker-dockerfile.md - image structure, paths, healthcheck, stop behavior
- raw/github_doc-tools-docker-compose-docker-compose-nvidia-yml.md - NVIDIA compose defaults
- raw/github_doc-tools-docker-compose-docker-compose-amd-yml.md - AMD compose defaults
- raw/github_doc-tools-docker-compose-docker-compose-intel-yml.md - Intel compose defaults
- raw/github_doc-tools-docker-compose-env-example.md - `.env` variables
- raw/github_doc-tools-docker-compose-mac-md.md - why Docker does not work on Mac
