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:11434Default PortA quick request to the root path confirms it is up.
curl http://localhost:11434
# Ollama is runningollama 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 ollamaEdit ServiceOpen an override file to add environment variables.
sudo systemctl edit ollama.serviceView 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 Env VarSet a variable for the app, then restart Ollama.
launchctl setenv OLLAMA_HOST 0.0.0.0:11434macOS 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 servePort In UseFind what already holds port 11434 before restarting.
lsof -i :11434Memory 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
Configure the Linux service to listen on all interfaces, restart it, then confirm the API is reachable.
systemctl editcreates an override so your changes survive package updates.- The
OLLAMA_HOSTline binds the server to every network interface. daemon-reloadandrestartare both needed for systemd to apply the change.- A final health check confirms the server answers on the new address.
# Open the service override file
sudo systemctl edit ollama.service
# Add under [Service]:
# Environment="OLLAMA_HOST=0.0.0.0:11434"
# Reload and restart to apply
sudo systemctl daemon-reload
sudo systemctl restart ollama
# Confirm it is listening and healthy
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.