Run Ollama in Docker (docker pull and docker run)

Last verified: 2026-09-06

  1. Install Docker Engine or Docker Desktop (Linux, macOS, or Windows with WSL2)
  2. Pull the image: docker pull ollama/ollama
  3. Start the container: docker run -d -v ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollama
  4. GPU (NVIDIA): add --gpus=all to docker run when the NVIDIA Container Toolkit is installed
  5. Pull a model inside the container: docker exec -it ollama ollama pull llama3.2
  6. Test: docker exec -it ollama ollama run llama3.2
  7. Host API URL: http://localhost:11434 — use docker exec -it ollama ollama list to confirm models

Back to catalog