/etc/systemd/system/目录下
sudo vi /etc/systemd/system/ollama.service
#添加环境变量:
“`
[Service]
Environment="OLLAMA_HOST=0.0.0.0:11434"
#如果已经有
Environment="PATH=xxx:/root/bin" "OLLAMA_HOST=0.0.0.0:11434"
“`
sudo systemctl daemon-reload
sudo systemctl restart ollama
powered by kaifamiao