HOW-TO · SET

How to install Ollama on Linux

beginner10 minBy Eruo Fredoline
Target environment
Ubuntu 24.04 · Ollama 0.4.xWindows 11 · Ollama 0.4.xmacOS 15 · Ollama 0.4.x
PREREQUISITES

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

  1. 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 | sh
    

    Expected output: Installation complete. Ollama is running at http://127.0.0.1:11434

  2. Verify the service started automatically. Ollama launches a background service that listens on port 11434 after installation.

    ollama list
    

    Expected output: NAME ID SIZE MODIFIED (empty list is normal on first install)

  3. (Optional) Start the service manually if it did not start. On some distributions the service requires manual activation.

    sudo systemctl enable --now ollama
    

    Expected 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. Use rc-service ollama start on OpenRC or start the binary directly with ollama serve.
  • Permission denied writing to /usr/local/bin — Insufficient sudo privileges. Re-run with sudo or 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.

Related guides

RELATED GUIDES