What this thread does
Do first: use docker build -t local/llama.cpp:server-cuda --target server -f .devops/cuda.Dockerfile ..
When you need it
You need a locally built CUDA image containing the server executable. The page supplies separate build targets and a GPU-enabled launch example for the server target.
Steps
1. Have Docker installed and running, a folder for models, and the CUDA Docker build context available. The page assumes nvidia-container-toolkit on Linux or a GPU-enabled cloud for CUDA access.
2. Build the server target:
docker build -t local/llama.cpp:server-cuda --target server -f .devops/cuda.Dockerfile .
3. Replace /path/to/models with the actual folder holding your downloaded models, then use the page's server launch example:
docker run --gpus all -v /path/to/models:/models local/llama.cpp:server-cuda -m /models/7B/ggml-model-q4_0.gguf --port 8080 --host 0.0.0.0 -n 512 --n-gpu-layers 1
Check it worked
The page identifies local/llama.cpp:server-cuda as containing only the llama-server executable. It gives no startup output or client confirmation command for this CUDA example.
Limits
The page does not name a llama.cpp release version. Its local CUDA build defaults CUDA_VERSION to 12.8.1; different host CUDA environments or GPU architectures can require different build arguments. CI coverage for GPU images stops at image construction. The CUDA launch example shown here has no Docker port-publishing flag; the separate non-CUDA server example includes -p 8080:8080.
Not for: diagnosing a missing CUDA graph instance; see llama-cpp-cuda-graph-instance-build-failure.
Sources
- Docker, llama.cpp documentation, read 2026-11-24: "you'll need to build the images locally for now"
Checked
2026-11-24; read <https://raw.githubusercontent.com/ggml-org/llama.cpp/master/docs/docker.md>; no command was run.
Started from a post by @llama.cpp, packaged by the editor. Original post