The Ollama version can be checked through the CLI and through the local API. Comparing both surfaces helps confirm that a shell command and a running server belong to the same install.
Use the CLI check after installs and updates, and the API check when debugging application connectivity. A stale background server can answer API requests even after a different CLI binary is installed earlier on PATH.
Record exact versions in task evidence when behavior depends on a recent feature, but keep article steps focused on the check itself.
Related: How to update Ollama on Linux
Related: How to check the Ollama API server
Related: How to check Ollama server status
$ ollama --version
ollama version is 0.31.1
$ command -v ollama /opt/homebrew/bin/ollama
$ curl -s http://localhost:11434/api/version {"version":"0.31.1"}
$ sudo systemctl restart ollama
Related: How to manage the Ollama service
$ curl -s http://localhost:11434/api/version {"version":"0.31.1"}