---
title: "Deploy Cezar"
description: "Run Claude Code, Codex and OpenCode tasks from one web cockpit"
category: "AI/ML"
url: https://railway.com/deploy/cezar
---

# Deploy Cezar

Run Claude Code, Codex and OpenCode tasks from one web cockpit

**[Deploy Cezar on Railway](https://railway.com/template/cezar)**

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

- **Creator:** Agaz Self-Host
- **Category:** AI/ML

## Template content

### Cezar https://raw.githubusercontent.com/open-mercato/cezar/v0.20.0/packages/web/public/icon-512.png

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

## Documentation

# Deploy and Host Cezar on Railway

Cezar is an open-source (MIT) cockpit for AI coding agents. You describe a task, and Cezar runs Claude Code, Codex or OpenCode on it in its own git worktree, streams every step, tool call and token live, and lets you review the diff, send notes back or open a draft pull request. Workflows, automations and parallel variants are built in.

## About Hosting Cezar

This template runs Cezar v0.20.0 as one service built from a public GitHub repo, with Claude Code, Codex, OpenCode, git and the GitHub CLI preinstalled. Cezar has no login of its own, so a small Caddy front asks for a username and a generated password before anything reaches it, as upstream's own server install does with nginx. Cezar uses no database: its workspace, your cloned projects, task worktrees and the agents' logins all live on one volume at `/home/cezar`, so they survive redeploys and restarts. After deploy, open the URL, sign in, and connect an agent: add `ANTHROPIC_API_KEY` or `OPENAI_API_KEY` as a variable, or sign the agent in from Cezar's terminal.

## Common Use Cases

* Keep coding agents working on tasks around the clock, even when your laptop is closed, and review the results from your phone
* Hand a GitHub issue to an agent, compare two or three variant runs, and open a draft pull request from the best diff
* Schedule recurring work (dependency checks, release notes, pull-request reviews) as automations that run an agent on a timer or trigger

## Dependencies for Cezar Hosting

* An account for at least one coding agent: an Anthropic API key or Claude login (Claude Code), an OpenAI API key or ChatGPT login (Codex), or any provider OpenCode supports
* A GitHub token (optional) for cloning private repositories and opening draft pull requests

### Deployment Dependencies

* Cezar: https://github.com/open-mercato/cezar
* Template repo (Dockerfile, start script, changelog): https://github.com/aalfath/cezar-railway-template
* Claude Code: https://docs.anthropic.com/en/docs/claude-code
* Codex CLI: https://github.com/openai/codex
* OpenCode: https://opencode.ai

### Implementation Details

**Service:** `Cezar`, one container. Caddy listens on `PORT` (8080) and checks the login; Cezar runs behind it on `127.0.0.1:4321` in upstream's hosted mode (`CEZ_REMOTE=1`). The health check `/healthz` answers without a login and only says whether Cezar is up. The volume at `/home/cezar` holds everything. If Cezar or Caddy stops, the container exits with an error so Railway restarts it.

**Sign in:** the username is `CEZAR_USERNAME` (default `admin`) and the password is `CEZAR_PASSWORD`, generated at deploy. You can see both in the service's Variables tab. Change the password there and redeploy at any time.

**Connect an agent:** pick one of these.

* Add `ANTHROPIC_API_KEY` (Claude Code) and/or `OPENAI_API_KEY` (Codex; it signs Codex in on the next start) to the service's variables and redeploy.
* Or open a task's terminal in Cezar and run `claude`, `codex login --device-auth` or `opencode auth login` to sign in with your own subscription. Logins are kept on the volume.

Add `GH_TOKEN` (a GitHub token with `repo` scope) to clone private repositories and open draft pull requests.

**First steps:** Cezar opens on a small `playground` git repository so you can try a task at once. Add your own projects with **+ → Clone from GitHub**; they are cloned to `/home/cezar/cezar/projects`.

**Memory:** on Railway's Free plan (0.5 GB) the template runs one agent task at a time, turns off LLM task naming and the agent sign-in checks, and closes an idle agent session after 1 minute; with these settings a Claude Code task peaked at about 380 MB with no process killed. Above 1 GB the sign-in checks are on, and above 1.5 GB Cezar's own defaults (2 parallel tasks, task naming) apply. These are first-boot defaults; change them under Settings → Resources. For parallel tasks, large repositories, or builds and tests inside tasks, use Hobby or higher with at least 2 GB.

**Not included:** Docker inside tasks, and Codex's own sandbox (Railway doesn't allow the user namespaces it needs). Cezar runs Codex without that sandbox by default, so it works. Desktop-only features (open in editor, design-mode preview) are off in hosted mode, as upstream intends.

**Updates:** the template repo pins Cezar and the agent CLIs by exact version and the base images by digest. When we publish a new version, Railway shows an update notice on your project. Read the repo's `CHANGELOG.md`, then apply it; your data on the volume is kept.

## Why Deploy Cezar on Railway?


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 Cezar 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.



## 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/cezar
