---
title: "Deploy DeerFlow"
description: "ByteDance's deep research super agent: web research, reports, memory"
category: "AI/ML"
url: https://railway.com/deploy/deep-research
---

# Deploy DeerFlow

ByteDance's deep research super agent: web research, reports, memory

**[Deploy DeerFlow on Railway](https://railway.com/template/deep-research)**

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

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

## Template content

### DeerFlow https://raw.githubusercontent.com/two-workspaces/deerflow/main/icon.svg

- **Image:** ghcr.io/two-workspaces/deerflow-web:2988ba1
- **Health check:** /railway-health
- **Public domain:** Yes

### Gateway https://raw.githubusercontent.com/two-workspaces/deerflow/main/icon.svg

- **Image:** ghcr.io/two-workspaces/deerflow-gateway:2988ba1
- **Health check:** /health

## Documentation

# Deploy and Host DeerFlow on Railway

[![Deploy on Railway](https://railway.com/button.svg)](https://railway.com/new/template/deep-research?referralCode=sLjDXb&utm_medium=integration&utm_source=button&utm_campaign=deerflow)

DeerFlow is ByteDance's open-source deep research agent ("super agent harness"). You give it a question; it plans the research, searches the web, reads the pages, keeps notes and writes a sourced report, with sub-agents for the parallel parts. It remembers what it learns about you across conversations, takes skills and MCP servers, and works with any OpenAI-compatible model. It is licensed MIT. This template runs DeerFlow 2.2.0 on Railway: the web app and the Gateway (the agent runtime), with an admin login from the first boot.

This is a community template, not made or supported by ByteDance.

## About Hosting DeerFlow

Before deploying, paste an [OpenRouter key](https://openrouter.ai/keys) into `LLM_API_KEY` on the **Gateway** service. The default model is `deepseek/deepseek-v4.1-flash` (cheap, with tool calls); set `LLM_MODEL` to any OpenRouter model id, or a comma-separated list to pick from in the chat. For another OpenAI-compatible provider (OpenAI, DeepSeek, a vLLM server), set `LLM_BASE_URL` and `LLM_MODEL` too.

Deploy and wait for both green checks (the first boot creates the database). The Gateway needs 1 GB of memory, which Railway's default limits allow. Open the **DeerFlow** service's domain and sign in with `ADMIN_EMAIL` (default `admin@example.com`) and the generated `ADMIN_PASSWORD`, both on the Gateway service's **Variables** tab.

**Who can use it:** only accounts on your instance. Sign-up is closed: the admin adds people from the settings, or set `ALLOW_SIGNUP=true` to let anyone who opens the site register (every account runs the agent on your model key). Upstream's first-run setup page, which lets the first visitor become admin, never appears, because the admin exists before the site answers.

**No shell for the agent:** DeerFlow can run commands on the server it runs on, which upstream keeps off unless you opt in, because its local sandbox is not an isolation boundary. This template removes the bash tool entirely. Research, reading pages, writing files and reports, memory, skills and MCP servers all work without it.

**Lost the password:** set `ADMIN_PASSWORD` to a new value and `ADMIN_PASSWORD_RESET=true`, redeploy the Gateway, sign in, then set `ADMIN_PASSWORD_RESET` back to `false`.

**Search:** without a key DeerFlow searches with DuckDuckGo and reads pages through Jina. A `TAVILY_API_KEY` switches search to Tavily, which is more reliable from cloud servers; a `JINA_API_KEY` raises Jina's limits.

**Costs:** a deep research run makes many model calls (planning, every search step, sub-agents, the report). Watch your provider's usage page the first days.

**Your data:** conversations, memory, uploads, generated files, MCP settings and the user accounts live in SQLite on the Gateway's volume. Redeploys keep them.

## Common Use Cases

- Deep research reports on a market, a technology or a company, with sources
- A private research assistant for a team, on your own model key and infrastructure
- Literature and competitor scans that read dozens of pages and summarise them
- Turning research into drafts, slides outlines or notes with DeerFlow's skills
- Connecting your own tools through MCP servers (GitHub, databases, internal APIs)

## Dependencies for DeerFlow Hosting

- An API key for OpenRouter or another OpenAI-compatible provider whose models support tool calls
- Optional: a Tavily key for web search

### Deployment Dependencies

- [DeerFlow on GitHub](https://github.com/bytedance/deer-flow)
- [DeerFlow website and docs](https://deerflow.tech)
- [Template source](https://github.com/two-workspaces/deerflow)

### Implementation Details

- **Services:** DeerFlow (the Next.js web app behind Caddy, on the Railway domain) and Gateway (the FastAPI Gateway and agent runtime, private network only, with a volume). Caddy takes the place of upstream's nginx: `/api` streams to the Gateway, everything else goes to the web app. Upstream's Redis is only needed for several Gateway workers and is left out; the Gateway runs one worker, as upstream's default.
- **Images:** upstream publishes none, so this repo builds both from the pinned DeerFlow release on GitHub Actions, following upstream's Dockerfiles (without the Lark and Docker CLIs, which need a Docker socket Railway doesn't have). Updates come as tested version bumps.
- **Configuration:** the Gateway writes `config.yaml` on every boot from upstream's example config of the same release and your variables, so a variable change only needs a redeploy. The model key stays in the environment, not in the file.
- **Sign-in:** the admin is created from `ADMIN_EMAIL`/`ADMIN_PASSWORD` before the Gateway starts; local sign-up is off unless `ALLOW_SIGNUP=true`; the login lockout counts each visitor's address, not Railway's edge. Upstream's switch for turning auth off is ignored.
- **Never crash-looping on a variable:** with no model key, a key the provider rejects, a model id OpenRouter doesn't have, a bad admin email or short password, or less than 1 GB of memory, the site shows a page saying what to fix instead of restarting over and over. The Gateway deploy logs say the same. A crash after the Gateway has started is left to Railway's restart.
- **Memory:** the Gateway idles around 400–500 MB and peaked at 670 MB in a research run with three sub-agents (pages are read through Node's Readability.js), so it needs **1 GB**; below 0.9 GB it shows a page asking for more instead of being killed mid-run. The web service runs in about 100–200 MB.

## Why Deploy DeerFlow 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 DeerFlow 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/deep-research
