Deploy Ollama Chat Tone | (Just Updated) Web Chat UI With Ollama Included, Login On From Boot

Ollama Chat Tone web chat UI for Ollama LLMs, login on, model preloaded

Deploy Ollama Chat Tone | (Just Updated) Web Chat UI With Ollama Included, Login On From Boot

Just deployed

/data

Just deployed

/root/.ollama

Deploy and Host Ollama Chat Tone on Railway

Built for an LLM agent to deploy and use. The deploy form has no fields. Ollama, the chat UI, the admin login and a preloaded model all come up together, and the contract below lists every address, variable name and one script that logs in and sends a chat message through the stack.

Ollama Chat Tone is a small Go web chat client for Ollama. It has a local login with admin approval for new accounts, per-user conversation history in SQLite, streaming replies, a model picker and an installable progressive web app.

About Hosting Ollama Chat Tone

This template runs two services. ollama is Ollama itself in a wrapper image, pinned by digest: it listens on IPv4 and IPv6, sizes its thread pool to the container's CPU quota (CPU inference is slow without that), and pulls llama3.2:1b in the background on first boot. ollama-chat-tone is the author's published image, pinned by digest, started with local login switched on: a single admin account admin whose secret is BASIC_AUTH_PASSWORD, generated for you at deploy time, and a generated SESSION_SECRET. Both services have a volume (/root/.ollama for model weights, /data for the chat database), so models, accounts and conversations survive redeploys. The Ollama API is only reachable on the project's private network; only the chat UI has a public domain. The first reply is slow until the model finishes downloading; GET /api/models lists it once it is ready.

Agent contract

  • Public URL: CHAT_PUBLIC_URL (https:// plus the chat service's RAILWAY_PUBLIC_DOMAIN). It serves the UI at / and the JSON API at /api/models and /api/chat.
  • Private URL: http://ollama-chat-tone.railway.internal:8080 (also CHAT_PRIVATE_URL). Ollama itself is at http://ollama.railway.internal:11434, private only.
  • Credentials: BASIC_AUTH_PASSWORD (generated, 32 characters; the username is admin) and SESSION_SECRET (generated, signs session cookies).
  • Auth: POST /auth/login with form fields username and password sets a session cookie; every other route except GET /healthz and the static assets needs that cookie. Unauthenticated requests are redirected (302) to /auth/login.
  • Health: GET /healthz returns 204 without credentials.
# needs: CHAT_PUBLIC_URL and BASIC_AUTH_PASSWORD from the ollama-chat-tone service variables
J=$(mktemp)
curl -s -o /dev/null -w "health: %{http_code}\n" "$CHAT_PUBLIC_URL/healthz"
curl -s -o /dev/null -w "no login: %{http_code}\n" "$CHAT_PUBLIC_URL/api/models"
curl -s -o /dev/null -w "login: %{http_code}\n" -c "$J" -d "username=admin" --data-urlencode "password=$BASIC_AUTH_PASSWORD" "$CHAT_PUBLIC_URL/auth/login"
until curl -s -b "$J" "$CHAT_PUBLIC_URL/api/models" | grep -q 'llama3.2:1b'; do sleep 10; done
curl -s -b "$J" -H "Content-Type: application/json" "$CHAT_PUBLIC_URL/api/chat" \
  -d '{"model":"llama3.2:1b","stream":false,"messages":[{"role":"user","content":"Reply with the single word pong."}]}'

A fresh deploy prints health: 204, then no login: 302, then login: 302, waits while the model downloads (a few minutes on first boot), and then prints the Ollama chat response as JSON with the reply under message.content. Send "stream":true to get newline-delimited chunks instead of one object. Any other model Ollama can pull works once pulled into the ollama service.

Why Deploy Ollama Chat Tone 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 Ollama Chat Tone 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.

  • Agent-ready - no deployer fields, a contract block and one working login-and-chat script.
  • Ollama included - the model server is in the same template, wired over the private network, with a model preloaded.
  • Login on from boot - a generated admin login, signed sessions and admin approval for any signup, so the chat is not an open door to your compute.
  • Persistent - volumes on the model store and the chat database, and both images pinned by digest.

Common Use Cases

  • Private chat UI for a self-hosted LLM - give a team one address, per-user history and a model picker in front of Ollama.
  • Agent-readable Ollama gateway - an orchestrating agent logs in once and calls POST /api/chat without ever touching the Ollama port.
  • Small model sandbox - pull another model into the ollama service and compare replies from the same web UI.

Dependencies for Ollama Chat Tone Hosting

  • None. Models are pulled from the Ollama library by the ollama service.

Deployment Dependencies

Implementation Details

VariablePurpose
BASIC_AUTH_PASSWORDGenerated secret of the admin account.
SESSION_SECRETGenerated key that signs session cookies.
OLLAMA_URLPrivate address of the ollama service, set for you.
CHAT_PUBLIC_URLHTTPS address of the chat UI and API.
CHAT_PRIVATE_URLAddress other services in the project use.

The chat service runs /app/server through /bin/sh -c, which sets BASIC_AUTH_USER=admin, DEFAULT_MODEL=llama3.2:1b, DB_PATH=/data/app.db and OPEN_BROWSER=false before starting. New signups need an email-shaped username and stay pending until the admin approves them on the admin page.


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
Weaviate
Vector database with hybrid search and an API key-protected API

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

bento
1