Archived guide; claims awaiting source review.
How to Run Ollama: The Complete Guide
Everything you need to know to get local LLMs running on your machine.
How to run Ollama locally in 2026 requires a system with at least 8GB of VRAM for 8B parameter models or 16GB of Unified Memory on Apple Silicon to maintain acceptable latency. You must install the binary, pull the GGUF-based weights from the library, and interface via the CLI or the local REST API at port 11434. On an M3 Max with 64GB RAM, expect 35–50 tokens per second on Llama 3.1 8B (Q4_K_M). On NVIDIA RTX 4090 builds, this increases to 110+ tokens per second due to superior memory bandwidth.
- Download: Official Ollama binary for macOS, Linux, or Windows.
- Hardware: Minimum 8GB VRAM (NVIDIA) or 16GB RAM (Apple Silicon).
- Command:
ollama run llama3.1 - Outcome: You will have a private, low-latency LLM endpoint running on your local hardware without third-party API costs.
What Are the Ollama System and Hardware Requirements?
To run Ollama locally with acceptable latency in 2026, your hardware choices must prioritize memory bandwidth over raw compute power. LLMs are memory-bandwidth bound during generation. If your GPU cannot stream model weights fast enough from VRAM, your tokens per second (TPS) will crater.
1. GPU (Graphics Memory) Requirements
- Minimum for 8B models (e.g., Llama 3.1 8B): 8GB of dedicated VRAM (e.g., NVIDIA RTX 3080/4060) or 16GB of Unified Memory on Apple Silicon.
- Minimum for 27B models (e.g., Gemma 2 27B): 16GB to 24GB of VRAM (e.g., RTX 3090/4090, Apple Silicon 24GB+).
- Minimum for 70B models: 40GB to 48GB of VRAM (e.g., 2x RTX 3090/4090, Apple Silicon 64GB+).
2. CPU and System RAM
- RAM Capacity: Your system RAM must be at least 1.5x the size of the model file if you run on CPU. For GPU execution, RAM serves as a loading buffer, so 16GB (for 8B models) or 32GB (for larger models) is sufficient.
- CPU Capabilities: CPUs must support AVX2 instruction sets. Running models entirely on CPU is slow (sub-5 TPS), but a modern multi-core processor (Intel i7/AMD Ryzen 7 or higher) prevents bottlenecking during weights load.
How Do You Install Ollama and Run Your First Model?
Installing Ollama in 2026 remains a streamlined process, but the post-install verification is where most developers fail. On macOS and Windows, the installer handles the background service (daemon) setup automatically. On Linux, the one-line install script detects your distribution and configures a systemd service to ensure the model endpoint persists across reboots.
# Linux One-Line Installation
curl -fsSL https://ollama.com/install.sh | sh
# Verify installation by checking the version
ollama --version
# Pull and run Llama 3.1 8B in interactive mode
ollama run llama3.1
Once you execute ollama run, the CLI checks your local manifest. If the model is missing, it streams the manifest and blobs from the Ollama library. A successful run will drop you into a chat interface. To exit, use /bye. If you prefer to use Ollama as a headless backend for a Multi-Agent Build Template, simply run ollama serve and interact with it via the REST API.
How Do You Configure Ollama for Maximum Tokens Per Second (TPS)?
Optimizing local inference speed depends on your hardware's memory bandwidth and the quantization level of the model weights. To achieve the highest tokens per second (TPS), you must ensure your system is not falling back to CPU inference. For 2026 hardware, a Llama 3.1 8B model (Q4_K_M) should sustain up to 113 TPS on an NVIDIA RTX 4090 or 35–50 TPS on an Apple M3 Max.
Before running your first model, verify your GPU acceleration by checking the Ollama logs or using system monitoring tools like nvidia-smi or macOS Activity Monitor. If you notice high CPU usage but low GPU activity, your model layer offloading is failing.
# Set OLLAMA_NUM_PARALLEL to 4 to handle multiple requests simultaneously
# without significant TPS degradation on high-VRAM cards (24GB+)
export OLLAMA_NUM_PARALLEL=4
ollama serve
Performance also scales with the LLM Model Comparison Tool metrics. Using a 4-bit quantization (Q4_K_M) offers the best balance of speed and intelligence. Moving to 8-bit (Q8_0) typically results in a 20-30% drop in TPS while only marginally improving perplexity scores. For maximum throughput, always favor models that fit entirely within your dedicated VRAM or Unified Memory buffer to avoid the PCIe bus bottleneck.
What Is the Minimum VRAM Required for 70B Parameter Models?
Running 70B parameter models locally in 2026 requires a minimum of 40GB to 48GB of VRAM for 4-bit quantization (Q4_K_M). While a 70B model technically fits within a 48GB buffer (such as dual RTX 4090 setups), you must account for the KV cache and context window requirements. If your VRAM is exactly equal to the model size, the system will offload remaining layers to system RAM, causing tokens per second to drop from ~15 TPS to sub-2 TPS.
For Apple Silicon users, the Unified Memory Architecture allows for higher capacity but lower bandwidth compared to dedicated GDDR6X. An M2 Ultra or M3 Max with 64GB or 128GB of RAM is the baseline for 70B models to avoid swap file thrashing.
| Model Size | Quantization | VRAM Required | Recommended Hardware |
|---|---|---|---|
| 8B | Q8_0 | 9GB | RTX 3080 10GB / M3 16GB |
| 27B | Q4_K_M | 18GB | RTX 4080 16GB / M3 24GB |
| 70B | Q4_K_M | 42GB | 2x RTX 3090 / M3 64GB |
| 70B | Q8_0 | 72GB | 3x RTX 3090 / M3 128GB |
Before committing to a hardware build, use the NurevoFlow AI Stack Cost Calculator to determine if local ownership or cloud H100 rentals provide a better ROI for your specific inference volume.
Why Does Ollama Return a 404 Error on Port 11434?
A 404 error or a "connection refused" message on port 11434 typically indicates that the Ollama daemon is not active or is bound to the wrong network interface. By default, the service listens on 127.0.0.1:11434, restricting access to the local machine only. If you are attempting to connect from a Docker container or a frontend application, the request will fail unless the environment variables are updated.
To resolve this, you must set the OLLAMA_HOST variable to 0.0.0.0 to allow external connections.
# For Linux/macOS, restart the daemon with the global host address
export OLLAMA_HOST=0.0.0.0:11434
ollama serve
# Verify the service is listening on all interfaces
netstat -an | grep 11434
On Windows, you must edit the environment variables through the System Properties menu and restart the Ollama tray application. If the error persists, check your local firewall to ensure port 11434 is not being blocked for inbound traffic.
Can You Run Ollama on Android Devices Using Termux?
Yes, you can run Ollama on Android devices using Termux, but it is limited to CPU-based inference. This setup is popular for portable testing and privacy-first mobile development.
To configure Ollama on Android:
- Install Termux from F-Droid (do not use the outdated Google Play version).
- Set up a Linux environment inside Termux using a PRoot-distro (Ubuntu is recommended):
pkg update && pkg install proot-distro proot-distro install ubuntu proot-distro login ubuntu - Download the ARM64 Ollama binary inside your Ubuntu container:
curl -fsSL https://ollama.com/install.sh | sh - Launch the Ollama daemon:
ollama serve & - Run a lightweight model: To maintain usable speed, run models optimized for low footprints, such as
qwen2:0.5borllama3.2:1b.ollama run llama3.2:1b
Note: Running Ollama natively on Android via Termux relies entirely on your phone's CPU. Without hardware acceleration, expect speeds between 2 to 6 tokens per second on a flagship Snapdragon processor.
How Do You Fix Environment Variable Conflicts on Windows and Linux?
Environment variable conflicts often prevent Ollama from detecting the correct GPU, especially when multiple versions of the CUDA toolkit exist. On Linux, a common issue is the OLLAMA_MODELS path defaulting to a root partition with limited space. If the service is running via systemd, variables set in your .bashrc will be ignored because the service runs in its own shell context.
To fix this on Linux, you must edit the systemd service file directly.
# Linux: Editing the systemd service to ensure variables are respected
sudo systemctl edit ollama.service
# Add these lines between the comments:
[Service]
Environment="OLLAMA_HOST=0.0.0.0"
Environment="OLLAMA_MODELS=/mnt/fast_nvme/ollama_models"
# Reload and restart
sudo systemctl daemon-reload
sudo systemctl restart ollama
On Windows, use the "Edit the system environment variables" GUI to set OLLAMA_NUM_PARALLEL globally. Failing to do this results in the daemon defaulting to a single model load, creating latency spikes during multi-agent task switching.
Specifying Multiple GPUs (CUDA_VISIBLE_DEVICES)
Users often search for an OLLAMA_NUM_GPU variable, but Ollama does not use this. Instead, Ollama automatically detects all compatible GPUs on your system. To restrict Ollama to specific graphics cards in multi-GPU rigs, configure the standard CUDA driver variable:
# Force Ollama to only use the first GPU
export CUDA_VISIBLE_DEVICES=0
ollama serve
Connecting Ollama to Frontend UIs (SillyTavern, Open WebUI)
Ollama is a headless API provider. To chat with your local models using rich visual interfaces or character cards, you can connect Ollama's local REST API endpoint (http://localhost:11434) to third-party frontends.
Connecting to SillyTavern
SillyTavern is a highly customizable frontend for local and API-based LLMs. To configure Ollama as a SillyTavern backend:
- In SillyTavern, open the API Connections menu (plug icon).
- Set the API Type to
OllamaorOpenAI(Ollama provides an OpenAI-compatible endpoint at/v1). - Set the API URL to
http://localhost:11434(if running locally) orhttp://YOUR_SERVER_IP:11434(if hosted on a local network). - Click Connect to load your pulled local models (e.g., Llama 3.1 8B or Mistral).
How Do You Verify If Ollama Is Using Your GPU Instead of Your CPU?
Determining whether your local LLM is running on the GPU is critical. When Ollama defaults to the CPU, performance drops from 50+ TPS to less than 5 TPS on 8B models. This happens if CUDA drivers are outdated or if the model size exceeds the available Unified Memory on macOS.
Use the ollama ps command to inspect hardware allocation.
# Check running models and hardware allocation
ollama ps
# Output should look like this if successful:
# NAME ID SIZE PROCESSOR UNTIL
# llama3.1:latest 8eeb17b73599 4.7 GB 100% GPU 4 minutes from now
On NVIDIA hardware, run nvidia-smi while the model is generating. If VRAM usage does not spike, Ollama is ignoring the GPU. On macOS, use Activity Monitor's "GPU History" window. If you find only partial offloading, you must reduce the model's quantization level to ensure the weights fit within your graphics memory.
FAQ
How do I update Ollama to the latest version?
On macOS and Windows, the Ollama tray icon provides an "Update" notification. Linux users must re-run the official install script via curl -fsSL https://ollama.com/install.sh | sh to overwrite the existing binary with the latest 2026 build.
Can I run multiple models simultaneously on one GPU?
Yes, by setting the OLLAMA_MAX_LOADED_MODELS environment variable to a value greater than 1. You must ensure the combined VRAM requirements of all loaded models do not exceed your hardware capacity.
Why is my local LLM slower than the OpenAI API?
Local inference speed is governed by hardware memory bandwidth. While cloud APIs handle high concurrency, a local RTX 4090 often provides lower latency for single-user requests if the model fits entirely in VRAM.
Does Ollama support external GPU (eGPU) setups?
Ollama supports eGPUs on Linux and Intel-based Macs via Thunderbolt with proper driver configuration. On Apple Silicon, eGPUs are not supported; the system relies on integrated Unified Memory.