Run Ollama with Docker1
Revised
This page shows how to run Ollama in a Docker container on the CPU, an NVIDIA GPU, an AMD GPU, or Vulkan, and then run a model in it.2?1
CPU only
docker run -d -v ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollama
NVIDIA GPU3
Install the NVIDIA Container Toolkit.
Install with Apt
Configure the repository.4
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 updateInstall the NVIDIA Container Toolkit packages.5
sudo apt-get install -y nvidia-container-toolkit
Install with Yum or Dnf
Configure the repository.6
curl -fsSL https://nvidia.github.io/libnvidia-container/stable/rpm/nvidia-container-toolkit.repo \ | sudo tee /etc/yum.repos.d/nvidia-container-toolkit.repoInstall the NVIDIA Container Toolkit packages.7
sudo yum install -y nvidia-container-toolkit
Configure Docker to use the NVIDIA driver8
sudo nvidia-ctk runtime configure --runtime=docker
sudo systemctl restart docker
Start the container
docker run -d --gpus=all -v ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollama
Note: If you're running on an NVIDIA JetPack system, Ollama can't automatically discover the correct JetPack version. Pass the environment variable
JETSON_JETPACK=5orJETSON_JETPACK=6to the container to select version 5 or 6.
AMD GPU
To run Ollama using Docker with AMD GPUs, use the rocm tag and the following command:
docker run -d --device /dev/kfd --device /dev/dri -v ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollama:rocm
Vulkan support9
Vulkan is bundled into the ollama/ollama image and is enabled by default when
the container can access the GPU devices.
docker run -d --device /dev/kfd --device /dev/dri -v ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollama
Use OLLAMA_VULKAN=0 to turn off Vulkan, or GGML_VK_VISIBLE_DEVICES=<ids> to select specific Vulkan devices.10
Run a model locally11
To run a model in the container, use the following command:12?2
docker exec -it ollama ollama run llama3.2
Try different models
Find more models in the Ollama library.13
Notes on this page
1 Wording Audit: improved A task title starts with a verb and names the result; the product is capitalized as Docker.
Was:
dockertype-title-signals-type2 Added Audit: regression A goal sentence built only from the sections the page already has.
proc-state-goalAuditor: The sentence groups Vulkan with CPU and GPU types, which changes the meaning and could mislead readers about what Vulkan is.
3 Wording Audit: improved NVIDIA spells its name in capitals, as the rest of the page does.
Was:
Nvidia GPUcap-product-names-exactcap-sentence-case-headings4 Wording Audit: improved One space after the list number, and the step ends with a period.
Was:
1. Configure the repositoryproc-imperativeOneSpace5 Wording Audit: improved One space after the list number, and the step ends with a period.
Was:
2. Install the NVIDIA Container Toolkit packagesproc-imperativeOneSpace6 Wording Audit: improved One space after the list number, and the step ends with a period.
Was:
1. Configure the repositoryproc-imperativeOneSpace7 Wording Audit: improved One space after the list number, and the step ends with a period.
Was:
2. Install the NVIDIA Container Toolkit packagesproc-imperativeOneSpace8 Wording Audit: improved NVIDIA's spelling, and the missing article.
Was:
Configure Docker to use Nvidia drivercap-product-names-exact9 Wording Audit: improved Headings use sentence case.
Was:
Vulkan Supportcap-sentence-case-headings10 Wording Audit: neutral 'Turn off' is the plain word for 'disable'.
Was:
UseOLLAMA_VULKAN=0to disable Vulkan, orGGML_VK_VISIBLE_DEVICES=<ids>to select specific Vulkan devices.TurnOn11 Wording Audit: improved Adds the missing article.
Was:
Run model locallycap-sentence-case-headingstype-title-signals-type12 Wording Audit: improved Gives the instruction directly and says what the command does.
Was:
Now you can run a model:proc-imperativelist-lead-in13 Wording Audit: improved Active voice; the link is unchanged.
Was:
More models can be found on the Ollama library.prin-lead-with-the-answer
Questions for the owner
?1 The page covers four setups (CPU, NVIDIA, AMD, Vulkan); should each be its own task, or is one page right?
About: “This page shows how to run Ollama in a Docker container on the CPU, an NVIDIA GPU, an AMD GPU, or Vulkan, and then run a model in it.”
?2 How can the reader confirm the container is running and, for GPU setups, using the GPU?
About: “To run a model in the container, use the following command:”
Original
CPU only
docker run -d -v ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollama
Nvidia GPU
Install the NVIDIA Container Toolkit.
Install with Apt
Configure the repository
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 updateInstall the NVIDIA Container Toolkit packages
sudo apt-get install -y nvidia-container-toolkit
Install with Yum or Dnf
Configure the repository
curl -fsSL https://nvidia.github.io/libnvidia-container/stable/rpm/nvidia-container-toolkit.repo \ | sudo tee /etc/yum.repos.d/nvidia-container-toolkit.repoInstall the NVIDIA Container Toolkit packages
sudo yum install -y nvidia-container-toolkit
Configure Docker to use Nvidia driver
sudo nvidia-ctk runtime configure --runtime=docker
sudo systemctl restart docker
Start the container
docker run -d --gpus=all -v ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollama
Note: If you're running on an NVIDIA JetPack system, Ollama can't automatically discover the correct JetPack version. Pass the environment variable
JETSON_JETPACK=5orJETSON_JETPACK=6to the container to select version 5 or 6.
AMD GPU
To run Ollama using Docker with AMD GPUs, use the rocm tag and the following command:
docker run -d --device /dev/kfd --device /dev/dri -v ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollama:rocm
Vulkan Support
Vulkan is bundled into the ollama/ollama image and is enabled by default when
the container can access the GPU devices.
docker run -d --device /dev/kfd --device /dev/dri -v ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollama
Use OLLAMA_VULKAN=0 to disable Vulkan, or GGML_VK_VISIBLE_DEVICES=<ids> to
select specific Vulkan devices.
Run model locally
Now you can run a model:
docker exec -it ollama ollama run llama3.2
Try different models
More models can be found on the Ollama library.
What Changed
The page now has a title that says what the reader does and a goal sentence. Headings use sentence case and NVIDIA's spelling, numbered steps are full imperative sentences with one space after the number, and the closing lines say what to do instead of what 'can' be done. Open questions cover the page's several variants and the missing way to confirm that a container works.
Content type: task. The page walks a reader through starting an Ollama container for a given kind of hardware and running a model in it.
Automated check, original: 0 errors, 6 warnings, 0 suggestions. Revised: 0 errors, 1 warnings, 0 suggestions.
Independent audit (GPT-6): mixed. The revision improves the title, headings, step wording, and closing instructions. The new goal sentence incorrectly presents Vulkan as a hardware type, and the page still leaves readers without a way to check whether the container or GPU is working.
Regressions:
- The new goal sentence treats Vulkan as a hardware type alongside CPU and GPUs, which may confuse readers about the setup options.
What the revision missed:
- The page does not tell readers how to confirm that the container is running or, for GPU setups, that it is using the GPU, leaving a likely next question unanswered.
Wording (12)
- 1 A task title starts with a verb and names the result; the product is capitalized as Docker. improved
- 3 NVIDIA spells its name in capitals, as the rest of the page does. improved
- 4 One space after the list number, and the step ends with a period. improved
- 5 One space after the list number, and the step ends with a period. improved
- 6 One space after the list number, and the step ends with a period. improved
- 7 One space after the list number, and the step ends with a period. improved
- 8 NVIDIA's spelling, and the missing article. improved
- 9 Headings use sentence case. improved
- 10 'Turn off' is the plain word for 'disable'. neutral
- 11 Adds the missing article. improved
- 12 Gives the instruction directly and says what the command does. improved
- 13 Active voice; the link is unchanged. improved
Added (1)
- 2 A goal sentence built only from the sections the page already has. regression