---
title: "Deploy dify-template"
description: "Dify 1.17.1: pinned images, one domain, Worker, Beat, Sandbox, Weaviate"
category: "AI/ML"
url: https://railway.com/deploy/dify-template
---

# Deploy dify-template

Dify 1.17.1: pinned images, one domain, Worker, Beat, Sandbox, Weaviate

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

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

- **Creator:** Yesset's Projects
- **Category:** AI/ML

## Template content

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

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

### Redis https://devicons.railway.app/i/redis.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"`

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

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

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

- **Image:** langgenius/dify-plugin-daemon:0.6.10-local
- **Public domain:** Yes

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

- **Image:** langgenius/dify-web:1.17.1
- **Public domain:** Yes

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

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

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

- **Image:** langgenius/dify-sandbox:0.2.15

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

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

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

- **Image:** caddy:2.11.7-alpine
- **Start command:** `/bin/sh -c 'printf "%s" "$CADDYFILE" > /etc/caddy/Caddyfile && exec caddy run --config /etc/caddy/Caddyfile --adapter caddyfile'`
- **Public domain:** Yes

### Weaviate https://weaviate.io/img/site/weaviate-logo-light.png

- **Image:** semitechnologies/weaviate:1.39.2
- **Start command:** `/bin/weaviate --host :: --port 8080 --scheme http`

### Storage https://devicons.railway.app/i/minio.svg

- **Image:** pgsty/minio:RELEASE.2026-08-04T00-00-00Z
- **Start command:** `/bin/sh -c "exec minio server --address [::]:9000 $RAILWAY_VOLUME_MOUNT_PATH"`

## Documentation

# Deploy and Host Dify on Railway

Dify is an open-source platform for building LLM apps: visual workflows, chatbots, agents, RAG knowledge bases and a plugin marketplace. This template deploys the full self-hosted Dify 1.17.1 stack from the official docker-compose, with every image pinned to the matching release.

## About Hosting Dify

Dify is several cooperating services, not one container. This template runs 11 of them, already wired together over Railway's private network:

- **Gateway** (Caddy): one public URL serves the web UI and every API, like Dify's official nginx. Console login works on the default Railway domain because session and CSRF cookies stay on one origin.
- **Api + Worker + Beat** (dify-api 1.17.1): migrations run automatically, a separate Celery worker handles indexing and workflows, Celery beat runs scheduled triggers and periodic jobs.
- **Web** (dify-web 1.17.1), **Sandbox** (0.2.15) for Python / Node.js code nodes, **Plugin Daemon** (0.6.10) with a persistent volume.
- **Weaviate 1.39.2** vector store with API-key auth.
- **MinIO** S3 storage on the private network only; Dify creates the bucket on first start (maintained `pgsty/minio` image, since upstream `minio/minio` tags are no longer pullable).
- **Postgres 18** and **Redis 8.2** with persistent volumes.

## Why Deploy Dify on Railway?

All versions are pinned and matched (no `latest` / `main`). Worker and Beat run as separate services. Services talk over the private network only. Every secret is generated at deploy time, and keys that must match between services are wired by reference. The setup page is protected by a generated `INIT_PASSWORD`.

## Common Use Cases

- A private LLM app builder for a team: chatbots, agents and workflows on your own infrastructure.
- RAG over your own documents with a persistent vector store.
- Prototyping with marketplace plugins (model providers, tools) that survive redeploys.

## Dependencies for Dify Hosting

### Deployment Dependencies

- Dify: https://docs.dify.ai
- Official docker-compose the template follows: https://github.com/langgenius/dify/tree/main/docker
- An API key for at least one model provider (OpenAI, Anthropic, ...), added after deploy.

### After deploying

Open the Gateway URL, go to `/install`, enter `INIT_PASSWORD` (from the Api service variables) and create your admin account. Then add model providers from the Plugins page. Nothing is required before deploy. Generated: `INIT_PASSWORD`, `SECRET_KEY` (never change it after first start), plugin, sandbox, Weaviate and MinIO keys, database passwords. Optional: `MAIL_TYPE` / `SMTP_*` (or `RESEND_API_KEY`) on Api and Worker for invitations and password reset. For a custom domain, add it to Gateway and update the `*_URL` variables.


## 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-template
