---
title: "Deploy Agent Zero"
description: "Self-hosted general-purpose AI agent with terminal & code exec"
category: "AI/ML"
url: https://railway.com/deploy/agent-zero
---

# Deploy Agent Zero

Self-hosted general-purpose AI agent with terminal & code exec

**[Deploy Agent Zero on Railway](https://railway.com/template/agent-zero)**

- **Creator:** codestorm
- **Category:** AI/ML
- **Total deploys:** 6

## Template content

### agent-zero https://www.gravatar.com/avatar/d2dd7d2afab666c642eefa1e90147abe?s=120&r=g&d=404

- **Image:** agent0ai/agent-zero:latest
- **Public domain:** Yes

## Documentation

# Deploy and Host Agent Zero on Railway

Agent Zero is an open-source, general-purpose AI agent framework packaged as a Docker image. Instead of shipping pre-built tasks, it gives an LLM direct access to a terminal, code execution, browsing, and persistent memory — letting the agent write and use its own tools to accomplish whatever it's asked.

## About Hosting Agent Zero

Hosting Agent Zero means running its official Docker image (`agent0ai/agent-zero`) as a long-lived web service with a persistent volume attached. The container serves a Web UI on port 80 and needs `/a0/usr` mounted to a volume so settings, chats, memory, and knowledge survive restarts and redeploys. Because the agent can execute arbitrary code and shell commands, it should always run in an isolated container (as it does on Railway) and be protected with login credentials before being exposed on a public URL. Once deployed, you add your own LLM provider API key from the Settings panel to start using it.

## Common Use Cases

- Autonomous coding assistant that writes, runs, and debugs code in its own sandboxed terminal
- Research agent that searches the web, reads documentation, and stores findings in persistent memory
- General personal automation — file handling, scripted tasks, and multi-step workflows without a fixed toolset

## Dependencies for Agent Zero Hosting

- A Railway persistent volume (mounted to `/a0/usr`)
- An API key from an LLM provider (OpenAI, Anthropic, OpenRouter, etc.) — added after deployment, not required at deploy time

### Deployment Dependencies

- [Agent Zero GitHub Repository](https://github.com/agent0ai/agent-zero)
- [Agent Zero Documentation](https://www.agent-zero.ai/p/docs/installation/)
- [Docker Hub Image](https://hub.docker.com/r/agent0ai/agent-zero)

### Implementation Details

Only two values are required at deploy time — a username and a password for the Web UI login:

```
AUTH_LOGIN=your-username
AUTH_PASSWORD=your-password
```

Everything else — LLM provider, model choice, agent profile — is configured afterward from the Settings panel in the Web UI, or optionally automated later via `A0_SET_*` environment variables. On first boot, Agent Zero takes roughly 30–90 seconds to initialize (Python, SearXNG, supervisord) before the Web UI responds.

**Manual setup vs. this Railway template:**

| | Manual Docker Setup | This Railway Template |
|---|---|---|
| Required input before running | Docker install, port mapping, volume path, `.env` file | Username + password only |
| Persistent storage | Manual volume/bind mount configuration | Pre-configured Railway volume on `/a0/usr` |
| Public HTTPS access | Manual reverse proxy / tunnel setup | Railway public domain out of the box |
| Updates | `docker pull` + container recreation by hand | Redeploy from Railway dashboard |
| Time to running instance | 10–20 minutes | Under 2 minutes |

## Why Deploy Agent Zero 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 Agent Zero 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.
- [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/agent-zero
