---
title: "Deploy Agent Zero"
description: "Open-source AI agent with its own Linux shell, memory and a secured web UI"
category: "AI/ML"
url: https://railway.com/deploy/agent-zero-2
---

# Deploy Agent Zero

Open-source AI agent with its own Linux shell, memory and a secured web UI

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

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

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

## Template content

### Agent Zero https://raw.githubusercontent.com/agent0ai/agent-zero/v2.16/docs/res/favicon_round.png

- **Source:** https://github.com/aalfath/agent-zero-railway-template
- **Health check:** /api/health
- **Public domain:** Yes

## Documentation

# Deploy and Host Agent Zero on Railway

Agent Zero is an open-source (MIT) general-purpose AI agent. Instead of a fixed set of tools it gets its own Linux environment: it writes and runs code, uses the terminal, searches the web, keeps long-term memory, learns from documents you give it and hands subtasks to subordinate agents, all from a chat-style web UI.

## About Hosting Agent Zero

This template runs Agent Zero v2.16 from the official image, pinned by version and digest and built from a public GitHub repo, as one service with a public HTTPS domain and a health check on `/api/health`. Everything you create (settings, saved API keys, chats, memory, knowledge, projects, skills, scheduled tasks and the agent's work folder) lives on a volume at `/a0/usr`, so it survives redeploys and updates. The agent can run any command inside its container, so the web UI needs a login from the first request: the user name is `admin` and the password is generated for each deploy. The image is large (about 3 GB), so the first build takes a few minutes.

## Common Use Cases

* A coding assistant that clones a repository, reads it, runs the tests and writes changes in its own sandboxed terminal
* A research agent that searches the web, reads sources and keeps findings in long-term memory and a knowledge base
* Scheduled jobs and multi-step automations, such as a daily report written to a file or sent to a chat

## Dependencies for Agent Zero Hosting

* An API key for a model provider (OpenRouter, OpenAI, Anthropic and others), or your own model server such as Ollama, entered under Settings after deploying
* A Railway volume at `/a0/usr` (included in this template)

### Deployment Dependencies

* [Agent Zero on GitHub](https://github.com/agent0ai/agent-zero) and its [v2.16 release](https://github.com/agent0ai/agent-zero/releases/tag/v2.16)
* [Official Docker image](https://hub.docker.com/r/agent0ai/agent-zero)
* [Template repo](https://github.com/aalfath/agent-zero-railway-template) with the Dockerfile, start script and changelog

### Implementation Details

After deploying:

1. Wait for the Agent Zero service to turn green. The first build pulls a large image and takes a few minutes.
2. Open the service's **Variables** tab and copy `AUTH_PASSWORD`. The user name is `AUTH_LOGIN` (default `admin`).
3. Open the public URL, sign in, and open **Settings**. Add a model provider's API key and pick the chat and utility models. Agent Zero's default preset uses OpenRouter.
4. Ask it for something real, such as "clone this repository and summarise how it handles auth".

The service won't start if `AUTH_LOGIN` or `AUTH_PASSWORD` is empty, so the agent is never exposed without a login. The start script also removes numpy 2.x files that the upstream image deletes but that come back at runtime on Railway, so memory and knowledge work.

**Updates:** when a new Agent Zero release is pinned in the template repo, Railway shows an "update available" notice in your project, and you choose when to apply it. Your data stays on the volume. Read the repo's CHANGELOG first. Don't use Agent Zero's built-in self-update here: a redeploy would go back to the image's version.

## 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.
- [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/agent-zero-2
