---
title: "Deploy roko-worker"
description: "Stateless AI agent worker for task execution"
category: "Other"
url: https://railway.com/deploy/roko-worker
---

# Deploy roko-worker

Stateless AI agent worker for task execution

**[Deploy roko-worker on Railway](https://railway.com/template/roko-worker)**

- **Creator:** Nunchi Trade 
- **Category:** Other

## Template content

### wpank/roko-worker:latest

- **Image:** wpank/roko-worker:latest

## Documentation

# Deploy and Host Roko Worker

Roko Worker is a stateless agent execution container. It receives task requests over HTTP, runs them through the Roko universal loop (compose prompt, dispatch to Claude, validate with gates), and reports results back to the control plane. Scale horizontally by deploying multiple workers.

## About Hosting

Workers are stateless with no persistent storage needed. Each worker reads its agent template from the `ROKO_TEMPLATE_JSON` environment variable (base64-encoded JSON) and listens for task submissions. The health endpoint at `GET /health` returns status, template name, and uptime.

### Environment Variables

- `ANTHROPIC_API_KEY` (required) — your Anthropic API key for Claude agent execution
- `ROKO_CONTROL_PLANE_URL` (required) — URL of your Roko control plane instance for result callbacks
- `ROKO_TEMPLATE_JSON` (required) — base64-encoded agent template JSON defining the worker's behavior
- `PORT` (default: 8080) — HTTP listen port
- `RUST_LOG` (default: info) — log verbosity

## Common Use Cases

- Execute AI coding tasks dispatched from the Roko control plane
- Run code-implementer agents that clone repos, execute plans, commit changes, and open PRs
- Scale agent fleet capacity by deploying multiple workers behind a load balancer
- Process one-off agent tasks via the `POST /task` endpoint

## Dependencies for Roko Worker Hosting

- A running Roko control plane instance (for task dispatch and result callbacks)
- An Anthropic API key with access to Claude (for agent execution)
- A base64-encoded agent template defining the worker's role and prompt

### Deployment Dependencies

- No persistent storage required — workers are fully stateless
- No databases or volumes needed
- Workers include Node.js, Python, and Claude Code CLI for agent tool execution

## Why Deploy

- **Horizontal scaling**: Spin up as many workers as you need — each handles tasks independently
- **Code agents**: Workers can clone repositories, generate code, run tests, commit changes, and open pull requests autonomously
- **Stateless design**: No storage management — deploy, use, tear down without cleanup
- **Rich tooling**: Pre-installed with Node.js, Python, and Claude Code CLI so agents have the tools they need at runtime

## Similar templates

- [Rocky Linux](https://railway.com/deploy/rocky-linux) — Hosted Rocky Linux 9 workspace with SSH and persistent storage. 🚀
- [Foundry Virtual Tabletop](https://railway.com/deploy/X5tR6G) — A Self-Hosted & Modern Roleplaying Platform
- [Letta Code Remote](https://railway.com/deploy/letta-code-remote) — Run a Letta Code agent 24/7. No inbound ports, just deploy.

Open this page in a browser: https://railway.com/deploy/roko-worker
