Quick Start
CPU Only
Run Ollama using CPU inference:- Volume mount for persistent model storage
- Port 11434 exposed for API access
- Background daemon mode
GPU Support
NVIDIA GPU
For NVIDIA GPU acceleration, you need the NVIDIA Container Toolkit.For NVIDIA JetPack systems, set the JetPack version:Use
JETSON_JETPACK=6 for JetPack 6.AMD GPU (ROCm)
For AMD GPU support, use therocm tag:
- Radeon RX 7900, 7800, 7700, 7600 series
- Radeon RX 6900, 6800 series
- Radeon PRO W7000/W6000 series
- AMD Instinct MI series
Vulkan Support
Vulkan provides cross-platform GPU acceleration and is bundled in the standard image:Using Ollama in Docker
Run a Model
Execute commands inside the running container:Pull Models
List Models
Check Running Models
Docker Compose
Create adocker-compose.yml file:
API Access
Access the Ollama API from the host machine:Configuration
Environment Variables
Customize Ollama behavior with environment variables:| Variable | Description | Default |
|---|---|---|
OLLAMA_HOST | Server bind address | 0.0.0.0:11434 |
OLLAMA_DEBUG | Enable debug logging | 0 |
OLLAMA_MODELS | Model storage path | /root/.ollama/models |
OLLAMA_KEEP_ALIVE | Model keep-alive time | 5m |
OLLAMA_NUM_PARALLEL | Max parallel requests | 1 |
OLLAMA_MAX_LOADED_MODELS | Max concurrent models | 3 |
OLLAMA_VULKAN | Enable Vulkan acceleration | 0 |
JETSON_JETPACK | JetPack version (5 or 6) | Auto-detect |
Custom Model Location
Mount a custom directory for models:Using a Proxy
Configure proxy settings:Custom CA Certificate
For self-signed certificates, create a custom image:Networking
Expose on Network
By default, Ollama binds to0.0.0.0 in the container. Access from other machines:
Custom Network
Create a custom Docker network for inter-container communication:Updates
Update the Ollama container:ollama volume.
Logs and Debugging
View Container Logs
Follow Logs in Real-time
Enable Debug Mode
Interactive Shell
Troubleshooting
GPU Not Detected
For NVIDIA:-
Verify the container runtime:
-
Check Docker daemon configuration:
- Ensure nvidia-container-toolkit is installed
-
Check device permissions:
-
Add appropriate group permissions:
Container Keeps Restarting
-
Check logs for errors:
-
Verify port availability:
-
Check system resources:
Cgroup Issues on Linux
If GPU discovery fails after some time, disable systemd cgroup management in Docker. Edit/etc/docker/daemon.json:
Browse More Models
Explore available models at ollama.com/library.Next Steps
API Reference
Integrate Ollama API in your applications
GPU Configuration
Optimize GPU settings and performance
Linux Setup
Install Ollama directly on Linux
Model Library
Browse available models