how to succesfully download ollama on your linux device
To install Ollama, run the following command:
curl -fsSL https://ollama.com/install.sh | shNote
If you are upgrading from a prior version, you should remove the old libraries with sudo rm -rf /usr/lib/ollama first.
Download and extract the package:
curl -LO https://ollama.com/download/ollama-linux-amd64.tgz
sudo tar -C /usr -xzf ollama-linux-amd64.tgzStart Ollama:
ollama serveIn another terminal, verify that Ollama is running:
ollama -vIf you have an AMD GPU, also download and extract the additional ROCm package:
curl -L https://ollama.com/download/ollama-linux-amd64-rocm.tgz -o ollama-linux-amd64-rocm.tgz
sudo tar -C /usr -xzf ollama-linux-amd64-rocm.tgzDownload and extract the ARM64-specific package:
curl -L https://ollama.com/download/ollama-linux-arm64.tgz -o ollama-linux-arm64.tgz
sudo tar -C /usr -xzf ollama-linux-arm64.tgzCreate a user and group for Ollama:
sudo useradd -r -s /bin/false -U -m -d /usr/share/ollama ollama
sudo usermod -a -G ollama $(whoami)Create a service file in /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.targetThen start the service:
sudo systemctl daemon-reload
sudo systemctl enable ollamaDownload and install CUDA.
Verify that the drivers are installed by running the following command, which should print details about your GPU:
nvidia-smiDownload and Install ROCm v6.
Start Ollama and verify it is running:
sudo systemctl start ollama
sudo systemctl status ollamaNote
While AMD has contributed the amdgpu driver upstream to the official linux
kernel source, the version is older and may not support all ROCm features. We
recommend you install the latest driver from
AMD for best support
of your Radeon GPU.
To customize the installation of Ollama, you can edit the systemd service file or the environment variables by running:
sudo systemctl edit ollamaAlternatively, create an override file manually in /etc/systemd/system/ollama.service.d/override.conf:
[Service]
Environment="OLLAMA_DEBUG=1"Update Ollama by running the install script again:
curl -fsSL https://ollama.com/install.sh | shOr by re-downloading Ollama:
curl -L https://ollama.com/download/ollama-linux-amd64.tgz -o ollama-linux-amd64.tgz
sudo tar -C /usr -xzf ollama-linux-amd64.tgzUse OLLAMA_VERSION environment variable with the install script to install a specific version of Ollama, including pre-releases. You can find the version numbers in the releases page.
For example:
curl -fsSL https://ollama.com/install.sh | OLLAMA_VERSION=0.5.7 shTo view logs of Ollama running as a startup service, run:
journalctl -e -u ollamaRemove the ollama service:
sudo systemctl stop ollama
sudo systemctl disable ollama
sudo rm /etc/systemd/system/ollama.serviceRemove the ollama binary from your bin directory (either /usr/local/bin, /usr/bin, or /bin):
sudo rm $(which ollama)Remove the downloaded models and Ollama service user and group:
sudo rm -r /usr/share/ollama
sudo userdel ollama
sudo groupdel ollamaRemove installed libraries:
sudo rm -rf /usr/local/lib/ollamaUsing Wget for installation
wget -qO- https://ollama.com/install.sh | shBreakdown of the command:
wget -qO-
-q → Quiet mode (suppresses output)
-O- → Outputs the downloaded script to stdout (so it can be piped to sh)
https://ollama.com/install.sh → The installation script URL
| sh → Pipes the script to sh for execution
Alternative Manual Installation Steps (if you prefer not to pipe directly to sh):
Download the script first:
wget https://ollama.com/install.sh -O ollama-install.shReview it for safety (optional but recommended):
cat ollama-install.sh # or use a text editorMake it executable and run:
chmod +x ollama-install.sh
sudo ./ollama-install.shPost-Installation Steps:
Verify Ollama is running:
systemctl status ollama
Pull a model (e.g., Llama 3):ollama pull llama3Run a model:
ollama run llama3Notes:
If wget is not installed:
sudo apt update && sudo apt install wget -y