Deploy Hermes Agent to Railway as a worker service with persistent state under /data.
- Click Deploy on Railway.
- Configure an inference provider and at least one messaging platform in Railway Variables.
- Add your user ID to the platform allowlist.
- Deploy, then send your bot a message.
The template starts hermes gateway, stores Hermes state in /data/.hermes, and uses /data/workspace as the default terminal working directory.
The default setup uses OpenRouter and Telegram:
OPENROUTER_API_KEY=""
TELEGRAM_BOT_TOKEN=""
TELEGRAM_ALLOWED_USERS=""Allowlist values are comma-separated IDs without brackets or quoted arrays:
TELEGRAM_ALLOWED_USERS=123456789,987654321You can use other inference providers and messaging platforms supported by Hermes. See the official Hermes repository for the current configuration options and environment variables; this template does not duplicate the upstream reference.
Template-specific variables:
HERMES_IMAGE_VERSION— Docker image tag from the fixednousresearch/hermes-agentrepository. Defaults tolatest. Valid examples includelatest,main, and published release tags such asv2026.8.31. A branch or commit SHA works only if upstream published a Docker image with that exact tag.HERMES_GIT_REF— deprecated source-build compatibility option. Any non-empty value takes precedence overHERMES_IMAGE_VERSIONand may be a Git tag, branch, or commit SHA.AGENT_CACHE_MEMORY_HIGH_MB— optional positive integer mapped toagent.agent_cache.memory_high_mbbefore startup.
For reproducible deployments, use a published release tag rather than mutable latest or main:
HERMES_IMAGE_VERSION=v2026.8.31Existing deployments with HERMES_GIT_REF continue to build Hermes directly from that Git ref. To switch to the official image, remove or empty HERMES_GIT_REF, set HERMES_IMAGE_VERSION, and redeploy.
Legacy source builds fetch GitHub during uncached Railway builds and may fail with 429 Too Many Requests when GitHub rate-limits build traffic. Retrying immediately may hit the same limit. Prefer the official-image path to avoid cloning Hermes during the build.
Do not run hermes update inside the deployed container. Container changes do not survive a Railway redeploy and can leave persisted configuration ahead of the image version.
Instead:
- Change
HERMES_IMAGE_VERSIONin Railway Variables. - Redeploy.
- If required by the release, run
hermes config migratethrough Railway SSH.
Use Railway SSH to inspect Hermes or run commands manually:
hermes status
hermes config
hermes model
hermes pairing list- Bot does not respond: verify the platform token, allowlist, and gateway logs.
401 Missing Authentication header: verify the selected inference provider and its API key.- State disappears after redeploy: verify the Railway volume is mounted at
/data. - Legacy build fails with GitHub 429: remove
HERMES_GIT_REFand useHERMES_IMAGE_VERSION.
Railway configuration lives in .railway/railway.ts. After linking this repository to the intended Railway project and environment:
npm install
npm run railway:plan
npm run railway:applyReview the plan before applying it.
# Official image
docker build \
--build-arg HERMES_IMAGE_VERSION=v2026.8.31 \
-t hermes-railway-template .
# Deprecated source build
docker build \
--build-arg HERMES_GIT_REF=v2026.8.31 \
-t hermes-railway-template:legacy .