Your mini PC can serve AI models to every device in your houseâhereâs how to get there in under 30 minutes. Ollama is the easiest way to run LLMs locally: free, open-source, and available on Linux, macOS, and Windows. This guide walks you from installation to a network-accessible AI server with a ChatGPT-like web UI. If you havenât chosen hardware yet, see our best mini PC for AI buyerâs guide; for mini PCs for virtualization, we have a separate pillar. To confirm your machine has enough memory, check our RAM and VRAM requirements for running AI models locally.
Prerequisites
Hardware Requirements
Minimum 16 GB RAM (8 GB only handles tiny models). What you can run at each tier:
- 16 GB â 7Bâ8B parameter models (Llama 3.2 8B, Phi-4 3.8B). Comfortable for a single chat model.
- 32 GB â Up to 14B models (DeepSeek-R1 14B, DeepSeek-Coder-V2 16B). Good for coding assistants.
- 64 GB â Up to 32B models (Qwen 2.5 32B). The sweet spot for power users who want one large model loaded.
- 128 GB â 70B models (Llama 3.1 70B). Requires high memory bandwidth to be practical; DDR5 or LPDDR5X strongly recommended.
Before starting, check your GPU compatibility. NVIDIA cards need CUDA drivers (535+), AMD cards need ROCm 6.0+ (Linux only), and Apple Silicon uses Metal automatically. Arsturnâs Ollama hardware guide has a full compatibility checklist if you need to double-check.
Choose Your OS
Each operating system has trade-offs for running Ollama:
- Ubuntu Server 22.04+ â Best for headless operation. Strongest Docker and GPU driver support, most community guides target Linux, and systemd makes auto-start trivial. If you plan to run other services alongside Ollama, this is the safest choice.
- macOS 14+ â Simplest install experience. Metal GPU acceleration works automatically with zero configuration, and unified memory means all your RAM is available as âGPU memory.â The downside: no CUDA support and fewer Docker-native workflows.
- Windows 11 â GUI-friendly with full CUDA support for NVIDIA GPUs. Slightly more overhead than Linux, and some advanced features (like systemd services) require workarounds. Good if you also use the machine as a desktop.
If you run Proxmox as your hypervisor, you can host Ollama inside a VM or LXC container instead. See our how to run AI models on Proxmox VE guide for that path.
Network Plan
Decide up front whether the server stays local-only or should be reachable from other devices. A DHCP reservation (set in your router) or a static IP on the mini PC avoids the headache of the address changing after a reboot. If you plan to install Open WebUI later, youâll need port 3000 accessible from client devices. Ollamaâs API listens on port 11434 by defaultâother tools and scripts on your network will hit that port to send prompts.
Step 1 â Install Ollama
Linux (Native)
curl -fsSL https://ollama.com/install.sh | shThe install script downloads the Ollama binary, creates a dedicated ollama system user, and registers a systemd service so Ollama starts automatically on boot. It also auto-detects installed GPU driversâif NVIDIA or AMD drivers are present, Ollama will use them without additional configuration. Verify the installation with ollama --version.
Linux (Docker)
docker run -d --gpus all -p 11434:11434 --name ollama ollama/ollamaUse Docker when you want isolationâespecially inside a Proxmox LXC container, in multi-tenant environments, or when you want easy rollback (just remove the container and re-pull). The --gpus all flag passes NVIDIA GPUs into the container; make sure you have the NVIDIA Container Toolkit installed on the host. For AMD ROCm GPUs, replace --gpus all with --device=/dev/kfd --device=/dev/dri to expose the GPU devices directly. For GPU passthrough and Ollama on Proxmox VMs or LXC, see our how to run AI models on Proxmox VEâwe donât repeat those steps here.
macOS
Download from ollama.com, drag to Applications, and run the first-launch wizard. The app installs a CLI tool alongside the GUIâafter the first launch, ollama is available in Terminal for all commands in this guide. Note that the first run downloads roughly 1 GB of runtime components, so give it a minute on slower connections.
Windows
Download the installer from ollama.com and run it. The installer adds ollama to your system PATH so it works from any PowerShell or Command Prompt window. You may see a Windows Defender SmartScreen prompt or a firewall dialog during installationâallow both. Verify in PowerShell with ollama --version.
Step 2 â Pull and Run Your First Model
The ollama pull command downloads GGUF-format model weights from the Ollama library to your local machine. File sizes range from about 2 GB for small models to 20+ GB for large ones, so the first pull takes a few minutes depending on your connection.
Pick a model based on your RAM and use case:
- Quick test (any RAM):
ollama pull phi4:3.8bâ Smallest practical model, fast even on CPU. Good for verifying your install works. - General chat (16 GB):
ollama pull llama3.2:8bâ Solid all-around model for conversation, summarization, and Q&A. - Coding assistant (32 GB):
ollama pull deepseek-coder-v2:16borollama pull deepseek-r1:14bâ Strong at code generation, debugging, and technical writing. - Power user (64 GB):
ollama pull qwen2.5:32bâ Noticeably smarter responses; handles complex reasoning and long documents.
Once a model is downloaded, run it interactively:
ollama run llama3.2:8bType a prompt and watch. The first generation may take a few seconds to start while Ollama loads the model into memory. After that, tokens appear in a stream. On a 64 GB LPDDR5X mini PC with GPU offload, expect roughly 20â25 tok/s for 8B models. On CPU-only with DDR4, expect 5â10 tok/s. Press Ctrl+D to exit the interactive session.
Step 3 â Verify GPU Acceleration
NVIDIA (CUDA)
Run nvidia-smi to confirm your driver is loaded and shows your GPU. You need driver version 535 or newer for Ollamaâs CUDA support. Ollama auto-detects NVIDIA GPUs at startupâcheck the logs to confirm:
journalctl -u ollama | grep -i cudaYou should see a line containing âusing CUDA.â If Ollama fell back to CPU, the logs will say so, and youâll need to update your driver or reinstall Ollama after the driver update.
AMD (ROCm)
ROCm is Linux only. Check that your GPU is visible with rocm-smi. You need ROCm 6.0 or newer installed. ROCm support has improved significantly, but can still be tricky on some cardsâif Ollama doesnât detect the GPU, verify that the amdgpu kernel module is loaded with lsmod | grep amdgpu. Some models may fall back to CPU even with ROCm present; check ollama ps to confirm the backend.
Apple (Metal)
Metal acceleration is automatic on macOS with Apple Siliconâno drivers to install, no flags to set. Verify by running ollama ps while a model is loaded; the backend column should show âmetal.â Because Apple Silicon uses unified memory, thereâs no separate âGPU memoryââyour total system RAM is your GPU memory. A 64 GB M4 Pro can fully offload a 32B model into Metal.
CPU-Only Fallback
If no supported GPU is detected, Ollama falls back to CPU inference. This is still usable for light tasksâexpect roughly 5â15 tok/s for 7Bâ8B models depending on your CPU and memory bandwidth. You can confirm the backend with ollama ps. If you expected GPU acceleration but see CPU, revisit the driver sections above.
Step 4 â Performance Tuning
GPU Layer Count
The environment variable OLLAMA_NUM_GPU (or num_gpu in a Modelfile) controls how many model layers are offloaded to the GPU. Set it to 99 to offload everythingâthis is the fastest option if your GPU has enough memory. If youâre running out of VRAM, lower the number to keep some layers on the CPU. Experiment to find the sweet spot: full GPU offload gives the best tok/s, but partial offload lets you run larger models than your VRAM alone would allow.
Context Length
Ollama defaults to a 2048-token context window. You can increase it with num_ctx:
ollama run llama3.2:8b --num_ctx 4096Each doubling of context length roughly doubles the KV cache memory requirement. Going from 2048 to 8192 can add several gigabytes of RAM usage. The trade-off: longer context lets the model reference more of the conversation, but if RAM is tight, youâll see slower inference or out-of-memory errors. Start at 4096 and increase only if you need it.
Keep-Alive
By default, Ollama unloads a model after 5 minutes of inactivity. You can change this with OLLAMA_KEEP_ALIVE:
OLLAMA_KEEP_ALIVE=30mâ Keeps the model loaded for 30 minutes between requests. Good for intermittent use.OLLAMA_KEEP_ALIVE=-1â Keeps the model loaded forever (until you restart Ollama or manually unload it).OLLAMA_KEEP_ALIVE=0â Unloads immediately after each response.
Keeping a model loaded avoids a 5â15 second reload delay on the next request. If your mini PC is a dedicated AI server, -1 is usually the right choice.
Memory Management
The OLLAMA_MAX_LOADED_MODELS variable controls how many models can be loaded simultaneously. The default is 1. If you set it to 2 or higher, Ollama will keep multiple models in RAM so you can switch between them without reload delays. Just make sure you have enough RAM for all of themâtwo 8B models need roughly 12â14 GB together, while an 8B and a 14B need about 16â18 GB.
Step 5 â Set Up Open WebUI (ChatGPT-Like Interface)
Open WebUI gives you a browser-based chat interface that looks and feels like ChatGPT. Docker is required.
docker run -d -p 3000:8080
--add-host=host.docker.internal:host-gateway
-v open-webui:/app/backend/data
--name open-webui
ghcr.io/open-webui/open-webui:mainThe flags: -p 3000:8080 maps port 3000 on your host to the containerâs internal port 8080. --add-host=host.docker.internal:host-gateway lets the container reach Ollama running on the host machine. The -v open-webui:/app/backend/data volume persists your conversations, settings, and uploaded documents across container restarts.
Open http://your-mini-pc-ip:3000 in a browser. On first visit, create an admin account. Then go to Settings â Connections and enter the Ollama URL: http://host.docker.internal:11434. Hit the check button to verify the connection, then go back to the main chat, select a model from the dropdown, and send a test message.
Open WebUI packs a lot of features beyond basic chat. You can switch between any models youâve pulled in Ollama, browse full conversation history, set system prompts to create custom personas (e.g., âYou are a Python tutorâ), upload documents for retrieval-augmented generation (RAG), and manage multiple user accounts if other people in your household want access.
Step 6 â Expose Ollama on Your Network
Set OLLAMA_HOST
By default, Ollama only listens on localhost. To make it accessible from other devices on your network, set OLLAMA_HOST=0.0.0.0:
- Linux: Edit
/etc/systemd/system/ollama.serviceand addEnvironment="OLLAMA_HOST=0.0.0.0"under the[Service]section. Then reload and restart:sudo systemctl daemon-reload && sudo systemctl restart ollama. - macOS: Run
launchctl setenv OLLAMA_HOST 0.0.0.0, then restart the Ollama app. - Windows: Add
OLLAMA_HOSTas a system environment variable with a value0.0.0.0through System Properties â Environment Variables. Restart the Ollama service.
Reverse Proxy with nginx
Putting nginx in front of Ollama gives you HTTPS, request logging, and rate limiting. A minimal config proxies requests to Ollamaâs local port:
server {
listen 443 ssl;
server_name ai.local;
ssl_certificate /path/to/cert.pem;
ssl_certificate_key /path/to/key.pem;
location / {
proxy_pass http://127.0.0.1:11434;
}
}This is optional for a home network but recommended if you expose Ollama beyond your LAN.
Firewall
Open the required ports, so other devices can reach Ollama and Open WebUI:
- Linux (UFW):
sudo ufw allow 11434andsudo ufw allow 3000. - Windows: Add inbound rules in Windows Defender Firewall for TCP ports 11434 and 3000.
Step 7 â Run as a System Service (Auto-Start)
Linux (systemd)
The native install script already creates a systemd unit. Enable and start it with:
sudo systemctl enable --now ollamaCheck status with systemctl status ollama. Stream live logs with journalctl -u ollama -fâuseful for watching model loads, GPU detection, and API requests in real time.
macOS (launchd)
The Ollama desktop app auto-starts at login by defaultâopen System Settings â General â Login Items to verify. For a headless Mac mini (no GUI session), create a launchd plist in ~/Library/LaunchAgents/ that runs /usr/local/bin/ollama serve at boot, or simply add Ollama to Login Items in System Settings.
Windows (Task Scheduler)
Open Task Scheduler and create a new task: set the trigger to âAt log on,â set the action to start ollama serve, and check âRun whether user is logged on or notâ if you want it running as a background service. For more robust service behavior, use NSSM (Non-Sucking Service Manager)âit wraps any executable as a proper Windows service with automatic restart on failure.
Step 8 â Remote Access (Optional)
Tailscale
Tailscale creates a private WireGuard VPN mesh between your devices with zero firewall configuration. Install Tailscale on the mini PC and on any client device (phone, laptop, tablet). Each device gets a stable Tailscale IP in the 100.x.x.x range. Point your browser or API client at http://100.x.x.x:11434 to reach Ollama from anywhereâcoffee shop, office, or another city. Tailscale is free for personal use with up to 100 devices.
Cloudflare Tunnel
Cloudflare Tunnel (cloudflared) creates a secure outbound-only tunnel from your mini PC to Cloudflareâs edge, so you donât need to open any ports on your router. Install cloudflared, create a tunnel, and assign a subdomain (e.g., ai.yourdomain.com). Add Cloudflare Access on top for authenticationâthis puts a login page in front of your Ollama instance, so only authorized users can reach it. The free tier covers personal use.
Monitoring and Updating
Use ollama list to see all downloaded models with their name, size, and last-modified date. Use ollama ps to see which models are currently loaded in memory, how much RAM/VRAM theyâre consuming, and which backend (CUDA, Metal, CPU) theyâre running on. To free disk space, remove models you no longer need with ollama rm <model>.
Check for updates regularlyânew Ollama releases bring performance improvements, new model support, and bug fixes. On Linux, re-run the install script: curl -fsSL https://ollama.com/install.sh | sh. On macOS and Windows, download the latest installer from ollama.com. On Linux, check logs anytime with journalctl -u ollama.
Troubleshooting
GPU Not Detected
Check that your driver version meets Ollamaâs minimum requirements (NVIDIA 535+, ROCm 6.0+). If youâre using Docker, make sure you passed the --gpus all flag (NVIDIA) or --device=/dev/kfd --device=/dev/dri (AMD). For ROCm, verify the amdgpu kernel module is loaded with lsmod | grep amdgpu. If you installed or updated GPU drivers after installing Ollama, reinstall Ollama so it picks up the new drivers.
Out of Memory
Symptoms include a crash, ânot enough memoryâ error, or the system becoming unresponsive. First, check the modelâs actual size with ollama show <model> before pulling. If youâre already out of memory, try a smaller quantization (switch from Q4_K_M to Q3_K_S for roughly 20% less RAM), drop to a smaller model size (14B instead of 32B), or close other applications to free RAM. Reducing context length also helps.
Slow Inference
Verify that GPU offload is active by checking ollama psâif it shows CPU backend, youâre not getting GPU acceleration. Memory bandwidth matters: DDR4 is significantly slower than DDR5 or LPDDR5X for model inference. Reduce context length if youâve set it high. As a baseline test, try a small model like phi4:3.8b firstâif thatâs fast but larger models are slow, the bottleneck is memory capacity or bandwidth.
Canât Connect from Network
Run through this checklist: OLLAMA_HOST is set to 0.0.0.0 (not localhost); you restarted the Ollama service after changing it; your firewall allows TCP on port 11434; and the client is using the correct IP address of the mini PC (check with ip addr on Linux, ipconfig on Windows, or ifconfig on macOS).
FAQ
Can I run Ollama in a Proxmox VM or LXC?
Yes. For VMs, use PCI passthrough to give the VM direct GPU access. For LXC containers, run Ollama inside Docker within the container. Full steps including GPU passthrough configuration are in our Run AI models on Proxmox VE guide (linked in Step 1).
How many models can I load at once?
By default, Ollama loads one model at a time and unloads it before loading another. You can change this with OLLAMA_MAX_LOADED_MODELSâset it to 2 or 3 if you have the RAM. Each loaded model consumes memory independently, so two 8B models need roughly 12â14 GB together.
Is Ollama free?
Yes, fully open-source and free for personal and commercial use. There are no usage limits, no API keys, and no telemetry. You download models from Ollamaâs public library at no cost.
Can I use Ollama with VS Code or other IDEs?
Yes. Ollama exposes a local API at http://localhost:11434 that works with IDE extensions like Continue, Cody, and Copilot-compatible plugins. Point the extension at your Ollama endpoint and select a modelâcode completions and chat run entirely on your mini PC.
Does Ollama support RAG?
Not as a built-in feature. Ollama handles model inference only. For retrieval-augmented generation, use Open WebUI (which has document upload built in) or pair Ollama with a framework like LangChain or LlamaIndex that handles document chunking and embedding.
How do I switch between models?
From the command line, run ollama run <model-name> to start a different model. In Open WebUI, select a model from the dropdown at the top of the chat. Ollama automatically unloads the previous model unless youâve configured keep-alive or increased OLLAMA_MAX_LOADED_MODELS.
What port does Ollama use?
Port 11434 by default for the API. Open WebUI, if installed, typically runs on port 3000 (mapped from its internal 8080). Both are configurable.
Can I run Ollama alongside VMs?
Yes, just make sure you leave enough RAM for both. If youâre running Proxmox, consider running Ollama inside a dedicated LXC container rather than on the hostâthis keeps resource allocation cleaner and lets you set memory limits per container.
Conclusion
Thatâs the full path: install â first model â GPU check â tuning â Open WebUI â network and service. The whole process takes about 30 minutes, and once itâs running, your mini PC serves AI to every device on your network without sending a single prompt to the cloud. For additional mini PC picks oriented toward Ollama, Mayhemcodeâs 2026 Ollama mini PC roundup is worth a look. Donât have a mini PC yet? Start with our best mini PC for AI guide (linked in the intro).