Skip to content

Instantly share code, notes, and snippets.

@bebyx
Created July 26, 2024 12:41
Show Gist options
  • Save bebyx/8cecd83a2d7c94a8f7c6352298db7c9e to your computer and use it in GitHub Desktop.
Save bebyx/8cecd83a2d7c94a8f7c6352298db7c9e to your computer and use it in GitHub Desktop.
#!/bin/bash
curl -L https://ollama.com/download/ollama-linux-amd64 -o $HOME/.local/bin/ollama
chmod +x $HOME/.local/bin/ollama
cat <<EOF > ~/.config/systemd/user/ollama.service
[Unit]
Description=Ollama Service
After=network-online.target
[Service]
ExecStart=$HOME/.local/bin/ollama serve
Restart=always
RestartSec=3
[Install]
WantedBy=default.target
EOF
systemctl --user daemon-reload
systemctl --user restart ollama
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment