Deploy Agent Zero · Quick Start

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

Deploy Agent Zero · Quick Start

Just deployed

/a0/usr

Deploy and Host Agent Zero on Railway

Agent Zero is an open-source, 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 and browses the web, keeps long-term memory, learns from documents you give it, and hands subtasks to subordinate agents. You work with it in a chat-style web UI or call it over HTTP, and it can connect to MCP servers and run scheduled tasks.

About Hosting Agent Zero

This template deploys the latest official agent0ai/agent-zero image as one service with a volume. The agent can run shell commands as root inside its container, so the template locks the UI down before the first request:

  • Login from the first request. AUTH_LOGIN and AUTH_PASSWORD are generated for each deploy. Without them, the UI and its API redirect to the login page. There is no default account.
  • Your data on a volume. Everything Agent Zero keeps in /a0/usr (settings, saved API keys, memory, knowledge, chats, projects, the agent's work folder, uploads, skills and scheduled tasks) lives on a Railway volume and survives redeploys and upgrades.
  • Memory works on Railway. The current image ships a broken numpy install (numpy 1.26.4 laid over leftovers of numpy 2.3.5), so the embedding model behind memory and knowledge fails to load with All ufuncs must have type numpy.ufunc. The start command removes the leftover files before Agent Zero starts. It only acts while that import is broken, so it does nothing once upstream fixes the image.
  • One public port. Only the web UI gets a domain. The SSH server, the built-in SearXNG search engine and the tunnel API inside the container stay private.
  • Healthcheck. Railway waits for /api/health before routing traffic to a new deployment.
  • No key needed to boot. The LLM provider keys are optional. The UI, login, settings, knowledge import and memory all work before you add one.

Getting started

  1. Deploy. Optionally paste an OpenRouter, OpenAI or Anthropic API key into the matching variable first; you can also add keys later.
  2. Wait for the agent-zero service to turn green. The image is large, so the first deploy takes a few minutes.
  3. Open the service's Variables tab and copy AUTH_LOGIN and AUTH_PASSWORD.
  4. Open the public URL and sign in.
  5. Open Settings. Agent Zero's default model preset uses OpenRouter, so with API_KEY_OPENROUTER set you can start chatting right away. With an OpenAI or Anthropic key, choose a model from that provider for the chat and utility models. You can also paste keys into Settings instead of using variables.
  6. Ask it for something real, such as "clone this repository and summarise how it handles auth" or "find this week's releases of my three favourite libraries and write a changelog to a file".
  7. To give it reference material, use Import knowledge in the chat input. Files are stored on the volume and indexed into memory.

Common Use Cases

  • A coding and ops agent you can reach from any browser: it writes, runs and debugs code in its own sandboxed Linux environment
  • Research tasks that search the web, read pages and documents, and save the findings to files or memory
  • Scheduled jobs, such as daily monitoring, report generation or data clean-up, run by the built-in scheduler
  • An agent other services call over HTTP (POST /api/api_message with the key from Settings, External Services) or over MCP and A2A

Dependencies for Agent Zero Hosting

  • agent0ai/agent-zero:latest (official image)
  • A Railway volume at /a0/usr
  • An API key from an LLM provider (OpenRouter, OpenAI, Anthropic or any other provider Agent Zero supports), or a model server you run yourself

Deployment Dependencies

Implementation Details

Variables on the agent-zero service:

VariableValueWhy
AUTH_LOGINgenerated, admin- plus 8 charactersWeb UI user name. Login is required while it is set
AUTH_PASSWORDgenerated, 32 charactersWeb UI password
API_KEY_OPENROUTERoptionalUsed by the default model preset
API_KEY_OPENAI, API_KEY_ANTHROPICoptionalFor OpenAI or Anthropic models; Agent Zero reads any API_KEY_{PROVIDER} variable
PORT80The image hard-codes the UI to port 80; this points the domain and healthcheck at it
RAILWAY_HEALTHCHECK_TIMEOUT_SEC600Time allowed for the first boot

Agent Zero also reads /a0/usr/.env on the volume, and values there win over service variables. Each time you save Settings, it writes the login and the API key fields to that file, including empty ones. After your first save, change the password and keys in Settings rather than in Railway variables; a variable you edit later is ignored while /a0/usr/.env has a line for it.

The start command runs the numpy repair described above, then the image's own /exe/initialize.sh, which starts Agent Zero, SSH, cron and SearXNG under supervisord.

Only /a0/usr persists. Tools the agent installs elsewhere in the container (with apt or pip, for example) are gone after a redeploy; ask the agent to keep scripts and virtual environments in its work folder if they need to last.

The image tracks latest. To upgrade, redeploy the agent-zero service. Avoid the in-app updater: it replaces program files outside the volume, so the next redeploy brings back the image's version anyway. To hold a version, set the image to a release tag such as v2.15. The service runs as one replica because the volume attaches to one container. The UI session cookie is tied to the running process, so you sign in again after each redeploy.

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.


Template Content

More templates in this category

View Template
Chat Chat
Chat Chat, your own unified chat and search to AI platform.

okisdev
117
View Template
Weaviate
Vector database with hybrid search and an API key-protected API

GitHub Locker
1
View Template
Möbius Personal AI OS
Self-hosted AI agent that builds and runs apps for you, with memory.

bento
1