Deploy OpenClaw Ollama

Point OpenClaw at Ollama models on your private network

Deploy OpenClaw Ollama

/data

Deploy and Host self hosted OpenClaw Ollama (Self-Hosted AI Assistant on Open Models) on Railway

This template runs the OpenClaw gateway on Railway. Ollama isn't included: add it to the same project, point OpenClaw at its private URL, and keep chats on open models. CPU-only by default, so small models are slow.

About Hosting OpenClaw Ollama open-source software on Railway (self hosted OpenClaw with Ollama template)

Your conversations and model weights stay on your own Railway project: OpenClaw stores state in the /data volume, and Ollama serves inference over the private network.

This template runs just the OpenClaw gateway on port 18789 with a /healthz check and a generated gateway token. Railway handles TLS, the public domain, and volume mounts.

Why Deploy OpenClaw Ollama, the Open WebUI alternative on Railway (Railway Free Trial)

Open WebUI gives you a chat UI over Ollama; OpenClaw gives you an agent that actually calls tools and can point at the same private Ollama service. You pay for the container, not per token, and the $5 Railway trial is enough to test a small CPU model before you commit.

Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying OpenClaw Ollama on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.

Railway vs Other Hosting Providers and VPS for OpenClaw Ollama self hosting

Running a gateway next to Ollama is the part you'd rather not wire by hand.

ProviderWhat You Get with RailwayWhat You Get with the Other Provider
DigitalOceanOpenClaw plus Ollama on one private networkA droplet where you install and wire both by hand
AWSOllama in the same project, over private networkingEC2, VPC setup, and bills you babysit
HetznerNo GPUs here, so small models or Ollama CloudCheap CPU and GPU boxes, but you patch them

Common Use Cases for hosted OpenClaw Ollama

  • Keep chats off hosted model APIs: run a local Ollama service beside the gateway and your prompts, tool results, and channel history stay on Railway's private network instead of a vendor's model endpoint.

  • One private model for the whole project: add the ollama/ollama image, give it a volume at /root/.ollama, set OLLAMA_HOST=[::]:11434 so it listens on Railway's IPv6 private network, then point the ollama provider at http://ollama.railway.internal:11434.

  • Ollama Cloud without owning hardware: use the ollama-cloud provider with a real OLLAMA_API_KEY when a larger model beats slow CPU inference, and keep the same OpenClaw sessions and tools.

  • A cheap fallback behind a paid primary: keep a small local model listed as a secondary so routine or offline work still answers when the paid provider fails or hits a limit.

  • Test open models for tool calling: try a model with a large context window against real multi-step tool use before committing your assistant to it.

Dependencies for OpenClaw Ollama Docker hosted on Railway

The template ships OpenClaw only, so Ollama is a dependency you add yourself: a second service in the same Railway project, on the private network, with a volume for model weights.

Deployment Dependencies for Managed OpenClaw Ollama Service (Private LLM Assistant)

Run the ollama/ollama image on port 11434 with a volume at /root/.ollama, and set OLLAMA_HOST=[::]:11434 so it listens on IPv6, which is what Railway private networking uses. OpenClaw reaches it at http://ollama.railway.internal:11434.

Implementation Details for OpenClaw Ollama (Using OpenClaw official docker image)

The OpenClaw side is the pinned openclaw/openclaw:2026.10.3-browser image (multi-arch, Chromium bundled, MIT). Health is /healthz, and state lives in /data/.openclaw.

How does OpenClaw Ollama compare against other ways to run a personal assistant on open models

OpenClaw vs Open WebUI

  • Scope: Open WebUI is a chat UI for Ollama; OpenClaw is an agent gateway with tools and channels.
  • Ollama wiring: both use the native API, but OpenClaw's baseUrl must omit /v1 for tool calls.
  • Where Open WebUI wins: polished multi-user chat and document RAG need less setup.
  • Costs: both are free software; you pay for compute and any hosted model calls.

OpenClaw vs Hermes Agent

  • Overlap: both are self-hosted agents with memory and messaging gateways.
  • Ollama path: OpenClaw documents a native ollama provider with explicit models for remote hosts.
  • Where Hermes wins: more memory-first defaults; OpenClaw makes you choose tools and context.
  • Railway fit: both run as one container with a volume; OpenClaw's browser image needs more RAM.

OpenClaw vs LibreChat

  • Focus: LibreChat is multi-provider chat; OpenClaw is a control plane behind Slack or Telegram.
  • Ollama: LibreChat tolerates OpenAI-compatible URLs; OpenClaw wants native so tools stay intact.
  • Where LibreChat wins: quicker for plain chat with no agent loop to tune.
  • Costs: both are free, so the bill is compute plus any hosted model calls.

OpenClaw vs AnythingLLM

  • Shape: AnythingLLM is desktop and server RAG chat; OpenClaw is headless behind a gateway.
  • Ollama: AnythingLLM's document work is the draw; OpenClaw's value is tool execution.
  • Where AnythingLLM wins: chatting with private PDFs on Ollama takes less setup.

How to use OpenClaw Ollama (the OSS personal AI assistant)?

  1. Add an ollama/ollama service: port 11434, volume at /root/.ollama, env OLLAMA_HOST=[::]:11434.
  2. Run ollama pull qwen3:8b in its shell, and pick a model that actually supports tools.
  3. Open the OpenClaw domain, paste OPENCLAW_GATEWAY_TOKEN, approve the browser device.
  4. Point the ollama provider at the native API (no /v1) with the model listed explicitly:
{"models":{"providers":{"ollama":{"baseUrl":"http://ollama.railway.internal:11434","apiKey":"ollama-local","api":"ollama","models":[{"id":"qwen3:8b","contextWindow":65536}]}}},"agents":{"defaults":{"model":{"primary":"ollama/qwen3:8b"}}}}
  1. Restart, send a test message, and confirm tool calls come back as clean calls, not raw JSON text.

How to self host OpenClaw Ollama on other VPS Services (OpenClaw self hosting guide)

Same shape on any Ubuntu box with 8 GB RAM and no GPU.

Clone the Repository

git clone https://github.com/openclaw/openclaw.git

Install Dependencies

Install Node 24.16 or newer, the openclaw CLI, Ollama and a tool-calling model. Small models flub multi-step tool calls, so pick carefully.

npm install -g openclaw@latest
curl -fsSL https://ollama.com/install.sh | sh
ollama pull qwen2.5:7b

Configure Environment Variables

Point the ollama provider at the local host, not the /v1 URL.

export OPENCLAW_STATE_DIR=/opt/openclaw/data
export OLLAMA_HOST=127.0.0.1:11434

Start the OpenClaw Ollama Application

Run onboarding, then the gateway, and set the default model.

openclaw onboard --install-daemon
openclaw gateway --bind lan --port 18789

Set agents.defaults.model.primary to ollama/qwen2.5:7b. Railway handles TLS, the public domain, the volume, and the private network to Ollama, so you skip all of this.

Official Pricing of OpenClaw Ollama (OpenClaw pricing)

OpenClaw is MIT licensed and free to self host; Ollama is free too. You pay for infrastructure, not software. Ollama Cloud bills separately through ollama.com if you go that route. Model weights you pull yourself cost nothing beyond storage.

OpenClaw Ollama cloud vs self hosted comparison (Pricing, features, costs, and more)

Ollama Cloud (provider id ollama-cloud) trades control for zero ops: prompts go to ollama.com with OLLAMA_API_KEY and you host no weights. Self hosting keeps them inside your own Railway project, where you own the CPU time and the model volume.

Monthly cost of self hosting OpenClaw Ollama on Railway

Budget about $10-25/mo for the OpenClaw service, since the browser variant with Chromium wants 1-2 GB of RAM, plus the Ollama service's memory and volume. The $5 trial covers early experiments. A private Ollama adds no license cost at all.

System Requirements for Hosting OpenClaw Ollama on a VPS

Give the stack 2 GB of RAM or more, Docker, a /data volume, and one at /root/.ollama for weights. An 8B model in 4-bit needs a few GB of disk, and shared-vCPU inference is slow enough that a 64k context feels it. A GPU host handles bigger tool-calling models.

Frequently Asked Questions (FAQs)

Why not use Ollama's /v1 URL?

Because the /v1 endpoint breaks tool calling. Tool calls get dropped, or the model prints raw tool JSON as plain text. Use baseUrl http://ollama.railway.internal:11434 with no suffix.

Which Ollama models work with tools?

Pick models with a tool-calling template and check the model card first. Small 3B to 8B models handle one call but stumble on multi-step work. Aim for 64k context or more when the model allows it.

How slow is CPU inference on Railway?

Railway has no GPUs, so expect seconds per turn on a 7B and real pain on bigger models. Prompt processing on a long context dominates, so short chats stay usable and long agent loops crawl.

Can I use Ollama Cloud instead of a local service?

Yes. Use the ollama-cloud provider with a real OLLAMA_API_KEY and drop the local service, or keep both modes so local takes cheap traffic and cloud takes the hard agent work.

Does OpenClaw need a real API key for Ollama?

No. Local Ollama ignores the key, so any placeholder such as ollama-local works. OpenClaw only reads a real OLLAMA_API_KEY when the provider points at ollama.com.


Template Content

More templates in this category

View Template
Chat Chat
Chat Chat, your own unified chat and search to AI platform.

okisdev
117
View Template
NEW
Weaviate
Vector database with hybrid search and an API key-protected API

zer0person
1
View Template
NEW
Möbius v0.1 Personal AI OS
Self-hosted AI agent that builds and runs apps for you, with memory.

bento
1