Skip to main content

Requirements

This requirement can support up to 3000 active users daily. If you have more users, you can scale resources as needed, or refer to our Performance Tuning documentation.
  • Kubernetes Cluster
    • 6 Worker Nodes: 8 CPU, 32 GB RAM each
  • Container Registry (Plugins)
    • AWS ECR (with AK/SK or IRSA) / Azure ACR / Aliyun ACR (with AK/SK) / Tencent TCR (with AK/SK) / Dockerhub / Google Artifact Registry
  • Persistent Storage
    • S3 / AWS S3 (with AK/SK or IRSA) / Azure Blob / Aliyun OSS (with AK/SK) / Tencent COS (with AK/SK) / Google GCS
    • 512 GB Storage
  • Postgres Database
    • Version 14+
    • 8 CPU, 16 GB RAM
    • At least 512G SSD
  • Redis Database
    • Version 6+
    • 2 GB RAM
  • Vector Database VM - Qdrant Cluster
    • 3 VMs
    • 8 CPU, 64 GB RAM
    • 100 GB Storage

Dify Service Resource limits

workerBeat should always run as a single replica.
ServicesReplicasCPURAM - GBTotal CPUTotal RAM - GB
api3310930
worker3210630
workerBeat11111
web31133
sandbox31236
enterprise31236
enterpriseAudit31236
enterpriseFrontend31133
enterpriseCollector11111
ssrfProxy31133
unstructured31236
plugin_daemon31339
plugin_controller31236
plugin_connector31236
plugin_manager31236
gateway31236
minio11212
Total53129

Deployment

1. Get Helm Repository Info

helm repo add dify https://langgenius.github.io/dify-helm
helm repo update
For more information, please refer to Dify Helm Chart.

2. Save Helm Chart Values

  • Save Helm chart values to a file named values.yaml.
  • Update the values.yaml file with your configuration.
  • Please replace the #REPLACE_ME# placeholder with your actual values.
  • Please replace “dify123456” with your own value.
  • global.appSecretKey and enterprise.appSecretKey must be different.
###################################
# Please replace "dify123456" with your own value
###################################
global:
  appSecretKey: 'dify123456'
  innerApiKey: 'dify123456'
  consoleApiDomain: "console.dify.local"
  consoleWebDomain: "console.dify.local"
  serviceApiDomain: "api.dify.local"
  appApiDomain: "app.dify.local"
  appWebDomain: "app.dify.local"
  filesDomain: "upload.dify.local"
  enterpriseDomain: "enterprise.dify.local"

ingress:
  enabled: true
  className: "nginx"
  annotations: {
    # set file upload size limit
    nginx.ingress.kubernetes.io/proxy-body-size: "15m"
  }

api:
  replicas: 3
  serverWorkerAmount: 1
  resources:
    limits:
      cpu: 3000m
      memory: 10240Mi
    requests:
      cpu: 1500m
      memory: 5120Mi
worker:
  replicas: 3
  celeryWorkerAmount: 1
  resources:
    limits:
      cpu: 2000m
      memory: 10240Mi
    requests:
      cpu: 1000m
      memory: 5120Mi
workerBeat:
  resources:
    limits:
      cpu: 1000m
      memory: 1024Mi
    requests:
      cpu: 500m
      memory: 512Mi
web:
  replicas: 3
  resources:
    limits:
      cpu: 1000m
      memory: 1024Mi
    requests:
      cpu: 500m
      memory: 512Mi
sandbox:
  replicas: 3
  resources:
    limits:
      cpu: 1000m
      memory: 2048Mi
    requests:
      cpu: 500m
      memory: 1024Mi
enterprise:
  replicas: 3
  appSecretKey: "dify123456"
  adminAPIsSecretKeySalt: "dify123456"
  passwordEncryptionKey: "dify123456"
  resources:
    limits:
      cpu: 1000m
      memory: 2048Mi
    requests:
      cpu: 500m
      memory: 1024Mi
enterpriseAudit:
  replicas: 3
  resources:
    limits:
      cpu: 1000m
      memory: 2048Mi
    requests:
      cpu: 500m
      memory: 1024Mi
enterpriseFrontend:
  replicas: 3
  resources:
    limits:
      cpu: 1000m
      memory: 1024Mi
    requests:
      cpu: 500m
      memory: 512Mi
ssrfProxy:
  replicas: 3
  resources:
    limits:
      cpu: 1000m
      memory: 1024Mi
    requests:
      cpu: 500m
      memory: 512Mi
unstructured:
  replicas: 3
  resources:
    limits:
      cpu: 1000m
      memory: 2048Mi
    requests:
      cpu: 500m
      memory: 1024Mi
plugin_daemon:
  replicas: 3
  resources:
    limits:
      cpu: 1000m
      memory: 3072Mi
    requests:
      cpu: 500m
      memory: 1536Mi
plugin_controller:
  replicas: 3
  resources:
    limits:
      cpu: 1000m
      memory: 2048Mi
    requests:
      cpu: 500m
      memory: 1024Mi
plugin_connector:
  replicas: 3
  resources:
    limits:
      cpu: 1000m
      memory: 2048Mi
    requests:
      cpu: 500m
      memory: 1024Mi
plugin_manager:
  replicas: 3
  resources:
    limits:
      cpu: 1000m
      memory: 2048Mi
    requests:
      cpu: 500m
      memory: 1024Mi
gateway:
  replicas: 3
  resources:
    limits:
      cpu: 1000m
      memory: 2048Mi
    requests:
      cpu: 500m
      memory: 1024Mi
minio:
  replicas: 1
  resources:
    limits:
      cpu: 1000m
      memory: 2048Mi
    requests:
      cpu: 500m
      memory: 1024Mi

###################################
# Persistence Configration
###################################
persistence:
  type: "s3"
  s3:
    endpoint: "https://xxx.r2.cloudflarestorage.com"
    accessKey: "#REPLACE_ME#"
    secretKey: "#REPLACE_ME#"
    region: "us-east-1"
    bucketName: "your-bucket-name"
    addressType: ""
    useAwsManagedIam: false
    useAwsS3: true

###################################
# External database (Postgres/MySQL/TiDB)
###################################
externalDatabase:
  enabled: false
  # postgres | mysql | tidb
  engine: "postgres"
  host: "localhost"
  # Default ports: postgres=5432, mysql=3306, tidb=4000
  # Note: when switching engine, remember to update port accordingly
  port: 5432
  user: "postgres"
  password: "#REPLACE_ME#"
  timezone: "UTC"
  databases:
    dify: "dify"
    plugin_daemon: "dify_plugin_daemon"
    enterprise: "enterprise"
    audit: "audit"
  dialectOptions:
    postgres:
      sslMode: "require"
      uriScheme: "postgresql"
      # extras: "options=-c search_path=your-schema -c your-other-option=xxx"
      extras: ""
    mysql:
      # MySQL/TiDB params, e.g. charset=utf8mb4&parseTime=true&loc=UTC
      params: "charset=utf8mb4&parseTime=true&loc=UTC"
      tls: false

###################################
# External Redis
###################################
externalRedis:
  enabled: true
  host: "#REPLACE_ME#"
  port: 6379
  username: ""
  password: "#REPLACE_ME#"
  useSSL: false

###################################
# External Qdrant
###################################
vectorDB:
  useExternal: true
  externalType: "qdrant"
  externalQdrant:
    endpoint: "http://your-qdrant-cluster-url.qdrant.tech/"
    apiKey: "#REPLACE_ME#"

imagePullSecrets: []

3. Configure Container Registry

4. Configure Persistence Storage

5. Configure External Database

6. Configure External Redis

7. Configure External Qdrant

8. Configure Ingress Controller

9. Install Dify Helm Chart

helm upgrade -i dify -f values.yaml dify/dify

10. Verify Installation Results

Advanced Configuration

1. Domain and SSL Certificate

2. Email Service Provider

3. Performance Tuning