---
title: "Deploy Dify 1.19"
description: "Self-hosted Dify AI app builder: full stack, pgvector, secure setup"
category: "AI/ML"
url: https://railway.com/deploy/dify-119-1
---

# Deploy Dify 1.19

Self-hosted Dify AI app builder: full stack, pgvector, secure setup

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

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

- **Creator:** My Projects
- **Category:** AI/ML

## Template content

### dify-plugin-daemon https://cdn.jsdelivr.net/gh/selfhst/icons/svg/dify.svg

- **Image:** langgenius/dify-plugin-daemon:0.6.14-local

### dify-beat https://cdn.jsdelivr.net/gh/selfhst/icons/svg/dify.svg

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

### dify-api https://cdn.jsdelivr.net/gh/selfhst/icons/svg/dify.svg

- **Image:** langgenius/dify-api:1.19.0
- **Start command:** `/bin/bash -c "printenv DIFY_SETUP_PY > /tmp/dify_setup.py && (python /tmp/dify_setup.py &) && exec /bin/bash /entrypoint.sh"`
- **Health check:** /health

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

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

### Dify Vector https://devicons.railway.app/i/postgresql.svg

- **Image:** pgvector/pgvector:0.8.7-pg16

### dify-ssrf-proxy https://cdn.jsdelivr.net/gh/selfhst/icons/svg/dify.svg

- **Image:** ubuntu/squid:6.6-24.04_beta
- **Start command:** `/bin/sh -c "printenv SQUID_CONFIG > /etc/squid/squid.conf && exec squid -N -f /etc/squid/squid.conf"`

### dify-sandbox https://cdn.jsdelivr.net/gh/selfhst/icons/svg/dify.svg

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

### dify-worker https://cdn.jsdelivr.net/gh/selfhst/icons/svg/dify.svg

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

### Dify Redis https://devicons.railway.app/i/redis.svg

- **Image:** redis:8.10
- **Start command:** `/bin/sh -c "rm -rf $RAILWAY_VOLUME_MOUNT_PATH/lost+found/ && exec docker-entrypoint.sh redis-server --requirepass $REDIS_PASSWORD --appendonly yes --maxmemory-policy noeviction --dir $RAILWAY_VOLUME_MOUNT_PATH"`

### dify-web https://cdn.jsdelivr.net/gh/selfhst/icons/svg/dify.svg

- **Image:** langgenius/dify-web:1.19.0
- **Health check:** /favicon.ico

### Dify https://cdn.jsdelivr.net/gh/selfhst/icons/svg/dify.svg

- **Image:** nginx:1.30.6-alpine
- **Start command:** `/bin/sh -c "printenv GATEWAY_START_SH > /tmp/start.sh && exec sh /tmp/start.sh"`
- **Health check:** /health
- **Public domain:** Yes

## Buckets

- **Bucket**

## Documentation

# Deploy and Host Dify on Railway

Dify is an open-source platform for building LLM apps: chatflows, agents, workflows and knowledge bases (RAG) in a visual editor, with 100+ model providers and a plugin marketplace. Every app you publish gets a web app and a REST API.

## About Hosting Dify

Self-hosted Dify is several services: the API, a Celery worker and a scheduler, the web console, a code sandbox for Code nodes, a plugin daemon for model providers and tools, an outbound SSRF proxy, PostgreSQL, Redis, a vector store and file storage. The console needs the UI and the API on one origin for its login cookies.

This template deploys the whole stack on Railway's private network, behind one public gateway. The admin account is created at deploy time, so nobody else can claim a fresh instance.

## Common Use Cases

- Customer support chatbots that answer from your documents (RAG)
- AI agents with tools, HTTP calls and Python code
- Workflow automation with LLM steps, exposed as a REST API
- Internal assistants for your team's knowledge base
- Prototyping LLM apps across OpenAI, Anthropic, Gemini, Ollama and other providers

## Dependencies for Dify Hosting

- PostgreSQL 18 (Dify data) and pgvector (knowledge bases)
- Redis 8 (cache, sessions, Celery queue)
- A Railway Bucket for files
- An LLM provider API key (OpenAI, Anthropic, Gemini, OpenRouter, ...), added in Dify after deploy

### Deployment Dependencies

- Dify: https://github.com/langgenius/dify
- Dify docs: https://docs.dify.ai

### Implementation Details

**What you set:** `ADMIN_EMAIL` on the `Dify` service, the email you log in with.

**After deploy:**

1. Open the `Dify` URL and log in with `ADMIN_EMAIL` and the generated `ADMIN_PASSWORD` (variables of the `Dify` service). Change the password in Dify under Account.
2. In **Settings, Model Provider**, install a model provider and paste its API key.
3. Build a Workflow, Chatflow, Chatbot or Agent and publish it.
4. Create an API key under **API Access** (`app-...`) and call `https://your-dify-domain/v1/chat-messages` or `/v1/workflows/run` with `Authorization: Bearer app-YOUR_KEY`.

**This template:**

- Pins Dify 1.19.0 with the sandbox (0.2.15) and plugin daemon (0.6.14) versions upstream pins, PostgreSQL 18, pgvector 0.8.7 and Redis 8.10
- Creates the admin account at deploy time and guards `/install` with a generated init password
- Includes the full upstream stack: API, worker, scheduler (beat), web, sandbox, plugin daemon with a volume, and the SSRF proxy that keeps HTTP nodes away from private addresses
- Uses pgvector and a Railway Bucket instead of Weaviate and MinIO (MinIO is archived upstream)
- Serves the console and APIs from one public gateway, so login cookies work
- Generates every internal key that upstream ships with a fixed default
- Keeps workers, sandbox, plugin daemon, databases and Redis private; only the gateway is public, behind the Dify login
- Turns off Dify's anonymous telemetry

**Resources:** eleven services, about 3 GB of RAM in total when idle.

**Notes:** The Agent V2 backend and the collaboration websocket (new in Dify 1.19) are not included; classic agents, chatflows, workflows and knowledge bases work without them. Dify's license is based on Apache 2.0 with conditions: no multi-tenant SaaS without a commercial license, and the Dify logo stays in the console. You are responsible for complying with it.

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


## 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/dify-119-1
