Railway

Deploy OpenClaw with Ollama

Launch OpenClaw in minutes with open models powered by Ollama.

Deploy OpenClaw with Ollama

Just deployed

/root/.ollama

/data

Deploy and Host OpenClaw with Ollama on Railway

OpenClaw is an open-source personal AI assistant and agent gateway that connects chat apps, automation workflows, and AI models in one self-hosted environment. This template deploys OpenClaw with a separate Ollama service, so you can run open models on Railway and get started in minutes.

Imgur

About Hosting OpenClaw with Ollama

Hosting OpenClaw with Ollama gives you a self-hosted AI automation workspace powered by open models. OpenClaw runs as the main gateway for setup, admin access, device pairing, workflows, and agent execution. Ollama runs as a separate Railway service in the same project and provides the local model runtime over Railway's private network.

This two-service setup keeps OpenClaw and Ollama separated, easier to manage, and easier to debug. OpenClaw handles the app and automation layer, while Ollama handles model inference. After deployment, you can open the setup wizard, connect to Ollama, choose or download a supported model, and start running AI-powered tasks.

Getting Started with OpenClaw on Railway

After the Railway deployment is live, open your OpenClaw service URL. On first launch, OpenClaw will redirect you to the setup wizard:

/setup

Use this setup wizard to configure your AI provider, connect Ollama, select a model, and prepare OpenClaw for use.

Step 1: Initial Setup via /setup

The /setup page is a one-time configuration wizard. Use it to:

  • Select your AI provider
  • Choose Ollama for open models powered by the bundled Ollama service
  • Confirm the Ollama connection
  • Select or download an available model
  • Configure optional messaging channels
  • Launch the OpenClaw gateway

For this template, Ollama is already deployed as a second Railway service. OpenClaw connects to it through Railway's private network using OLLAMA_BASE_URL.

Once setup is completed, /setup is no longer available unless the existing configuration is removed from the admin dashboard. This is intentional because /setup is only meant for first-time configuration.

Step 2: Access the Admin Dashboard at /admin

After setup, open the admin dashboard:

/admin

Log in using the value from:

WRAPPER_ADMIN_PASSWORD

The admin dashboard is your control panel for OpenClaw. It can be used to manage:

  • Gateway status, uptime, restart, and stop actions
  • Live logs from the OpenClaw gateway
  • Browser-based terminal access inside the container
  • Device pairing requests
  • Configuration files and hot-reload settings

Step 3: Connect to the OpenClaw UI

From the admin dashboard, open the OpenClaw UI. On the gateway connection screen:

  1. Paste your OPENCLAW_GATEWAY_TOKEN
  2. Click Connect
  3. Go back to the admin dashboard
  4. Open the pairing section
  5. Approve the incoming device pairing request
  6. Return to the OpenClaw UI and connect again

After pairing is approved, OpenClaw is ready to run tasks using your configured Ollama model.

Step 4: Use Ollama Models

This template includes Ollama as a separate service in the same Railway project. Ollama runs on the private network and provides model inference for OpenClaw.

How it works:

OpenClaw → Railway private network → Ollama → selected model

If the model list is empty during setup, wait a few minutes for Ollama to finish starting or pulling models, then refresh the setup page. Larger models may take longer to download and start.

Common Use Cases

  • Run a self-hosted personal AI assistant for research, writing, coding, and automation
  • Connect OpenClaw to open models powered by Ollama without external API costs
  • Build a private automation gateway for recurring tasks, monitoring, summaries, and workflows
  • Experiment with local-style AI agents using a Railway-hosted Ollama service

Dependencies for OpenClaw with Ollama Hosting

  • A Railway account for deploying and hosting the OpenClaw and Ollama services
  • An Ollama service running in the same Railway project
  • Railway private networking to connect OpenClaw to Ollama internally
  • Railway volume storage attached to the Ollama service for downloaded models
  • Enough CPU, memory, and storage for the Ollama models you plan to use

Deployment Dependencies

Implementation Details

This template deploys two services:

OpenClaw
Ollama

OpenClaw connects to Ollama through Railway's private network using the internal Ollama service URL:

OLLAMA_BASE_URL=http://${{Ollama.RAILWAY_PRIVATE_DOMAIN}}:11434

The OpenClaw service uses the following environment variables:

PORT=8080
OLLAMA_BASE_URL=http://${{Ollama.RAILWAY_PRIVATE_DOMAIN}}:11434
RAILWAY_RUN_UID=0
OPENCLAW_VERSION=2026.5.20
OPENCLAW_GATEWAY_TOKEN=${{secret(32)}}
WRAPPER_ADMIN_PASSWORD=${{secret(32)}}

The Ollama service should expose port 11434 internally. Attach a Railway volume to the Ollama service so downloaded models can persist across redeploys.

Typical Ollama model storage path:

/root/.ollama

After deployment, open the OpenClaw service URL. You will be redirected to the setup wizard. Select Ollama as the provider, confirm the Ollama connection, choose or download a compatible model, then launch OpenClaw.

For the admin dashboard, open:

/admin

Use the configured admin password to access status, logs, terminal, pairing requests, and configuration tools.

Notes on Ollama Models

OpenClaw relies heavily on tool and function calling. Not every Ollama model supports these capabilities equally well. For the best experience, choose models that are suitable for agentic workflows and tool use.

Railway currently runs local Ollama models on CPU. Smaller models are recommended for faster startup and response times. Start with lightweight models before moving to larger models.

Suggested starting points:

1B–3B models: lower memory usage and faster startup
7B models: stronger capability, but higher RAM usage
13B+ models: heavier and may require more resources

Why Deploy OpenClaw with Ollama on Railway?

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 with Ollama on Railway, you are one step closer to supporting a complete self-hosted AI automation stack with minimal burden. Host your servers, databases, AI agents, model runtimes, and more on Railway.


Template Content

More templates in this category

View Template
Rocky Linux
Hosted Rocky Linux 9 workspace with SSH and persistent storage. 🚀

codestorm
View Template
Foundry Virtual Tabletop
A Self-Hosted & Modern Roleplaying Platform

Lucas
View Template
Letta Code Remote
Run a Letta Code agent 24/7. No inbound ports, just deploy.

Letta