How to Run Local AI on Linux: Ollama, GPU Setup and systemd Service Management
Published October 21, 2026 · Last updated October 21, 2026
Some links on this page are affiliate links. If you buy through them, we may earn a commission at no extra cost to you. This never influences our rankings or opinions.
Linux is the cleanest platform for local AI: Ollama installs as a proper systemd service, supports NVIDIA, AMD and Intel GPUs, and plays nicely with Docker. This guide covers the install, GPU drivers, service management and the usual failure points.
Requirements
- Any modern distro (Ubuntu 22.04+/Debian 12+/Fedora 39+/Arch).
- For NVIDIA: a driver supporting CUDA 12 or newer.
- For AMD: ROCm supported GPUs (the install script handles most recent Radeon cards).
- 8 GB RAM minimum; 16-32 GB recommended for 14B-class models.
Step 1: Install Ollama
curl -fsSL https://ollama.com/install.sh | sh

The script detects your distro, installs the binary, registers a systemd service
(ollama.service) and starts it. Verify:
systemctl status ollama
ollama --version
Step 2: GPU check
NVIDIA:
nvidia-smi
If that command fails, install the driver first — on Ubuntu:
sudo ubuntu-drivers install
# reboot afterwards
Ollama bundles its own CUDA libraries, so you do not need to install the full CUDA toolkit.
AMD (ROCm): on Ubuntu, the script picks up supported cards automatically. If Ollama logs
show CPU-only usage with an AMD card, install the ROCm runtime (amdgpu-install package)
and reboot.
Intel Arc: supported through IPEX-LLM builds; check Ollama’s docs for the current instructions if you’re on Intel.
Step 3: Pull and run your first model
ollama pull qwen3:14b
ollama run qwen3:14b
Check what’s loaded and where:
ollama ps

PROCESSOR should read 100% GPU on a working GPU setup. OLLAMA_DEBUG=1 ollama serve in a
foreground terminal is the quickest way to see why detection failed.
Step 4: Use the API (headless servers love this)
Ollama serves a REST API on 127.0.0.1:11434:
curl http://localhost:11434/api/generate -d '{
"model": "qwen3:14b",
"prompt": "Summarize the Unix philosophy in one sentence",
"stream": false
}'

For an OpenAI-compatible endpoint (many tools expect it), Ollama also exposes /v1:
curl http://localhost:11434/v1/chat/completions -H "Content-Type: application/json" -d '{
"model": "qwen3:14b",
"messages": [{"role": "user", "content": "hello"}]
}'
To expose it on your LAN, edit the service override:
sudo systemctl edit ollama
Add:
[Service]
Environment="OLLAMA_HOST=0.0.0.0:11434"
Then sudo systemctl restart ollama. Only do this on trusted networks — there’s no auth.
Step 5: Service management cheat sheet
sudo systemctl stop ollama # stop it
sudo systemctl disable ollama # don't start on boot
journalctl -u ollama -f # live logs
sudo systemctl edit ollama # persistent env overrides (models dir, etc.)
Useful environment overrides: OLLAMA_MODELS=/data/ollama to move models off your root
partition, OLLAMA_KEEP_ALIVE=30m to keep models loaded longer.
Troubleshooting
- Install script fails behind a proxy: export
https_proxybefore running it, or download theollama-linux-amd64.tgzfrom GitHub releases and untar manually. - GPU ignored: run
journalctl -u ollama | grep -i gpu. Missing driver permissions (you’re not in thevideo/rendergroups on some distros) is the usual culprit. - OOM kills on big models: watch
free -h; zram or swap plus a smaller quantization solves it. Q4_K_M is the sweet spot. - Docker conflicts: Open WebUI and other containers reach the host Ollama via
http://host.docker.internal:11434only if you pass--add-host=host.docker.internal:host-gateway(see our Docker guide).
Next steps
- Add a web UI via Docker self-hosting.
- Use the local endpoint as a model provider for OpenCode.
- Prefer raw GGUF control? See ComfyUI’s sibling projects like llama.cpp for Linux-native flexibility.