๐ฆ Ollama
![]()
Ollama allows you to run large language models (LLMs) locally on your own hardware. It supports popular models like Llama, Mistral, Gemma, and many more โ with a simple command-line interface and REST API for easy integration.
This container provides a self-hosted AI inference server that can be used by applications like Open WebUI, LibreChat, or any other OpenAI-compatible client.
๐ท๏ธ Category: AI / LLM
๐ณ Image: ollama/ollama
๐ Links
| ย | ย |
|---|---|
| ๐ฆ Project | github.com/ollama/ollama |
| ๐ Support | GitHub Issues |
| ๐ Docs | ollama.com |
| ๐ Library | ollama.com/library |
๐ Ports
| Port | Protocol | Description |
|---|---|---|
11434 | TCP | Ollama API port โ used for model inference and management |
๐พ Volumes
| Host Path | Container Path | Description |
|---|---|---|
/mnt/cache/appdata/ollama | /root/.ollama | Storage for downloaded models and configuration |
โ๏ธ Environment Variables
| Variable | Default | Masked | Description |
|---|---|---|---|
OLLAMA_HOST | 0.0.0.0:11434 | โ | Bind address for the Ollama API. Use 0.0.0.0 to accept connections from any IP |
OLLAMA_MODELS | /root/.ollama/models | โ | Path where models are stored inside the container |
OLLAMA_ORIGINS | `` | โ | Allowed CORS origins (comma-separated). Set to * to allow all origins |
OLLAMA_KEEP_ALIVE | 5m | โ | Duration to keep models loaded in memory after last request (e.g., 5m, 1h, 24h) |
OLLAMA_NUM_PARALLEL | 1 | โ | Number of parallel model requests to handle simultaneously |
OLLAMA_MAX_LOADED_MODELS | 1 | โ | Maximum number of models to keep loaded in memory at once |
OLLAMA_FLASH_ATTENTION | false | โ | Enable Flash Attention for faster inference on supported GPUs |
OLLAMA_KV_CACHE_TYPE | `` | โ | KV cache quantization type: f16, q8_0, q4_0 (reduces VRAM usage) |
OLLAMA_GPU_OVERHEAD | `` | โ | Reserve VRAM overhead (in bytes) for other GPU applications |
OLLAMA_DEBUG | false | โ | Enable debug logging for troubleshooting |
TZ | Europe/Vienna | โ | Timezone of the container, e.g. Europe/Vienna or Europe/Berlin |
PUID | 500 | โ | User ID for file permissions (MOS default: 500) |
PGID | 500 | โ | Group ID for file permissions (MOS default: 500) |
๐ Quick Start
- Open the MOS Hub and search for Ollama
- Adjust the
OLLAMA_ORIGINSvariable if you need CORS access from specific domains - For GPU support, ensure your host has NVIDIA Driver Plugin installed via MOS Hub
- Click Install
- Pull your first model:
docker exec -it ollama ollama pull llama3.2
- Test the API:
curl http://YOUR_HOST_IP:11434/api/generate -d '{
"model": "llama3.2",
"prompt": "Hello, how are you?"
}'
๐ง GPU Support (NVIDIA)
For NVIDIA GPU acceleration, ensure you have:
- NVIDIA Driver installed on your host via MOS Hub Plugin
- The container will automatically use available GPUs when properly configured.
๐ Recommended Models
| Model | Size | Use Case |
|---|---|---|
llama3.2 | 2-4 GB | General purpose, fast responses |
mistral | 4-7 GB | Good reasoning and instruction following |
gemma2 | 3-9 GB | Googleโs efficient models |
codellama | 4-17 GB | Code generation and completion |
llava | 4-7 GB | Vision โ image understanding |
๐ OpenAI-Compatible API
Ollama provides an OpenAI-compatible API endpoint at:
http://YOUR_HOST_IP:11434/v1/chat/completions
Use this URL in applications that expect an OpenAI API endpoint. No API key required!
โ ๏ธ Note: Downloaded models can be large (2-50+ GB). Ensure you have sufficient storage in your volume mount (
/mnt/cache/appdata/ollama).
๐ก Tip: Use
OLLAMA_KEEP_ALIVE=24hto keep models loaded and avoid reload delays during active usage periods.
๐ก Tip: For multiple concurrent users, increase
OLLAMA_NUM_PARALLELandOLLAMA_MAX_LOADED_MODELSaccordingly.
๐ For more information: Visit the official Ollama documentation for details on all available models, API endpoints, and advanced configuration options.