---
title: "Deploy Dify v1 AI App Studio"
description: "Visual agent & RAG builder with plugins, sandbox, workers and a vector DB."
category: "AI/ML"
url: https://railway.com/deploy/dify-v1-ai-app-studio
---

# Deploy Dify v1 AI App Studio

Visual agent & RAG builder with plugins, sandbox, workers and a vector DB.

**[Deploy Dify v1 AI App Studio on Railway](https://railway.com/template/dify-v1-ai-app-studio)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/dify-v1-ai-app-studio/manifest.json

- **Creator:** bento
- **Category:** AI/ML
- **Total deploys:** 1

## Template content

### API https://avatars.githubusercontent.com/u/127165244?v=4

- **Image:** langgenius/dify-api:1.17.1
- **Health check:** /health

### Worker https://avatars.githubusercontent.com/u/127165244?v=4

- **Image:** langgenius/dify-api:1.17.1

### SSRF Proxy https://avatars.githubusercontent.com/u/363029?v=4

- **Source:** baranberkay96/dify-railway

### Web https://avatars.githubusercontent.com/u/127165244?v=4

- **Image:** langgenius/dify-web:1.17.1
- **Health check:** /signin

### Agent SSRF Proxy https://avatars.githubusercontent.com/u/363029?v=4

- **Source:** baranberkay96/dify-railway

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

- **Image:** ghcr.io/railwayapp-templates/postgres-ssl:18

### API WebSocket https://avatars.githubusercontent.com/u/127165244?v=4

- **Image:** langgenius/dify-api:1.17.1
- **Health check:** /health

### Redis https://cdn.sanity.io/images/sy1jschh/production/0ce0bfdcfbdbf69662b1116671f97c2dd788b655-157x157.svg

- **Image:** redis:8.2
- **Start command:** `/bin/sh -c "rm -rf $RAILWAY_VOLUME_MOUNT_PATH/lost+found/ && exec docker-entrypoint.sh redis-server --requirepass $REDIS_PASSWORD --save 60 1 --dir $RAILWAY_VOLUME_MOUNT_PATH"`

### Weaviate https://avatars.githubusercontent.com/u/37794290?v=4

- **Image:** semitechnologies/weaviate:1.39.11
- **Start command:** `/bin/weaviate --host :: --port 8080 --scheme http`
- **Health check:** /v1/.well-known/ready

### Sandbox https://avatars.githubusercontent.com/u/127165244?v=4

- **Image:** langgenius/dify-sandbox:0.2.15
- **Health check:** /health

### Worker Beat https://avatars.githubusercontent.com/u/127165244?v=4

- **Image:** langgenius/dify-api:1.17.1

### Agent Sandbox https://avatars.githubusercontent.com/u/127165244?v=4

- **Source:** baranberkay96/dify-railway
- **Health check:** /healthz

### Plugin Daemon https://avatars.githubusercontent.com/u/127165244?v=4

- **Image:** langgenius/dify-plugin-daemon:0.6.10-local
- **Health check:** /health/check

### Agent Backend https://avatars.githubusercontent.com/u/127165244?v=4

- **Image:** langgenius/dify-agent-backend:1.17.1
- **Start command:** `uvicorn dify_agent.server.app:app --host 0.0.0.0 --port 5050`
- **Health check:** /docs

### Gateway https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/nginx.svg

- **Source:** baranberkay96/dify-railway
- **Health check:** /healthz
- **Public domain:** Yes

## Buckets

- **Bucket**

## Documentation

# Deploy and Host Dify with Railway

Dify is an open-source platform for building LLM applications: chatbots, RAG knowledge bases, agents and multi-step workflows, designed in a visual editor and published as web apps or APIs. This community template runs the complete Dify 1.17 stack on Railway behind a single HTTPS URL.

## About Hosting Dify

Self-hosting Dify means running far more than one container. The console (Next.js) talks to a Flask API; Celery workers index documents and execute workflows; a beat scheduler fires timed jobs; a plugin daemon installs and runs model/tool plugins; a code sandbox executes user code; and the new Agent backend drives sandboxed agent shells. Postgres stores metadata, Redis carries queues and locks, Weaviate holds embeddings, and uploaded files need object storage. This template wires all of it with generated secrets, private networking, a Railway Bucket for files, persistent volumes for stateful services, and an nginx gateway that reproduces Dify's own routing on one domain.

## Common Use Cases

- Internal knowledge assistants that answer from your PDFs, wikis and policies (RAG with citations)
- Customer-facing chatbots and embeddable chat widgets backed by any LLM provider
- Multi-step AI workflows (classification, extraction, summarisation) exposed as an API for your products
- Tool-using agents that browse, call APIs and run code in a sandbox
- A shared, governed LLM workspace where teams build and publish AI apps without writing backend code

## Dependencies for Dify Hosting

- Dify API, Worker, Worker Beat and WebSocket (`langgenius/dify-api`), Web (`langgenius/dify-web`)
- Dify Plugin Daemon, Code Sandbox, Agent Backend and Agent Sandbox
- PostgreSQL (metadata), Redis (queues, cache, locks), Weaviate (vector store)
- Railway Bucket (S3-compatible file storage)
- nginx gateway and two Squid SSRF proxies (built from this repository)

### Deployment Dependencies

- Dify source and self-hosting guide: https://github.com/langgenius/dify and https://docs.dify.ai/en/self-host/quick-start/docker-compose
- Dify environment variables: https://docs.dify.ai/en/self-host/configuration/environments
- Dify Plugin Daemon: https://github.com/langgenius/dify-plugin-daemon
- Dify Sandbox: https://github.com/langgenius/dify-sandbox
- Weaviate configuration: https://docs.weaviate.io/deploy/configuration/env-vars
- Railway Buckets: https://docs.railway.com/guides/storage-buckets

### Implementation Details

| Service | Image | Role | Public |
|---|---|---|---|
| Gateway | nginx 1.30 (repo build) | Single origin; routes `/console/api`, `/api`, `/v1`, `/files`, `/mcp`, `/triggers` → API, `/socket.io/` → WebSocket, `/e/` → Plugin Daemon, `/` → Web | **yes** |
| Web | `dify-web:1.17.1` | Console and published web apps | no |
| API | `dify-api:1.17.1` | REST API, runs DB migrations | no |
| API WebSocket | `dify-api:1.17.1` | Real-time collaborative editing | no |
| Worker | `dify-api:1.17.1` | Celery: indexing, workflows, mail, plugins | no |
| Worker Beat | `dify-api:1.17.1` | Celery beat: scheduled tasks and triggers | no |
| Plugin Daemon | `dify-plugin-daemon:0.6.10-local` | Installs and runs plugins (volume) | no |
| Sandbox | `dify-sandbox:0.2.15` | Executes Code nodes (volume for extra packages) | no |
| SSRF Proxy | Squid (repo build) | Egress filter blocking private networks | no |
| Agent Backend | `dify-agent-backend:1.17.1` | Agent run orchestration | no |
| Agent Sandbox | `dify-agent-local-sandbox:1.17.1` (repo build) | Agent shell workspaces and home snapshots (volume) | no |
| Agent SSRF Proxy | Squid (repo build) | Egress filter for the agent sandbox | no |
| Weaviate | `weaviate:1.39.11` | Vector store (volume) | no |
| Postgres / Redis | Railway base images | Metadata / queues and cache | no |
| Bucket | Railway Bucket | Uploaded files and generated assets | — |

**First login**

1. Wait until API logs show the migrations finished (1–3 minutes on first boot).
2. Open the Gateway URL and go to `/install`. Dify asks for the init password: copy `INIT_PASSWORD` from the **API** service variables.
3. Create the owner account, then add a model provider under *Settings → Model Provider* (installs a plugin from the Dify marketplace).

**Custom domain:** add it to the **Gateway** service, then set `DIFY_PUBLIC_URL` on **API** to `https://your.domain` and `NEXT_PUBLIC_SOCKET_URL` on **Web** to `wss://your.domain`, and redeploy.

**Email (optional):** set `MAIL_TYPE` (`smtp` or `resend`), `MAIL_DEFAULT_SEND_FROM` and the SMTP or Resend variables on API, Worker and Worker Beat to enable invitations and password resets.

**Scaling workers:** increase replicas on **Worker** (stateless) or raise `CELERY_WORKER_AMOUNT`. Keep **Worker Beat** at one replica. For more API throughput raise `SERVER_WORKER_AMOUNT` on API. Keep total database connections below Postgres' limit of 100.

**Pinning and upgrading:** every image is pinned. To upgrade, read the Dify release notes, then change all `1.17.1` tags together (API, API WebSocket, Worker, Worker Beat, Web, Agent Backend and the Agent Sandbox Dockerfile) and update Plugin Daemon, Sandbox and Weaviate to the tags in that release's `docker/docker-compose.yaml`. The API service applies database migrations on start. Back up Postgres (and the Weaviate volume) before major upgrades.

**License note:** Dify is distributed under the Dify Open Source License (Apache 2.0 with additional conditions). Running it for your own organisation is permitted; operating it as a multi-tenant service for third parties, or removing Dify's logo/copyright from the console, requires a commercial license from LangGenius. This is a community template and is not affiliated with LangGenius.

### Why Deploy Dify on Railway?

Railway runs all fifteen Dify services in one project with private networking, managed TLS, persistent volumes and an S3-compatible bucket, so you get a production-shaped Dify without maintaining servers or Docker Compose. Scale workers with a slider, roll back a deploy in one click, and pay for the resources the stack actually uses.


## Similar templates

- [Chat Chat](https://railway.com/deploy/-WWW5r) — Chat Chat, your own unified chat and search to AI platform.
- [stella](https://railway.com/deploy/stella) — Self-host stella with web, API, Postgres, Redis, and object storage.
- [Hermes Agent | OpenClaw Alternative with Dashboard](https://railway.com/deploy/hermes-agent-or-openclaw-alternative-wit) — Self-Hosted Hermes AI Agent for Telegram, Discord & Slack

Open this page in a browser: https://railway.com/deploy/dify-v1-ai-app-studio
