---
title: "Deploy Agenta IA"
description: "Agenta (open-source LLMOps) on Railway - 14-service OSS stack (1 click)"
category: "AI/ML"
url: https://railway.com/deploy/agenta-railway-template
---

# Deploy Agenta IA

Agenta (open-source LLMOps) on Railway - 14-service OSS stack (1 click)

**[Deploy Agenta IA on Railway](https://railway.com/template/agenta-railway-template)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/agenta-railway-template/manifest.json

- **Creator:** BURNI80
- **Category:** AI/ML
- **Total deploys:** 3

## Template content

### supertokens

- **Image:** supertokens/supertokens-postgresql:11

### web

- **Image:** ghcr.io/agenta-ai/agenta-web:v0.121.5
- **Start command:** `sh -lc '/app/entrypoint.sh node /app/oss/server.js'`

### seaweedfs https://cdn.jsdelivr.net/gh/selfhst/icons/png/seaweedfs.png

- **Source:** https://github.com/BURNI80/agenta-railway-template

### alembic

- **Image:** ghcr.io/agenta-ai/agenta-api:v0.121.5
- **Start command:** `sh -c 'until psql -w -tAc "SELECT 1" >/dev/null 2>&1; do sleep 2; done; exec /opt/venv/bin/python -m oss.databases.postgres.migrations.runner'`

### worker-streams

- **Image:** ghcr.io/agenta-ai/agenta-api:v0.121.5
- **Start command:** `python -m entrypoints.worker_streams`

### Postgres https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/postgres.png

- **Source:** https://github.com/BURNI80/agenta-railway-template

### runner

- **Image:** ghcr.io/agenta-ai/agenta-runner:v0.121.5
- **Start command:** `node_modules/.bin/tsx src/server.ts`

### services

- **Image:** ghcr.io/agenta-ai/agenta-services:v0.121.5
- **Start command:** `gunicorn entrypoints.main:app --bind 0.0.0.0:8080 --worker-class uvicorn.workers.UvicornWorker --workers 2 --max-requests 10000 --max-requests-jitter 1000 --timeout 60 --graceful-timeout 60 --log-level info --access-logfile - --error-logfile -`
- **Health check:** /health

### api https://dashboardicons.com/pb/api/files/community_gallery/qe3469ebu0q3r2t/images_wucwchyll9.png

- **Source:** https://github.com/BURNI80/agenta-railway-template
- **Health check:** /health

### web-mobile

- **Image:** ghcr.io/agenta-ai/agenta-web-mobile:v0.121.5
- **Start command:** `sh -lc '/app/entrypoint.sh node /app/mobile/server.js'`

### gateway https://dashboardicons.com/pb/api/files/community_gallery/qe3469ebu0q3r2t/images_wucwchyll9.png

- **Source:** https://github.com/BURNI80/agenta-railway-template
- **Health check:** /healthz
- **Public domain:** Yes

### redis https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/redis.png

- **Source:** https://github.com/BURNI80/agenta-railway-template

### worker-queues

- **Image:** ghcr.io/agenta-ai/agenta-api:v0.121.5
- **Start command:** `python -m entrypoints.worker_queues`

### cron

- **Image:** ghcr.io/agenta-ai/agenta-api:v0.121.5
- **Start command:** `/usr/local/bin/supercronic /app/crontab`

## Documentation

# Deploy and Host Agenta on Railway

Agenta is an open-source LLMOps platform for building, evaluating and shipping LLM applications.
This template deploys the complete Agenta OSS stack — 14 services behind a single HTTPS domain —
pinned to Agenta **v0.121.5**.

## About Hosting Agenta

Hosting Agenta on Railway gives you the full open-source platform as a managed multi-service stack:
a Next.js studio, a FastAPI core with evaluations and tracing, a workflow/agent runtime, background
workers, PostgreSQL, Redis, an S3-compatible object store and SuperTokens auth.

Only the nginx gateway is exposed publicly. Every other service is reached over Railway's private
network, so your database, cache and object store are never internet-facing.

Deploying from this template means the topology, start commands, healthchecks, pinned image
versions and generated secrets are already correct — you get a working instance instead of a build
list.

## Common Use Cases

- **Prompt and version management** — iterate on prompts in the studio and track every change.
- **Evaluation and tracing** — run datasets and evaluators, then inspect traces, scores and latency.
- **Agent and workflow execution** — the runner plus the services plane execute agent and workflow
  graphs.
- **A self-hosted, vendor-neutral alternative** to a proprietary LLM platform.
- **Internal AI tooling** for teams that need prompts, datasets and eval data to stay in their own
  infrastructure.

## Dependencies for Agenta Hosting

- A Railway project — this template creates 14 services in it.
- `openssl` and `coreutils` inside the wrapper images (already present in the base images).
- A supported LLM provider key, added after deploy from the studio UI.

### Deployment Dependencies

- Agenta release images `ghcr.io/agenta-ai/agenta-{api,web,web-mobile,services,runner}:v0.121.5`
- `supertokens/supertokens-postgresql:11`
- Wrapper images from this repo: `gateway/` (nginx edge), `api/` (durable object-store signing key
  plus ordered startup), `postgres/` (`postgres:17` with an initdb that creates the three Agenta
  databases), `redis/` (`redis:8` with a volume-safe `/data`) and `seaweedfs/`
  (`chrislusf/seaweedfs:4.47` with STS/IAM config rendered from env)
- Dockerfiles and configuration:
  [github.com/BURNI80/agenta-railway-template](https://github.com/BURNI80/agenta-railway-template)

## Why Deploy Agenta on Railway?

Railway hosts the whole stack so you don't assemble it by hand. The 14 services, their private
networking, the generated secrets, the healthchecks and the reverse proxy come pre-wired, and a
single public domain serves the studio, the API and the services plane.

And it stays portable: every service is either a pinned public image or a small wrapper Dockerfile
in this repo, so you can move the stack to another host later instead of being locked in.

## What's included

| Service | Source | Public | Health | Purpose |
|---------|--------|--------|--------|---------|
| **gateway** | `gateway/Dockerfile` | ✅ HTTPS | `/healthz` | Single nginx entrypoint: routes `/`, `/m`, `/api/`, `/services/` |
| **web** | `agenta-web:v0.121.5` | — | — | Next.js desktop studio |
| **web-mobile** | `agenta-web-mobile:v0.121.5` | — | — | Mobile studio, served at `/m` |
| **api** | `api/Dockerfile` | — | `/health` | FastAPI core + JWKS for the object store |
| **services** | `agenta-services:v0.121.5` | — | `/health` | Workflow and agent invocation runtime |
| **runner** | `agenta-runner:v0.121.5` | — | — | Agent execution harness |
| **worker-streams** | `agenta-api:v0.121.5` | — | — | Tracing / events / records consumers |
| **worker-queues** | `agenta-api:v0.121.5` | — | — | Webhooks, triggers, interactions, evaluations |
| **cron** | `agenta-api:v0.121.5` | — | — | Scheduled jobs (supercronic) |
| **alembic** | `agenta-api:v0.121.5` | — | — | One-shot database bootstrap and migrations |
| **supertokens** | `supertokens-postgresql:11` | — | — | Auth core (sessions, API keys) |
| **Postgres** | `postgres/Dockerfile` | — | — | `agenta_oss_core`, `agenta_oss_tracing`, `agenta_oss_supertokens` |
| **redis** | `redis/Dockerfile` | — | — | Cache / queues / streams, volume-backed |
| **seaweedfs** | `seaweedfs/Dockerfile` | — | — | Durable object store with STS/OIDC IAM |

Every secret is generated by Railway at deploy time and never stored in the repository:
`AGENTA_AUTH_KEY`, `AGENTA_CRYPT_KEY`, `AGENTA_SERVICES_INTERNAL_KEY`, `AGENTA_RUNNER_TOKEN`,
`POSTGRES_PASSWORD`, and SeaweedFS's `AGENTA_STORE_ACCESS_KEY` / `AGENTA_STORE_SECRET_KEY` /
`AGENTA_STORE_SIGNING_KEY`.

## Deploy

1. Click **Deploy on Railway**.
2. Railway provisions the 14 services and generates every secret.
3. **Attach the four volumes** (see below) — Railway's service filesystem is ephemeral.
4. First deploy takes **~8–15 min**: five small wrapper images are built and the Agenta images are
   pulled cold. `alembic` creates and migrates the three databases; `supertokens`, the API and the
   workers wait for it (or retry until it finishes).
5. Open the gateway URL and **create the first account** — it becomes the instance admin.

### Volumes

Anything that must survive a redeploy needs a volume. Create these four right after the first
deploy, before storing real data:

| Service | Mount path | Why |
|---------|-----------|-----|
| `Postgres` | `/var/lib/postgresql/data` | All Agenta data (core, tracing, supertokens schemas) |
| `redis` | `/data` | Cache, queues and streams (AOF) |
| `seaweedfs` | `/data` | Durable object store (assets, prompt artifacts) |
| `api` | `/var/lib/agenta` | Durable RSA key for object-store mount URLs; without it the key is regenerated on every redeploy and previously signed URLs break |

Dashboard: open the service → **Volumes → Add Volume**. Or from the CLI:

```bash
railway volume --service Postgres   add --mount-path /var/lib/postgresql/data
railway volume --service redis      add --mount-path /data
railway volume --service seaweedfs  add --mount-path /data
railway volume --service api        add --mount-path /var/lib/agenta
```

Attaching a volume redeploys that service, so the stack bounces once; Postgres runs `initdb` on the
fresh volume and `alembic` re-applies the migrations.

## Cost

A 14-service stack with four stateful services does **not** fit in Railway's `$5`/month Hobby
credit. Rough order of magnitude while idle:

| Component | Rough monthly |
|-----------|---------------|
| 8 always-on app services (api, services, runner, 2× web, 2× worker, cron) @ ~0.3–0.6 GB | ~$15–30 |
| Postgres + Redis + SeaweedFS + gateway + supertokens | ~$8–15 |
| Volumes | ~$1–2 |
| **Total** | **~$25–45 / month** |

Railway bills per second of actual usage, so cost tracks traffic. To trim it, put `web`,
`web-mobile`, `worker-*` and `runner` on **sleep mode** (Serverless), drop `web-mobile` and `runner`
if unused, or lower the workers' resource limits.

## Post-deploy

1. **Create the first user** at the gateway URL (it becomes admin).
2. **Add a model provider key**: *Settings → Models / Providers*. A self-hosted or
   OpenAI-compatible endpoint works too.
3. *(Optional)* `COMPOSIO_API_KEY` on `api` and `services` enables Composio tools and triggers.
4. *(Optional)* `DAYTONA_API_KEY` on `runner` moves sandboxes to Daytona; the default is `local`.
5. *(Optional)* `SMTP_*` or `SENDGRID_API_KEY` on `web` enables signup emails.

## Troubleshooting

**Gateway returns 502/504 right after deploy.** An upstream is still starting; the workers and
`supertokens` also restart a few times until Postgres and Redis are ready. Wait for the `api` and
`services` healthchecks to go green — the gateway re-resolves Railway private DNS every 5 s.

**`redis` crash-loops with `MISCONF ... unable to persist`.** The `/data` volume is root-owned. The
Redis wrapper chowns it on boot; keep `RAILWAY_RUN_UID=0` and `RAILWAY_RUN_GID=0` on `redis`.

**Agent file writes are lost or mount signing returns 503.** Check that
`AGENTA_STORE_JWT_ISSUER` on `seaweedfs` is `http://api.railway.internal:8000/api` and that `api`
is healthy (it serves `/api/.well-known/jwks.json`).

**Start over.** Delete the `Postgres`, `redis`, `seaweedfs` and `api` volumes, then redeploy.

---

Full documentation — repository layout, architecture rationale, upgrade path and template
maintenance — lives in
[BURNI80/agenta-railway-template](https://github.com/BURNI80/agenta-railway-template).

Live demo: [gateway-production-0822.up.railway.app](https://gateway-production-0822.up.railway.app)

Agenta is built and licensed by Agentatech UG (MIT outside `ee/`). This template ships no Agenta
source code — only deployment packaging and documentation. Not affiliated with or endorsed by
Agenta or Railway.


## 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/agenta-railway-template
