---
title: "Deploy AgentRun"
description: "Open-source managed-agents server: self-improving agents and workflows"
category: "AI/ML"
url: https://railway.com/deploy/deploy-agentrun-server
---

# Deploy AgentRun

Open-source managed-agents server: self-improving agents and workflows

**[Deploy AgentRun on Railway](https://railway.com/template/deploy-agentrun-server)**

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

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

## Template content

### agentrun https://api.iconify.design/mdi/robot-outline.svg

- **Image:** ghcr.io/onepush-dev/agentrun:0.1.0-beta.35
- **Health check:** /v2/health
- **Public domain:** Yes

## Documentation

# Deploy and Host self hosted AgentRun (AI/ML) on Railway

This template deploys AgentRun, an open-source managed-agents server with a web console, on one Railway service with a persistent volume.

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

Running AgentRun on Railway keeps your agents, runs and saved secrets on a server you control, in one service with a volume at /data. This is independent community packaging of Parcha-ai/agentrun and is not affiliated with or endorsed by the upstream authors.

Railway handles the container, HTTPS domain, volume, health check and restarts.

## Why Deploy AgentRun, the self-hosted managed-agents server on Railway

A hosted agent platform bills per run and keeps your agents and run history on its servers.

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 AgentRun 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 AgentRun self hosting

Self-hosting AgentRun means choosing where its container and /data volume run.

| Provider | What You Get with Railway | What You Get with the Other Provider |
| --- | --- | --- |
| DigitalOcean | A one-click deploy with generated secrets, a public domain, a /data volume and a health check. | A Droplet you size yourself, with root access and your own Docker, TLS and updates. |

Keep AGENTRUN_SEAL_KEY safe and run a single replica, since the SQLite store lives on one volume.

## Common Use Cases for hosted AgentRun

- **A web console for agents that learn:** Run one console where your agents keep what they learn from each run in their own git folder, so the next run starts from notes and skills that already worked.
- **Durable runs that resume after restarts:** Start long jobs and let them survive a redeploy or a crash, since every run and step lives in one store and picks up where it left off.
- **MCP servers and triggers:** Connect MCP servers for tools, and start capped runs from schedules, signed webhooks or GitHub pull request events without someone watching the console.
- **Claude Code, Codex and pi harnesses:** Pick the harness each agent runs best on, and bring your own model key so you control which provider answers and what it costs.

## Dependencies for AgentRun Docker hosted on Railway

This template runs AgentRun as one service with a persistent volume.

### Deployment Dependencies for Managed AgentRun Service (one container with SQLite)

- **Service:** one AgentRun app on port 8080.
- **Volume:** /data, holding the SQLite store, runs and learning data.
- **Health check:** /v2/health.
- **Memory:** at least 2 GB of RAM.
- **Replicas:** keep one, since the SQLite store lives on a single volume.

### Implementation Details for AgentRun (unmodified AgentRun Server v0.1.0-beta.35 image plus a Railway start script)

The image ghcr.io/onepush-dev/agentrun:0.1.0-beta.35 is the unmodified upstream ghcr.io/parcha-ai/agentrun-server:v0.1.0-beta.35 image plus railway/start.sh.

Variables, all generated or referenced:

- **AGENTRUN_TOKEN** (48 characters): paste it at /setup to set the owner password.
- **AGENTRUN_SEAL_KEY** (32-byte base64): seals saved secrets. Keep it, since the store will not start under another key.
- **AGENTRUN_PUBLIC_URL** (the Railway HTTPS domain): keeps setup code-guarded and links correct.

Model keys such as OPENROUTER_API_KEY, ANTHROPIC_API_KEY or OPENAI_API_KEY are optional.

## How does AgentRun compare against other tools

### AgentRun vs a hosted agent platform (Hosted Agent Platform Alternative)

- **Control of Data:** AgentRun runs on your own Railway service with a volume at /data, so runs and the SQLite store stay where you operate them. A hosted platform keeps that state on its side, which is simpler if you want nothing to run.
- **Model Keys:** You bring your own key. The server starts without one, and agents cannot run until you add OPENROUTER_API_KEY, ANTHROPIC_API_KEY or OPENAI_API_KEY, or save a key in the console.
- **Sandboxes:** Railway has no Docker socket, so AgentRun runs here have no Docker sandbox and no shell. Some hosted platforms offer sandboxed computers this template does not.

### AgentRun vs running agents only in a CLI (Local CLI Agent Alternative)

- **Shared Server:** A CLI runs on one machine for one person. AgentRun adds a web console and an HTTP API, so a team or a script can reach the same agents.
- **Persistence:** CLI sessions usually end with the terminal. AgentRun keeps runs and steps in its store, and a run carries on after a restart.
- **Setup Cost:** A local CLI needs only a tool and a key. AgentRun needs a deployed service with at least 2 GB of RAM and a volume, which is more to manage for one developer.

### AgentRun with Railway vs Docker Compose (Docker Compose Alternative)

- **Setup:** Compose runs from a checkout on a machine you control, with a volume you manage. Railway builds the image and wires the variables, domain and health check from the template.
- **Runners:** Compose can add runners on a shared volume. This Railway template runs one service with SQLite, so keep one replica.
- **Sandboxes:** Compose can mount the Docker socket for a Docker sandbox on a Linux host. Railway has no Docker socket, so agents there get file tools without a shell.

### AgentRun on Railway vs Self-Managed Hosts (Self-Managed Server Alternative)

- **Ownership:** A self-managed host means generating AGENTRUN_SEAL_KEY and managing TLS yourself. The Railway template generates AGENTRUN_TOKEN, AGENTRUN_SEAL_KEY and AGENTRUN_PUBLIC_URL for you, and you should still keep the seal key, since a store sealed under one key will not start under another.
- **Scale:** A VPS you size yourself can run more memory and more runners. Railway gives you one service at the RAM you assign, which suits a single-replica deployment.

## How to use AgentRun on Railway?

1. Copy `AGENTRUN_TOKEN` from the agentrun service's Variables tab.
2. Open your public Railway URL at `/setup`, paste the token as the setup code, and choose a password of 12 or more characters. Setup without the token is refused with a 403, and a second setup is refused once an owner exists.
3. Add a model key in the console or as a service variable such as `OPENROUTER_API_KEY`. The server starts without one, but agents cannot run until a key is added.
4. Keep one replica, since the SQLite store lives on a single volume, and keep `AGENTRUN_SEAL_KEY` safe.
5. There are no Docker sandboxes on Railway. Give the service at least 2 GB of RAM, because Claude Code and Codex install onto the volume on first use.
6. Check health at `https://your-domain/v2/health`:

```
https://your-domain/v2/health
```

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

### Clone the Repository

Clone the upstream source and check out the pinned release to read its README and deploy notes.

```sh
git clone https://github.com/Parcha-ai/agentrun your-domain-checkout
cd your-domain-checkout
git checkout v0.1.0-beta.35
```

### Install Dependencies

The published server image contains everything it needs, so pull it instead of building from source.

```sh
docker pull ghcr.io/parcha-ai/agentrun-server:v0.1.0-beta.35
```

### Configure Environment Variables

Generate a token and a seal key, and keep AGENTRUN_SEAL_KEY, because the store refuses to start under a different key.

```sh
export AGENTRUN_TOKEN="$(openssl rand -hex 24)"
export AGENTRUN_SEAL_KEY="$(openssl rand -base64 32)"
export AGENTRUN_PUBLIC_URL="https://your-domain"
export OPENROUTER_API_KEY="your-model-key"
```

### Start the AgentRun Application

Run the image with a persistent volume at /data.

```sh
docker run -d --name agentrun -p 8080:8080 \
  -v agentrun-data:/data \
  -e AGENTRUN_TOKEN -e AGENTRUN_SEAL_KEY -e AGENTRUN_PUBLIC_URL \
  -e OPENROUTER_API_KEY \
  ghcr.io/parcha-ai/agentrun-server:v0.1.0-beta.35 \
  --data /data --listen 0.0.0.0 --port 8080 --drain-timeout 6s
```

See the upstream README and deploy/README.md for details.

## Pricing and License of AgentRun (AgentRun pricing)

AgentRun is open-source software released under the Apache-2.0 license, so the software itself costs nothing to self-host.

## AgentRun hosted vs self hosted comparison (Pricing, features, costs, and more)

AgentRun is free Apache-2.0 software, and the pinned release describes no hosted plan.

### Monthly cost of self hosting AgentRun on Railway

Railway is usage-based, so the monthly cost depends on RAM, CPU, volume size and other services you run.

### System Requirements for Hosting AgentRun on a VPS

Give the server at least 2 GB of RAM, since Claude Code and Codex install onto the data volume on first use.

## Frequently Asked Questions (FAQs)

### How do I sign in to AgentRun on Railway?

Copy AGENTRUN_TOKEN from the service's Variables tab, open your Railway domain at /setup, paste the token as the setup code, and choose a password of 12 or more characters.

### Do I have to provide a model key at deploy time?

No. Bring your own model key later. The server boots without one, and agents cannot run until a key is added.

### Are there Docker sandboxes for agent runs?

No. Railway has no Docker socket, so Boxes are none, the same as upstream's Render blueprint.

### How much RAM does the service need?

Give the service at least 2 GB of RAM, because Claude Code and Codex install onto the volume on first use.

### What happens if I lose AGENTRUN_SEAL_KEY?

Keep AGENTRUN_SEAL_KEY with your backups. A store sealed under one key will not start under another, and saved secrets cannot be read.

### What should I back up?

Back up the /data volume, which holds the SQLite store, runs and learning data.


## Similar templates

- [Chat Chat](https://railway.com/deploy/-WWW5r) — Chat Chat, your own unified chat and search to AI platform.
- [Weaviate](https://railway.com/deploy/weaviate-1) — Vector database with hybrid search and an API key-protected API
- [Möbius Personal AI OS](https://railway.com/deploy/mobius-v01-personal-ai-os) — Self-hosted AI agent that builds and runs apps for you, with memory.

Open this page in a browser: https://railway.com/deploy/deploy-agentrun-server
