Ollama on Linux: Install, Run It as a systemd Service, GPU Drivers, Updates and Uninstall
Note: Some future links on this site may be affiliate links. We never claim hands-on testing; guides are researched from the public sources listed in each article.
How we wrote this: A summary of Ollama's official Linux page and FAQ (linked below), checked October 29, 2026. Commands are copied from those docs; package names and paths can change between releases, so check the docs before running anything with
sudo.
Linux is the natural home for a small always-on AI box: an old desktop with a graphics card, a mini PC or a home server. Ollama's Linux docs cover both a quick install and a hand-built one. (On other systems, see Ollama on a Mac, Ollama on Windows or Ollama in Docker.)
The quick way: the install script
The docs give one command:
curl -fsSL https://ollama.com/install.sh | sh
Piping a script into a shell runs it with your permissions, so it's reasonable to open https://ollama.com/install.sh in a browser and read it first. Afterwards, try a model as in our Ollama beginner guide.
The manual way
If you'd rather see each step, the docs' manual install downloads a package and extracts it into /usr:
curl -fsSL https://ollama.com/download/ollama-linux-amd64.tar.zst \
| sudo tar x -C /usr
- Upgrading a manual install? Remove the old libraries first with
sudo rm -rf /usr/lib/ollama. - AMD GPU: also extract
ollama-linux-amd64-rocm.tar.zstthe same way. - ARM64: use
ollama-linux-arm64.tar.zstinstead.
Start the server with ollama serve, then in another terminal check it with ollama -v.
Run it as a startup service (recommended)
The docs recommend running Ollama under its own user with systemd. Create the user and group, and add yourself to the group:
sudo useradd -r -s /bin/false -U -m -d /usr/share/ollama ollama
sudo usermod -a -G ollama $(whoami)
Create /etc/systemd/system/ollama.service:
[Unit]
Description=Ollama Service
After=network-online.target
[Service]
ExecStart=/usr/bin/ollama serve
User=ollama
Group=ollama
Restart=always
RestartSec=3
Environment="PATH=$PATH"
[Install]
WantedBy=multi-user.target
Then enable and start it:
sudo systemctl daemon-reload
sudo systemctl enable ollama
sudo systemctl start ollama
sudo systemctl status ollama
GPU drivers (optional)
- NVIDIA: install CUDA from NVIDIA's download page, then run
nvidia-smi; it should print details about your GPU. - AMD: install ROCm v7. The docs note that the
amdgpudriver in the mainline Linux kernel is older and may not support all ROCm features, and recommend AMD's latest Linux driver for Radeon GPUs.
To see whether a model actually loaded onto the GPU, run ollama ps and read the Processor column (100% GPU, 100% CPU or a split). More in is Ollama using my GPU?.
Change settings: systemctl edit
When Ollama runs as a service, the FAQ says to set environment variables through systemd:
sudo systemctl edit ollama.service
Add lines under [Service], for example:
[Service]
Environment="OLLAMA_HOST=0.0.0.0:11434"
Save, then reload and restart:
sudo systemctl daemon-reload
sudo systemctl restart ollama
You can also write the same thing to /etc/systemd/system/ollama.service.d/override.conf. Settings people commonly change:
OLLAMA_HOST: Ollama binds 127.0.0.1 port 11434 by default, so only the machine itself can reach it. Setting0.0.0.0:11434makes it reachable from other devices on your network. Do that only on a network you trust.OLLAMA_MODELS: by default, models live in/usr/share/ollama/.ollama/models. To use another drive, point this at a new folder. With the standard installer, theollamauser needs read and write access to it (sudo chown -R ollama:ollama <directory>).OLLAMA_DEBUG=1: more detailed logs while troubleshooting.
Logs, updates and specific versions
- Logs:
journalctl -e -u ollama - Update: run the install script again, or re-download the package as in the manual install.
- Pin a version (including pre-releases) with
OLLAMA_VERSION, using a number from Ollama's GitHub releases page:
curl -fsSL https://ollama.com/install.sh | OLLAMA_VERSION=0.5.7 sh
The 0.5.7 is the docs' example, not a recommendation.
Uninstall
The docs' steps, in order:
sudo systemctl stop ollama
sudo systemctl disable ollama
sudo rm /etc/systemd/system/ollama.service
sudo rm -r $(which ollama | tr 'bin' 'lib')
sudo rm $(which ollama)
sudo userdel ollama
sudo groupdel ollama
sudo rm -r /usr/share/ollama
The last line deletes your downloaded models. Double-check the paths before pressing Enter.
Once it's running
Use it from scripts with the local API or the official Python and JavaScript libraries, or add a browser chat window with Open WebUI.