---
title: "Deploy Hermes Agent"
description: "Nous Research's self-improving AI agent with OpenAI API."
category: "AI/ML"
url: https://railway.com/deploy/hermes-agent-9
---

# Deploy Hermes Agent

Nous Research's self-improving AI agent with OpenAI API.

**[Deploy Hermes Agent on Railway](https://railway.com/template/hermes-agent-9)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/hermes-agent-9/manifest.json

- **Creator:** onepush
- **Category:** AI/ML

## Template content

### hermes-agent

- **Image:** nousresearch/hermes-agent:v0.22.0@sha256:c69536a39e885b8943329bda68cdf44492458b96aa74a212239bde9d2aeb406a
- **Start command:** `hermes gateway run`
- **Health check:** /health
- **Public domain:** Yes

## Documentation

# Deploy and Host self hosted Hermes Agent (Open-Source AI Agent) on Railway

Hermes Agent v0.22.0 runs on Railway as one pinned container using `nousresearch/hermes-agent:v0.22.0` (October 14, 2026) by sha256 digest. It mounts `/opt/data` for config, memory, skills, and sessions, needs no deploy-time config, and exposes an OpenAI-compatible API on your public domain.

## About Hosting Hermes Agent open-source software on Railway (self hosted Hermes Agent template)

The template deploys one service with start command `hermes gateway run`, port 8642, health check `/health`, and volume `/opt/data`. That's the Hermes home: config, memory, learned skills, and session search. It persists across deploys.

`RAILWAY_RUN_UID`, `HERMES_UID`, and `HERMES_GID` line up the runtime user with the volume owner so `/opt/data` stays writable, and `HERMES_ALLOW_ROOT_GATEWAY` lets the gateway start under Railway's container user. No Dockerfile edits. API server is on: `API_SERVER_ENABLED=true`, `API_SERVER_HOST=0.0.0.0`, `API_SERVER_PORT=8642`. A per-deploy `API_SERVER_KEY` is generated, and `API_SERVER_CORS_ORIGINS=*`.

## Why Deploy Hermes Agent, the ChatGPT agent alternative on Railway (Railway Free Trial)

ChatGPT agent runs inside OpenAI's app with OpenAI's models. Hermes runs in your own container, uses any provider, and keeps memory and skills on your volume. Cron jobs and Telegram replies keep working when your laptop is closed. Railway's $5 trial covers a first deploy.

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 Hermes Agent 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 Hermes Agent self hosting

| Provider | Setup effort | Persistent storage | Cost pattern | Notes for Hermes Agent |
|---|---|---|---|---|
| DigitalOcean | Medium: Droplet, Docker, reverse proxy | Block volume | VPS price plus storage | You manage updates, firewall, process supervision |
| AWS | High: VPC, ECS/EC2, IAM, LB, EBS | EBS volume | Per hour plus storage and transfer | Flexible, but heavy for one agent |
| Hetzner | Medium: VM, manual Docker | Local NVMe or block | Often lowest raw compute | Good if you already self-host there |

## Common Use Cases for hosted Hermes Agent

Use it as a personal assistant that remembers context. It keeps curated memory and searches past sessions with FTS5. Set `TELEGRAM_BOT_TOKEN` and `TELEGRAM_ALLOWED_USERS` for a Telegram bot.

Point Open WebUI or LibreChat at `https:///v1`, use the Bearer token from `API_SERVER_KEY`, model `hermes-agent`. Tools stay active, so chat can trigger file ops, web search, or skills.

Teams share one instance and volume. The cron scheduler runs recurring tasks. Subagents and MCP split work. The gateway also supports Discord, Slack, WhatsApp, and Signal from one process, each with its own credentials.

## Dependencies for Hermes Agent Docker hosted on Railway

No database service is needed. The image bundles gateway, tools, scheduler, and search. The only required external dependency is a model provider key or Nous Portal. Without it, the gateway and API start but cannot answer. `/opt/data` is the only storage requirement.

### Deployment Dependencies for Managed Hermes Agent Service (AI Agent)

One container with 512 MB-1 GB RAM and a little CPU is enough. Template sets `PORT=8642`, `API_SERVER_PORT=8642`, health `/health`. No Postgres, Redis, or object storage. Set `OPENROUTER_API_KEY`, `ANTHROPIC_API_KEY`, or `OPENAI_API_KEY`; they're empty by default.

### Implementation Details for Hermes Agent (Using Hermes Agent official docker image)

Uses `nousresearch/hermes-agent:v0.22.0` pinned by sha256. Start command `hermes gateway run`. API binds `0.0.0.0:8642`; `HERMES_API_URL` is public domain plus `/v1`. Model name is `hermes-agent`. Runs with `HERMES_ALLOW_ROOT_GATEWAY` and UID/GID vars so `/opt/data` is writable.

## How does Hermes Agent compare against other AI agent platforms

### Hermes Agent vs OpenClaw

- **Language:** Hermes Agent is Python; OpenClaw is Node.
- **Learning loop:** Hermes creates and improves skills; OpenClaw focuses on gateway routing and plugins.
- **Migration:** `hermes claw migrate` imports OpenClaw data.
- **License:** Both MIT.

### Hermes Agent vs Letta

- **Memory model:** Letta uses stateful memory blocks; Hermes uses curated memory plus session search.
- **Tools:** Hermes ships 40+ tools, cron, subagents, MCP; Letta emphasizes memory persistence.
- **Fit:** Letta is a server for developers embedding stateful agents; Hermes is a ready-to-use personal agent.
- **License:** Hermes MIT; Letta Apache 2.0.

### Hermes Agent vs OpenHands

- **Focus:** OpenHands is a coding agent platform; Hermes is general with messaging and API.
- **Tool use:** OpenHands centers code editing, terminal, browser; Hermes adds memory, skills, cron, multi-channel.
- **Interface:** OpenHands centers on its web UI; Hermes offers a TUI, a web dashboard, messaging apps, and the API.
- **License:** Both MIT.

### Hermes Agent vs ChatGPT agent

- **Control:** Hermes runs in your Railway container; ChatGPT agent is closed SaaS in paid plans.
- **Tools:** Hermes' terminal runs in your container, sandboxed from your laptop; ChatGPT uses OpenAI's managed tools.
- **Cost:** Hermes is free software, you pay model providers; ChatGPT agent is bundled with subscription.
- **Persistence:** Hermes keeps skills and memory in your volume.
- **API:** Hermes exposes an OpenAI-compatible API; ChatGPT agent is not self-hostable.

## How to use Hermes Agent (the OSS AI agent)?

Add a model provider key in Railway env: `OPENROUTER_API_KEY`, `ANTHROPIC_API_KEY`, or `OPENAI_API_KEY`. Use the terminal in the service or the API. Switch models with `hermes model`. API answers at `POST /v1/chat/completions` with model `hermes-agent`.

## How to self host Hermes Agent on other VPS Services (Hermes Agent self hosting guide)

You can run Hermes Agent on a plain VPS with Docker or the install script. Software is MIT, no license key. You need a model provider key and disk for `~/.hermes`.

### Clone the Repository

Clone source with `git clone https://github.com/NousResearch/hermes-agent.git` to inspect or run from source. The common path is `curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash`; it puts `hermes` on PATH and sets up directories.

### Install Dependencies

The script handles Python deps and platform tooling. Run `hermes setup`; it creates `~/.hermes/.env` and prompts for model keys. For Docker, use the same image and mount a volume at `/opt/data`.

### Configure Environment Variables

Edit `~/.hermes/.env`. Set `OPENROUTER_API_KEY`, `ANTHROPIC_API_KEY`, or `OPENAI_API_KEY`. For API: `API_SERVER_ENABLED=true`, `API_SERVER_HOST=0.0.0.0`, `API_SERVER_PORT=8642`, `API_SERVER_KEY` a long random string. For Telegram add `TELEGRAM_BOT_TOKEN` and `TELEGRAM_ALLOWED_USERS`.

### Start the Hermes Agent Application

Run `hermes gateway` for foreground. It listens on 8642 and serves `/v1`. For long-running, use systemd, pm2, or Docker restart policy. On Railway, `hermes gateway run` does the same. Check `/health`.

## Official Pricing of Hermes Agent (Hermes Agent pricing)

Hermes Agent is MIT and free. No per-seat or enterprise fee. You pay model providers directly for tokens. Nous Portal is optional paid, not required. On Railway, container plus model API. A 512 MB-1 GB RAM container typically costs about $5-$10/month plus model calls.

## Hermes Agent cloud vs self hosted comparison (Pricing, features, costs, and more)

Cloud hosted means Railway runs the container and volume. Self hosted on VPS means you manage OS, Docker/install, reverse proxy, backups. Both run same code and state. Railway gives public domain, health checks, volume management.

### Monthly cost of self hosting Hermes Agent on Railway

Expect about $5-$10/month for one Railway container with 512 MB-1 GB RAM. Volume adds a little; Hermes rarely needs more than a few GB. Model API costs are separate and depend on your provider. The $5 trial helps test.

### System Requirements for Hosting Hermes Agent on a VPS

A small VPS with 1 vCPU, 1 GB RAM, 10 GB disk is enough for personal use. Agent is lightweight; model provider does heavy work. Use 2 GB RAM for many subagents or busy cron. Store `/opt/data` on persistent storage, not ephemeral.

## Frequently Asked Questions (FAQs)

### Do I need a model provider key?

Yes. The gateway starts without one, but the agent can't answer until you set `OPENROUTER_API_KEY`, `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, or configure Nous Portal.

### Is the API server safe to expose publicly?

It can be, but keep `API_SERVER_KEY` secret. Anyone with that key can run terminal commands inside your Railway container. CORS is open by default, so treat the URL as private.

### What does the volume at /opt/data store?

It stores Hermes home data: config, curated memory, learned skills, session search index, and other state. Delete the volume and you lose learned experience.

### Can I connect Open WebUI to Hermes Agent?

Yes. Point Open WebUI at `https:///v1`, use `hermes-agent` as model name, and paste `API_SERVER_KEY` as Bearer token. Works for LobeChat and LibreChat too.

### How do I update Hermes Agent on Railway?

Change the image tag and digest to a newer release, then redeploy. Volume persists, so skills and memory stay. Check release notes before major versions.

### Does Hermes Agent work without Telegram?

Yes. Telegram is optional. Use the API, CLI, or other messaging platforms like Discord, Slack, WhatsApp, or Signal with their credentials.


## Similar templates

- [Chat Chat](https://railway.com/deploy/-WWW5r) — Chat Chat, your own unified chat and search to AI platform.
- [stella](https://railway.com/deploy/stella) — Self-host stella with web, API, Postgres, Redis, and object storage.
- [Hermes Agent | OpenClaw Alternative with Dashboard](https://railway.com/deploy/hermes-agent-or-openclaw-alternative-wit) — Self-Hosted Hermes AI Agent for Telegram, Discord & Slack

Open this page in a browser: https://railway.com/deploy/hermes-agent-9
