How to Run Local AI on Linux: Ollama, GPU Setup and systemd Service Management

Published October 21, 2026 · Last updated October 21, 2026

How to Run Local AI on Linux: Ollama, GPU Setup and systemd Service Management
Photo by Alejandro Escamilla (Unsplash)
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

Step 1: Install Ollama

curl -fsSL https://ollama.com/install.sh | sh

Screenshot: the install script finishing and starting the service

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

Screenshot: systemd status and ollama ps showing 100% GPU

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
}'

Screenshot: the API answering a curl request

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

Next steps