Deploy Dify
Open-source LLM app builder: visual workflows, AI agents and RAG
Redis
Just deployed
/data
Just deployed
Agent-Sandbox
Just deployed
/home/dify
Just deployed
Agent-Backend
Just deployed
Just deployed
Plugin-Daemon
Just deployed
/app/storage
Postgres
Just deployed
/var/lib/postgresql/data
Just deployed
SSRF-Proxy
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
- Dify on GitHub: https://github.com/langgenius/dify
- Dify self-hosting docs: https://docs.dify.ai/en/self-host/deploy/quick-start/docker-compose
- Template start scripts: https://github.com/aalfath/dify-railway-template
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
Redis
redis:8.8.4Agent-Sandbox
langgenius/dify-agent-local-sandbox:1.19.0Agent-Backend
langgenius/dify-agent-backend:1.19.0Plugin-Daemon
langgenius/dify-plugin-daemon:0.6.14-localPostgres
pgvector/pgvector:0.8.7-pg17SSRF-Proxy
ubuntu/squid:6.6-24.04_betadify-storage
Bucket

