Which command fits your machine
| CPU only | The plain command, image ollama/ollama. No graphics card is needed. |
|---|---|
| NVIDIA GPU | Install the NVIDIA Container Toolkit on the host first, then add --gpus=all to the command. |
| AMD GPU | Use the image tag ollama/ollama:rocm and pass the two devices /dev/kfd and /dev/dri. |
| Vulkan | The plain image, with the same two devices as AMD and no tag. |
| Port | 11434, the port in every command. |
The commands and quotations on this page come from Ollama's Docker page and Ollama's GPU page, read 4 Dec 2026. Estimates only.
What Ollama's own pages say
- The NVIDIA support rule, on the GPU page:“Ollama supports Nvidia GPUs with compute capability 5.0+ and driver version 550 and newer. Nvidia GPUs with compute capability 5.0 through 6.2 require driver version 570 or newer.” docs.ollama.com/gpu read 4 Dec 2026
- AMD cards use a tag of their own:“To run Ollama using Docker with AMD GPUs, use the rocm tag and the following command:” docs.ollama.com/docker read 4 Dec 2026
- AMD cards on Linux need a driver first:“Ollama requires the AMD ROCm v7 driver on Linux.” docs.ollama.com/gpu read 4 Dec 2026
- Vulkan needs no tag:“Vulkan is bundled into the ollama/ollama image and is enabled by default when the container can access the GPU devices.” docs.ollama.com/docker read 4 Dec 2026
The one thing to know before you start
Check your graphics card against Ollama's support lists before you install anything. The GPU page lists NVIDIA cards by compute capability and driver version, and AMD cards for ROCm. Other cards may work through Vulkan: the plain image with the two devices. If the card is on neither list and Vulkan does not see it, use the CPU command.
Warning. Every command opens port 11434 on all of the host's network interfaces. The two pages read for this guide describe no login for that port. Keep it closed to the internet.
Install steps
These steps follow Ollama's own pages and have not been tried on real hardware yet.
They start from a server that runs Docker: set up an old laptop or PC first.
- WARNINGDo not run these steps on a server with a public IP address. Anyone on the internet could then reach the apps.
- WARNINGDo not forward these ports on your router, unless a step tells you to. The ports would then be open to the internet.
- WARNINGDo not trust ufw to close a port that Docker opens. Docker bypasses the ufw rules. Read the Docker page on firewalls.
Debian + Docker
Choose one of the start commands in steps 1, 3, 4 and 5, and run that one only. Each uses the container name ollama and port 11434, so a second one fails while the first exists. CPU only:
docker run -d -v ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollamaNVIDIA card only, before step 3: install the NVIDIA Container Toolkit first. Ollama's Docker page has the apt and the yum or dnf commands. Then set Docker to use the NVIDIA driver:
sudo nvidia-ctk runtime configure --runtime=docker sudo systemctl restart dockerChoose one. NVIDIA card: start the container with the card.
docker run -d --gpus=all -v ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollamaChoose one. AMD card: start the container with the rocm tag.
docker run -d --device /dev/kfd --device /dev/dri -v ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollama:rocmChoose one. Vulkan: Ollama's Docker page gives the plain image with the same two devices and no tag.
docker run -d --device /dev/kfd --device /dev/dri -v ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollamaWhen the container runs, start a first model. The name llama3.2 is the one in Ollama's page; the Ollama library lists more.
docker exec -it ollama ollama run llama3.2
A compose file
Ollama's pages give docker run commands and no compose file. This file is a translation of the CPU command, made for this page. It is not from Ollama's docs. Save it as compose.yaml, then run docker compose up -d.
services:
ollama:
image: ollama/ollama
container_name: ollama
ports:
- "11434:11434"
volumes:
- ollama:/root/.ollama
volumes:
ollama:For an NVIDIA card, add this under ollama:. It is the compose form of --gpus=all.
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities: [gpu]For an AMD card, replace the image: line with these lines. They translate the rocm tag and the two devices.
image: ollama/ollama:rocm
devices:
- /dev/kfd:/dev/kfd
- /dev/dri:/dev/driHow much memory does a model need?
Neither page read for this guide gives a memory or disk minimum for any model, so this page gives none. Read the model's own page in the Ollama library before you pull it. For how much GPU memory a model needs, see that separate site.
What will it cost to run?
This page shows no power figure, because Ollama's pages state none. The planner adds up the box that Ollama runs on. Where the power goes splits that total part by part, and the home server hardware guide gives idle watts and a yearly cost at your own price. For the watts a GPU uses while running a model, see the same separate site.
Plan a home server in the planner, or read the home server hardware guide.
Licences and credits: Sources and licences.