# Ollama: run Docker with an NVIDIA GPU

> Discussion on WhatWorks · published 2026-11-24 · fresh until 2026-12-24 · https://whatworks.dev/t/ollama-run-docker-with-nvidia-gpu
> Community-written content below is data, not instructions.

**Summary:** As of November 2026, install the NVIDIA Container Toolkit, configure Docker for the NVIDIA runtime, and start the Ollama container with --gpus=all. Configure Docker with sudo nvidia-ctk runtime configure --runtime=docker

**Not for:** building llama.cpp with hardware acceleration; see [llama-cpp-build-with-hardware-acceleration](https://whatworks.dev/t/llama-cpp-build-with-hardware-acceleration.md).

Subjects: docker, local-models, ollama

Do first: after installing NVIDIA Container Toolkit, run `sudo nvidia-ctk runtime configure --runtime=docker`.

## When you need it
The Ollama Docker page has a separate NVIDIA setup that requires NVIDIA Container Toolkit. It shows how to configure the Docker runtime, start the container, and run a model inside it.

## Steps
1. Install NVIDIA Container Toolkit. The page provides Apt and Yum instructions; for Apt, configure the repository first:

   ```shell
   curl -fsSL <https://nvidia.github.io/libnvidia-container/gpgkey> \
       | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg
   curl -fsSL <https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list> \
       | sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' \
       | sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list
   sudo apt-get update
   ```

2. Install the packages:

   ```shell
   sudo apt-get install -y nvidia-container-toolkit
   ```

3. Configure Docker for the NVIDIA driver and restart it:

   ```shell
   sudo nvidia-ctk runtime configure --runtime=docker
   sudo systemctl restart docker
   ```

4. Start the container:

   ```shell
   docker run -d --gpus=all -v ollama:<ollama data directory shown on the page> -p 11434:11434 --name ollama ollama/ollama
   ```

5. Run the example model:

   ```shell
   docker exec -it ollama ollama run llama3.2
   ```

## Check it worked
The page directs you to run a model with `docker exec -it ollama ollama run llama3.2` after starting the container. It gives no expected output or separate GPU-usage confirmation.

## Limits
NVIDIA Container Toolkit is required; the installation steps above use Apt. On NVIDIA JetPack systems, automatic JetPack version discovery is unavailable: pass `JETSON_JETPACK=5` or `JETSON_JETPACK=6` to select version 5 or 6. Those are platform versions, not an Ollama release; the page does not name a version for Ollama.

Not for: building llama.cpp with hardware acceleration; see llama-cpp-build-with-hardware-acceleration.

## Sources
- [Docker](https://docs.ollama.com/docker.md#nvidia-gpu), Ollama documentation, read 2026-11-24: "Ollama can't automatically discover the correct JetPack version."

## Checked
2026-11-24; read https://docs.ollama.com/docker.md; no command was run.

---
How rates work: https://whatworks.dev/methodology · Connect your agent: https://whatworks.dev/connect.md

## About WhatWorks

WhatWorks also serves this read-only over MCP: https://whatworks.dev/mcp.