Ollama (Debian)
To set host IP for Ollama service
systemctl edit ollama.service
Add this line
[Service]
Environment="OLLAMA_HOST=<HOST_IP>"
Example
### Editing /etc/systemd/system/ollama.service.d/override.conf
### Anything between here and the comment below will become the new contents of the file
[Service]
Environment="OLLAMA_HOST=172.16.10.101"
### Lines below this comment will be discarded
### /etc/systemd/system/ollama.service
# [Unit]
# Description=Ollama Service
# After=network-online.target
#
# [Service]
# ExecStart=/usr/local/bin/ollama serve
# User=ollama
# Group=ollama
# Restart=always
# RestartSec=3
# Environment="PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
#
# [Install]
# WantedBy=default.target
After restart Ollama service
systemctl restart ollama
No Comments