Ollama Server Management
Manage the Ollama background service across Linux, macOS, and Windows, and read its logs to debug crashes.
TL;DR
- Ollama runs as a background daemon on port
11434. - Restart the Linux service with
systemctl restart ollama. - Read
server.logto debug silent memory crashes and stalls.
The Background Daemon
ollama serveStart the API server in the foreground for manual runs.
ollama serve
# listens on 127.0.0.1:11434ollama psList models the running server currently holds in memory.
ollama psHealth CheckList available models to verify the API responds.
curl http://localhost:11434/api/tagsLinux (systemd)
Check StatusShow whether the service is active and any recent errors.
systemctl status ollamaRestartRestart the service to apply new settings or recover.
sudo systemctl restart ollamaView LogsFollow the service journal live to watch for errors.
journalctl -u ollama -fmacOS And Windows
Restart AppQuit from the menu bar or tray, then relaunch Ollama.
# Quit and reopen the Ollama appmacOS LogsRead the server log written to your home directory.
cat ~/.ollama/logs/server.logWindows LogsOpen the log folder under your local app data.
%LOCALAPPDATA%\Ollama\server.logDebugging
Enable DebugStart with verbose logging to trace load failures.
OLLAMA_DEBUG=1 ollama serveMemory ErrorsSearch the journal for out-of-memory crash lines.
journalctl -u ollama | grep -i memoryVerify EnvPrint the environment the running service actually sees.
cat /proc/$(pgrep ollama)/environ |
tr '\0' '\n' | grep OLLAMATips
- On Linux, run
systemctl status ollamabefore restarting, so you can read recent errors and confirm the service is actually running. - Set
OLLAMA_DEBUG=1and restart the server to log detailed GPU and model-loading information when something fails.
Warnings
- Variables in your shell profile are not read by the
systemdservice; set them withsystemctl edit ollama.serviceinstead. - The server holds port
11434open, so a secondollama servefails with an address-already-in-use error.
In Practice
Check why the service stopped responding, read the logs for the cause, then restart and confirm it is healthy again.
systemctl statusshows whether the service is active and any recent failure.journalctlreveals the actual error, such as an out-of-memory crash.restartclears the failed state and starts the server fresh.- A final health check confirms the API answers again.
# Check whether the service is still running
systemctl status ollama
# Read recent errors in the journal
journalctl -u ollama | grep -i memory
# Restart to recover
sudo systemctl restart ollama
# Confirm it is healthy again
curl http://localhost:11434/api/tagsFAQ
On Linux, run sudo systemctl restart ollama. On macOS and Windows, quit Ollama from the menu bar or system tray and reopen it, since it runs as a desktop app.
On macOS, read ~/.ollama/logs/server.log. On Linux with systemd, use journalctl -u ollama. On Windows, open the %LOCALAPPDATA%\Ollama folder to find the log files.
The most common cause is running out of RAM or VRAM for a model that is too large. Check the logs for memory errors, and try a smaller model or a lower quantization.
The Linux installer sets up a systemd unit named ollama. Manage it with systemctl start ollama, systemctl status ollama, and systemctl restart ollama like any other service.