---
title: "Deploy AgenticOS"
description: "Self-hosted AI agents for teams: tools, knowledge bases, Slack, approvals"
category: "AI/ML"
url: https://railway.com/deploy/agentic-os
---

# Deploy AgenticOS

Self-hosted AI agents for teams: tools, knowledge bases, Slack, approvals

**[Deploy AgenticOS on Railway](https://railway.com/template/agentic-os)**

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

- **Creator:** Two Workspaces
- **Category:** AI/ML

## Template content

### Redis https://devicons.railway.app/i/redis.svg

- **Image:** valkey/valkey:8.1.12-alpine
- **Start command:** `/bin/sh -c "exec docker-entrypoint.sh valkey-server --requirepass $REDIS_PASSWORD --maxmemory 256mb --maxmemory-policy allkeys-lru --save '' --appendonly no"`

### AgenticOS https://raw.githubusercontent.com/two-workspaces/agenticos/main/icon.svg

- **Image:** ghcr.io/two-workspaces/agenticos-web:b0789f5
- **Health check:** /api/health
- **Public domain:** Yes

### Postgres https://devicons.railway.app/i/postgresql.svg

- **Image:** pgvector/pgvector:0.8.7-pg16
- **Start command:** `docker-entrypoint.sh postgres -c max_connections=200`

### Worker https://raw.githubusercontent.com/two-workspaces/agenticos/main/icon.svg

- **Image:** ghcr.io/two-workspaces/agenticos:b0789f5

### API https://raw.githubusercontent.com/two-workspaces/agenticos/main/icon.svg

- **Image:** ghcr.io/two-workspaces/agenticos:b0789f5
- **Health check:** /api/v1/health
- **Public domain:** Yes

## Buckets

- **Files**

## Documentation

# Deploy and Host AgenticOS on Railway

[![Deploy on Railway](https://railway.com/button.svg)](https://railway.com/deploy/agentic-os)

AgenticOS is an open-source platform where a team builds and runs its AI agents together: agents with tools, knowledge bases and 4,700+ MCP servers, shared chat, routines that run on a schedule, approvals before risky actions, budgets, an audit trail, and connections to Slack, Mattermost, Telegram and more. It works with your own model keys (OpenAI, Anthropic, Google, OpenRouter and others) and is licensed Apache-2.0. This template runs AgenticOS 1.101.0 on Railway: the web app, the API, the background worker, Postgres with pgvector, Redis and a bucket for files, with your owner account ready on the first boot and sign-up closed to invitations.

This is a community template, not made or supported by the AgenticOS authors.

## About Hosting AgenticOS

Before deploying, set `ADMIN_EMAIL` on the API service to your email. Optionally set `BOOTSTRAP_API_KEY` to a key for `BOOTSTRAP_PROVIDER` (`openai` by default; also `anthropic`, `google` or `openrouter`) so the demo agent answers straight away. Deploy and wait for the green checks: the first boot applies the database migrations and creates your account, which takes a few minutes. Then open the **AgenticOS** service's Railway domain and sign in with `ADMIN_EMAIL` and the generated `ADMIN_PASSWORD` from the API service's Variables tab. Change the password under your profile afterwards; the variable is only used on the first boot.

**Plan:** AgenticOS needs the Hobby plan or higher. At rest the API uses about 0.85 GB (up to 1.6 GB while its first boot migrates) and the worker about 1.2 GB, more than the Free (0.5 GB) and Trial (1 GB) plans allow a service. On those plans every service shows a page saying so instead of being killed for memory over and over; upgrade the workspace and redeploy.

**Why sign-up is closed:** AgenticOS lets anyone register by default, and on a public address that would admit strangers. The template switches it to invite only on the first boot. Invite your team from the Organization page; to change the policy, open Admin > Deployment > Access & accounts. The sign-in page still shows a Register link, but it refuses anyone without an invitation.

**Model keys:** if you skipped `BOOTSTRAP_API_KEY`, add one under Connections > Vault, then choose the model for each agent in its Agent Builder (the Architect and the AgenticOS assistant both start without one). Keys and tokens you store are encrypted with `VAULT_MASTER_KEY`. Keep that variable: if it is lost or changed, every stored key has to be entered again.

**Your data:** users, agents, chats, knowledge bases and their embeddings are in the Postgres service, on its volume. Uploaded documents, chat attachments and generated images live in the Files bucket, which the API and the worker both use. Redis only holds rate limits and live updates. Redeploys keep everything, and the API applies AgenticOS's migrations on every start, so a new image upgrades the database by itself.

**Custom domains:** add one to the AgenticOS service and one to the API service. Then on the API set `FRONTEND_URL` and `PUBLIC_SITE_URL` to the web address, add it to `CORS_ORIGINS`, and set `PUBLIC_BASE_URL`, `PUBLIC_API_URL` and `PUBLIC_WS_URL` (`wss://`) to the API address; on the AgenticOS service set `PUBLIC_SITE_URL`, `PUBLIC_API_URL` and `PUBLIC_WS_URL` to match. Redeploy all three app services.

**Optional extras**, added to the API and Worker services any time:

- Email for invitations and notifications: `SMTP_HOST`, `SMTP_PORT`, `SMTP_USER`, `SMTP_PASSWORD`, `EMAIL_FROM`
- Google, GitHub or OIDC sign-in: the variables in the [configuration reference](https://github.com/vstorm-co/agenticos/blob/main/docs/configuration.md), then list the providers in `OAUTH_PROVIDERS` on the AgenticOS service

**What is not included:** AgenticOS's code sandbox (`sandboxd`) and its private browser containers start throwaway Docker containers, which needs a Docker daemon that Railway does not give a service. Agents work without them; to give agents code execution, register a remote sandbox under Connections > Sandboxes.

## Common Use Cases

- An internal AI assistant for a team, answering from its own knowledge base of your documents
- Agents that work in Slack, Mattermost or Telegram, asking for approval before risky actions
- Scheduled routines: weekly reports, inbox triage, research digests
- One place to build, test and share agents across a company, with budgets per team
- A self-hosted alternative to ChatGPT Enterprise or Grok Bot on your own model keys

## Dependencies for AgenticOS Hosting

- Postgres 16 with pgvector, Redis (Valkey) and a Railway bucket (all included)
- An API key from a model provider: OpenAI, Anthropic, Google, OpenRouter or another

### Deployment Dependencies

- [AgenticOS on GitHub](https://github.com/vstorm-co/agenticos)
- [AgenticOS configuration reference](https://github.com/vstorm-co/agenticos/blob/main/docs/configuration.md)
- [Template source](https://github.com/two-workspaces/agenticos)

### Implementation Details

- **Services:** AgenticOS (the web app, on the public domain), API (on its own public domain, which the browser, Slack and webhooks call), Worker (agent runs, schedules, document ingestion and syncs), Postgres 16 with pgvector 0.8.7, Redis (Valkey 8.1) and the Files bucket.
- **Images:** small wrappers over upstream's pinned `ghcr.io/vstorm-co/agenticos-backend` and `agenticos-frontend` 1.101.0, built ahead of time, so a deploy pulls them instead of building. One backend image serves the API and the worker; `AGENTICOS_SERVICE` picks the role.
- **First boot:** the API applies the migrations, closes sign-up to invitations, and runs AgenticOS's own `bootstrap` to create the owner, the organization and the demo agent. It runs while no user exists, so it never repeats once you have signed in. The worker waits until the database is up to date before it starts.
- **Files in a bucket, not on a volume:** a Railway volume attaches to one service, and the worker reads the documents the API receives, so uploads go to the Files bucket (`FILE_STORAGE_BACKEND=s3`).
- **Never crash-looping on a variable:** if a required variable is empty, `ADMIN_EMAIL` is not an email, the plan is too small, or the migrations keep failing, the API and the web app show a page saying what to fix instead of restarting over and over, and the deploy logs say the same.
- **Scaling:** `UVICORN_WORKERS` sets the API processes (1 by default, about 0.8 GB each) and `WORKER_INGEST_CHILDREN` the document parsers (1, about 0.4 GB each). Raise them together with the services' memory for a busy deployment.

## Why Deploy AgenticOS 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 AgenticOS 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/agentic-os
