Deploy Dify

Open-source LLM app builder: visual workflows, AI agents and RAG

Deploy Dify

Just deployed

/data

/home/dify

Just deployed

Just deployed

/app/storage

Just deployed

/var/lib/postgresql/data

Just deployed

Just deployed

Just deployed

dify-storage

Bucket

Just deployed

Deploy and Host Dify on Railway

Dify is an open-source platform for building AI applications. You design chatbots, agents and multi-step workflows in a visual editor, add knowledge bases for retrieval-augmented generation (RAG), and connect models from OpenAI, Anthropic, Ollama and other providers through plugins. Every app can be published as a web app or called through an API.

About Hosting Dify

Dify runs as several cooperating services. The API, a Celery worker and a scheduler share one image. A Next.js web console, a code sandbox for Python and JavaScript nodes, a plugin daemon, an agent backend with its own shell sandbox, and an SSRF proxy for outbound requests complete the stack. Postgres stores app data and, with pgvector, knowledge embeddings. Redis carries the task queue and cache, and a Railway bucket holds uploaded files. This template wires all of these together over Railway's private network, generates every secret, and serves the console, API and webhooks from one public domain. The stack uses about 3 GB of memory at idle.

Common Use Cases

  • Customer-support and internal chatbots that answer from your own documents (RAG)
  • Automated workflows that chain LLM calls, HTTP requests, code steps and tools
  • AI agents and assistants exposed to other apps through Dify's API or MCP

Dependencies for Dify Hosting

  • PostgreSQL with the pgvector extension (included)
  • Redis (included)
  • A Railway bucket for uploaded files (included)
  • An API key from at least one model provider, such as OpenAI or Anthropic, added in Dify after setup

Deployment Dependencies

Implementation Details

All services run Dify 1.19.0's official images, pinned by digest (plugin daemon 0.6.14-local, sandbox 0.2.15), with upstream's default settings. Small start scripts from aalfath/dify-railway-template apply those settings; any variable you add to a service overrides them.

First run: open the public URL, go to /install, and enter the INIT_PASSWORD value from the API service's variables. Then create your admin account. Until you do that, nobody can claim the instance.

Railway has no isolated internal networks, so unlike upstream's Docker setup the code sandboxes are not cut off from the private network. Their outbound HTTP goes through the SSRF proxy, and workflow HTTP requests to private addresses are blocked.

Why Deploy Dify 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 Dify 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