Manual Ollama Installation: Difference between revisions
Jump to navigation
Jump to search
m (Format with MediaWiki syntax) |
(+Improved ollama.service file) |
||
| Line 20: | Line 20: | ||
tar --zstd -xf ollama-linux-amd64.tar.zst -C /opt | tar --zstd -xf ollama-linux-amd64.tar.zst -C /opt | ||
== Improved ollama.service file == | |||
[Unit] | |||
Description=Ollama Service | |||
After=network-online.target | |||
[Service] | |||
ExecStart=/media/data/opt/bin/ollama serve | |||
User=ollama | |||
Group=ollama | |||
Restart=always | |||
RestartSec=3 | |||
Environment="PATH=$PATH" | |||
Environment="OLLAMA_HOST=0.0.0.0" | |||
Environment="OLLAMA_CONTEXT_LENGTH=16384" | |||
[Install] | |||
WantedBy=multi-user.target | |||
Latest revision as of 20:29, 10 May 2026
Tested on Debian 13
Main reference: Linux - Ollama - Manual installation
Rationale
Since I don't want to pollute my system with software whose origin is not the operating system's package repository, I install Ollama to "/opt" rather than "/bin".
Download and Install
Its necessary to install some packages:
apt install zstd curl -y
Then let's download Ollama:
curl -fsSL https://ollama.com/download/ollama-linux-amd64.tar.zst
Unpack the archive:
tar --zstd -xf ollama-linux-amd64.tar.zst -C /opt
Improved ollama.service file
[Unit] Description=Ollama Service After=network-online.target [Service] ExecStart=/media/data/opt/bin/ollama serve User=ollama Group=ollama Restart=always RestartSec=3 Environment="PATH=$PATH" Environment="OLLAMA_HOST=0.0.0.0" Environment="OLLAMA_CONTEXT_LENGTH=16384" [Install] WantedBy=multi-user.target