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:
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.targetReplace
qwen3-coder:30bwith whichever model you prefer.Run
ollama lsto see what available Ollama models you have.
sudo systemctl daemon-reloadsudo systemctl enable ollama-warmup.service
sudo systemctl start ollama-warmup.serviceNote
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.
sudo systemctl status ollama-warmup.service