Install Ollama on Ubuntu for OpenClaw: Verify the Local Runtime

Published
Reading Time5 min read

Key Takeaways

A verification-first Ubuntu guide for installing Ollama, checking the systemd service and local API, testing real inference, and recording the model details needed for OpenClaw.

Before connecting OpenClaw to a local model, verify Ollama as an independent service. This guide installs Ollama on Ubuntu, checks the systemd service and local API, pulls a model, runs a real inference test, and leaves you with evidence that the model runtime works before OpenClaw is added.

What this step proves

At the end of this guide you should be able to confirm all four layers independently:

  • the ollama CLI is installed
  • the Ollama service is running
  • the local API responds on 127.0.0.1:11434
  • a locally installed model can generate a response

That separation matters: if OpenClaw fails later, you can distinguish an Ollama/runtime problem from an OpenClaw configuration problem.

1. Check the Ubuntu host first

Confirm the operating system, free disk space, and available memory before downloading a model:

bash
cat /etc/os-release
free -h
df -h /

Model requirements vary significantly by model size and quantization. Do not assume that a model which downloads successfully will run comfortably on the host. Choose a model that fits your hardware and workload.

Updating package metadata is reasonable, but a full unattended distribution upgrade is not required just to install Ollama:

bash
sudo apt update

2. Install Ollama from the official installer

Ollama documents the following Linux installation command:

bash
curl -fsSL https://ollama.com/install.sh | sh

Then verify that the CLI is available:

bash
ollama --version
command -v ollama

For production or security-sensitive hosts, review third-party installation scripts before piping them to a shell and follow your normal change-control policy.

3. Verify the service instead of starting a second server

On a normal Linux installation, Ollama is commonly managed as a systemd service. Check that first:

bash
sudo systemctl status ollama --no-pager

If it is installed but stopped:

bash
sudo systemctl start ollama
sudo systemctl enable ollama

Use ollama serve primarily when you intentionally want to run the server in the foreground. Starting it while systemd already owns port 11434 can create unnecessary confusion.

If startup fails, inspect the service logs:

bash
journalctl -u ollama -n 100 --no-pager

4. Verify the local API

The default local Ollama endpoint used by OpenClaw is http://127.0.0.1:11434. Test model discovery directly:

bash
curl --fail --silent --show-error \
  http://127.0.0.1:11434/api/tags

A successful response proves that the HTTP service is reachable. It does not yet prove that a model can perform inference.

If the request fails, check the listener and service before changing OpenClaw:

bash
ss -ltnp | grep 11434 || true
sudo systemctl status ollama --no-pager
journalctl -u ollama -n 100 --no-pager

Keep a local-only deployment bound to loopback unless you deliberately need LAN access. Exposing a model endpoint changes the security boundary and should be protected accordingly.

5. Pull a model that fits the machine

Use an exact model name from Ollama's current model catalog. For example, after choosing a model appropriate for your hardware:

bash
ollama pull <model-name>
ollama list

Do not copy an old model recommendation simply because it appeared in a tutorial. Model availability and recommended choices change; the important artifact for the next step is the exact identifier returned by ollama list.

6. Run an inference smoke test

First test through the CLI:

bash
ollama run <model-name> "Reply with exactly: pong"

Then test the native API so you know the same service path that integrations depend on can generate output:

bash
curl --fail --silent --show-error \
  http://127.0.0.1:11434/api/generate \
  -H 'Content-Type: application/json' \
  -d '{"model":"<model-name>","prompt":"Reply with exactly: pong","stream":false}'

Replace <model-name> with the exact installed model ID. A valid JSON response containing generated text is stronger evidence than checking the port alone.

7. Record the values OpenClaw will need

Before moving to OpenClaw, record:

plain text
Ollama base URL: http://127.0.0.1:11434
Model ID:        <exact value from ollama list>

Current OpenClaw documentation supports Ollama directly. For a local Ollama host, OpenClaw can discover models from the loopback endpoint after Ollama is selected/configured, and its onboarding flow can verify the selected route with a real completion. Use the current OpenClaw Ollama documentation when you perform that integration rather than copying stale provider configuration from older tutorials.

Troubleshooting by failure layer

SymptomCheck firstLikely layer
ollama: command not foundcommand -v ollamaInstallation / PATH
Port 11434 refuses connectionssystemctl status ollama and journalctl -u ollamaService
/api/tags works but model is missingollama listModel installation
Model exists but inference fails or is extremely slowRAM/VRAM, logs, model sizeRuntime / hardware
Ollama tests pass but OpenClaw later failsOpenClaw provider/model configurationIntegration

Production checklist

Before treating this step as complete:

  • ollama --version succeeds
  • systemctl status ollama reports the expected service state
  • /api/tags returns successfully
  • ollama list contains the intended model
  • a CLI inference succeeds
  • a native API inference succeeds
  • you have recorded the exact base URL and model ID
  • you have not exposed port 11434 publicly by accident

FAQ

Do I need to run ollama serve manually on Ubuntu?

Not necessarily. If the Linux installer has configured Ollama as a systemd service and that service is running, starting another foreground server is unnecessary. Check systemctl status ollama first.

Is port 11434 alone enough to prove Ollama works?

No. A listening port only proves that something is accepting connections. Verify /api/tags, then perform an actual generation request.

Which model should I install for OpenClaw?

There is no universal choice. Use the current OpenClaw and Ollama model guidance and choose according to available RAM/VRAM, context requirements, tool-use needs, latency, and workload. OpenClaw notes that smaller or heavily quantized local models can be less reliable for agent workloads, so test the actual agent behavior rather than relying only on a simple chat prompt.

Should Ollama listen on the public internet?

Not for a default local setup. Keep it on loopback unless remote access is an intentional architecture decision with appropriate network and authentication controls.

Next steps

Sources

AV
Engineering Team ReviewedBenchmarked & Peer Reviewed

Alex Vance

Lead Proxy Network Architect

Reviewed by the BytesFlows engineering team. Examples are written for compliant public-web data collection, QA, SEO monitoring, and market research workflows. Results can vary by target site, country, client runtime, and request rate.