Skip to content

Instantly share code, notes, and snippets.

@cardboardcode
Created August 8, 2026 04:50
Show Gist options
  • Select an option

  • Save cardboardcode/fa5a73ea510874233aba8000864ebadc to your computer and use it in GitHub Desktop.

Select an option

Save cardboardcode/fa5a73ea510874233aba8000864ebadc to your computer and use it in GitHub Desktop.
For People In A Hurry: How to auto-load an Ollama model upon Linux device boot-up

Note

This is a quick copy-paste-observe guide that shows you how to automatically load an Ollama model whenever you boot up your Ubuntu operating system.

This saves a lot of time especially after offloading memory storage of the ollama models previously downloaded via the following guide:

Link: https://gist.github.com/cardboardcode/5282e7e794b6d7757d4c8c983167f5db?permalink_comment_id=6050648#gistcomment-6050648

Instructions 📘

sudo nano /etc/systemd/system/ollama-warmup.service
[Unit]
Description=Warm up Ollama qwen3-coder:30b
After=ollama.service
Requires=ollama.service

[Service]
Type=oneshot
ExecStart=/usr/bin/curl -s http://127.0.0.1:11434/api/generate \
    -H "Content-Type: application/json" \
    -d '{"model":"qwen3-coder:30b","prompt":"Hello","keep_alive":-1}'
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target

Replace qwen3-coder:30b with whichever model you prefer.

Run ollama ls to see what available Ollama models you have.

sudo systemctl daemon-reload
sudo systemctl enable ollama-warmup.service
sudo systemctl start ollama-warmup.service

Note

The above systemctl start command might take a while and may seem like it is hanging since it is loading an Ollama model from a external storage.

Verify

sudo systemctl status ollama-warmup.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment