Install Ollama on Linux
Linux is the native OS for Ollama: it runs best there, updates most cleanly, and gives you the most control. This guide covers Ubuntu/Debian/Fedora with systemd, NVIDIA and AMD GPU configuration, and how to expose the server on your LAN without breaking everything.
#Why Linux for local AI?
Three pragmatic reasons: GPU drivers (CUDA, ROCm) are more stable on Linux than on Windows, CLI tools integrate naturally, and homelabs run Linux by default. Add systemd to have Ollama start cleanly at boot.
#Prerequisites
Your private ChatGPT, free, on your own machine in an hour — LM Studio, Ollama, Open WebUI, your documents, no cloud.
- Lifetime online access
- PDF + files
- Lifetime updates
- Kernel 5.10+
- Any reasonable distribution in 2026. Use uname -r to check.
- curl ou wget
- To download the installation script.
- sudo / root
- The installation writes to /usr/local/bin and creates a systemd service.
- 10 GB of disk space
- Models live in /usr/share/ollama/.ollama/models by default.
#1. One-line installation
The script detects your distribution, installs the binary in /usr/local/bin/ollama, creates an ollama system user, deploys a systemd unit, and starts the service. 30 seconds.
#2. systemd service
The service is created at /etc/systemd/system/ollama.service. To customize it (e.g., change the model directory or expose it on the LAN):
Add the required environment variables in the [Service] section:
#3. GPU NVIDIA
Ollama automatically detects CUDA if the drivers are installed. Check:
#4. AMD GPU (ROCm)
Radeon RX 6000, 7000, and Instinct cards are supported through ROCm. Installation is touchier than CUDA, but it works.
#5. Expose it on the local network
By default, Ollama listens only on localhost:11434. To let another computer or a Raspberry Pi query it:
#Troubleshooting
- systemctl status ollama → failed
- Check journalctl -u ollama -n 50. Often: port 11434 is already in use, or there are permissions issues with the models directory.
- GPU not detected
- nvidia-smi and rocminfo must respond. If not: drivers. A reboot after installation is often required.
- Slow model, 100% CPU
- ollama ps ne montre pas GPU. Drivers ok, mais variable CUDA_VISIBLE_DEVICES mal réglée ? Vérifiez environnement du service.
- Not enough space
- Move OLLAMA_MODELS to a larger SSD. Don’t forget chown -R ollama:ollama on the new folder.
Feedback, an error, or a clarification? Let us know—it improves the guide for everyone.