How to install Ollama on Linux
A Linux system with sudo privileges, active internet connection, and at least 2 GB of free disk space.
What this does
This guide installs the Ollama runtime on a Linux host, enabling local AI model inference without cloud services. After completion, the ollama command is available system-wide and the service runs in the background.
Steps
Download the installation script and execute it. The official script handles repository setup, package installation, and service configuration in a single step.
curl -fsSL https://ollama.com/install.sh | shExpected output:
Installation complete. Ollama is running at http://127.0.0.1:11434Verify the service started automatically. Ollama launches a background service that listens on port 11434 after installation.
ollama listExpected output:
NAME ID SIZE MODIFIED(empty list is normal on first install)(Optional) Start the service manually if it did not start. On some distributions the service requires manual activation.
sudo systemctl enable --now ollamaExpected output: No error output; service is active.
- Record the local run evidence. Save the exact command, runtime or package version, model name if applicable, and observed output so the result can be reproduced later.
Verification
curl http://127.0.0.1:11434/api/version
# Expected: {"version":"0.4.x"}
Common failures
curl: (7) Failed to connect— Firewall or network issue. Check internet connectivity and ensure outbound TCP 443 is allowed.curl: (22) Not found— Incorrect URL or Ollama domain unreachable. Verify the install script URL is not blocked.sudo: systemctl: command not found— Init system mismatch. Userc-service ollama starton OpenRC or start the binary directly withollama serve.Permission denied writing to /usr/local/bin— Insufficient sudo privileges. Re-run withsudoor check root ownership of/usr/local/bin.- ollama: command not found after install — PATH not updated. Run
export PATH="/usr/local/bin:$PATH"or restart the shell.