Railway

Deploy Hermes Agent on NixOS | (Just Updated) Self-Improving Agent, Memory Persists

Self-improving agent on nix. Memory and skills survive redeploys. 1 GB min.

Deploy Hermes Agent on NixOS | (Just Updated) Self-Improving Agent, Memory Persists

/home/hermes

Deploy and Host Hermes Agent on Railway

Hermes Agent is a self-hosted, self-improving AI agent: it keeps memory and identity across sessions, builds and refines its own skills from experience, and is reachable from Telegram, Discord, Slack, WhatsApp, Signal, email or a web dashboard. It does real work with real tools — terminal, files, browser, MCP servers — rather than only answering questions.

This template runs it on nix, which is the difference that matters. The agent has all of nixpkgs available at runtime: nix run nixpkgs#ffmpeg, nix profile add nixpkgs#pandoc, no image rebuild and no redeploy. A self-improving agent that can also acquire new tools mid-task improves along an axis it otherwise cannot.

About Hosting Hermes Agent

Hermes is built to run continuously — it holds channel connections, remembers across sessions, and accumulates skills. That needs persistent storage, and it needs the right storage: upstream puts everything under HERMES_HOME, which defaults to /opt/data. A volume mounted on the home directory would not cover that path, so config, keys, sessions, skills and memory would silently reset on every redeploy while appearing to be persisted. This template relocates HERMES_HOME under the home directory so a single volume genuinely holds the agent's identity.

Memory floor: 1 GB. Measured: the Free plan's 0.5 GB is OOM-killed unpacking the nixpkgs channel. The dashboard idles near 113 MB here, so 1 GB leaves comfortable headroom. Browser-driving tools are not bundled in this image; upstream suggests 2–4 GB if you add them.

Why Deploy Hermes Agent

  • All of nixpkgs at runtime, so the agent's toolbox is not fixed at build time.
  • One volume holds the whole agent — memory, skills, identity, credentials — because HERMES_HOME was moved to make that true.
  • Auth is registered before first boot. The template generates a dashboard password, hashes it with the project's own scrypt helper, and writes the provider config.
  • Binds Railway's injected port and ships a healthcheck path that actually answers.
  • Pinned versions, base image by digest and Hermes by release.

Common Use Cases

  • A personal agent that gets better at your recurring work instead of starting fresh each time.
  • An always-on assistant reachable from the chat apps you already use.
  • A workspace for agent tasks needing arbitrary CLI tooling on demand.

Security — your decision, made with the facts

Hermes runs a terminal tool and can drive files and MCP servers. Anyone who can use the dashboard can make it act.

What upstream and this template already enforce:

  • A public bind cannot be unauthenticated. With no auth provider registered, Hermes refuses to start on a non-loopback bind: "Refusing to bind dashboard to 0.0.0.0 — the auth gate engages on non-loopback binds, but no auth providers are registered." --insecure is a documented no-op since the June 2026 hardening. It cannot fail open.
  • Verified on this image, 2026-08-15. Unauthenticated requests to /api/sessions, /api/config and /api/agent return 401; / redirects to a sign-in page. /api/status returns 200 without credentials by design — it is the healthcheck surface and exposes status only.
  • Shell commands run behind a Dangerous Command Approval gate unless you set HERMES_YOLO_MODE=1.

What is yours to decide:

  • The password is already out of the log. Railway generates a unique secret per deploy and injects it as a service variable, so nothing is printed. Read it in the service's Variables tab. To rotate: change the variable, delete the password_hash line from $HERMES_HOME/config.yaml, and restart.
  • Do not enable the API server casually. API_SERVER_ENABLED exposes an OpenAI-compatible endpoint on a second port that hands callers the agent's full toolset. It is off here. If you turn it on, set API_SERVER_KEY in the same change.
  • Leave the approval gate alone. HERMES_YOLO_MODE=1 removes the confirmation step on dangerous shell commands. Convenient, and it is the guard that stops one bad instruction from being final.
  • Consider dropping the public domain. Chat channels work without inbound HTTP; if you only use Telegram or Discord, the dashboard does not need to be on the public internet at all.
  • The volume is the blast radius. Persistence is the point, and it also means anything left behind survives a redeploy.
  • The LLM key is spendable. Scope it accordingly.

Dependencies for Hermes Agent

Deployment Dependencies

  • An LLM provider key — Nous Portal, Anthropic, OpenAI, OpenRouter, or any OpenAI-compatible endpoint.
  • A persistent volume mounted at /home/hermes.
  • 1 GB RAM minimum (Trial or Hobby).

Implementation Details

nixos/nix base, digest-pinned; Hermes installed with uv tool install against the nix interpreter. The entrypoint generates and hashes a dashboard password if none is configured, writes the basic-auth provider into config.yaml, and starts the dashboard on Railway's injected PORT.


Template Content

More templates in this category

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

okisdev
113
View Template
stella
Self-host stella with web, API, Postgres, Redis, and object storage.

Jan Kubica
2
View Template
Hermes Agent | OpenClaw Alternative with Dashboard
Self-Hosted Hermes AI Agent for Telegram, Discord & Slack

codestorm
57