1.环境
本文以centos7.9安装ollama为例
2.下载ollama安装包
官网地址:https://ollama.com/download/linux
GitHub手动安装文档地址:https://github.com/ollama/ollama/blob/main/docs/linux.md
安装包下载地址:https://ollama.com/download/ollama-linux-amd64.tgz
3.上传到服务器并解压
这里我以上传到/opt/app/middles/ollama
目录为例
tar -xzf ollama-linux-amd64.tgz
4.创建ollama.service文件
vi /etc/systemd/system/ollama.service
[Unit]
Description=Ollama Service
After=network-online.target
[Service]
ExecStart=/opt/app/middles/ollama/bin/ollama serve
User=root
Group=root
Restart=always
RestartSec=3
Environment="PATH=$PATH"
Environment="OLLAMA_MODELS=/opt/app/middles/ollama/models"
Environment="OLLAMA_HOST=0.0.0.0:11434"
[Install]
WantedBy=default.target
标签:opt,Environment,ollama,app,离线,---,https,linux,Ollama
From: https://www.cnblogs.com/hujunwei/p/18659430