Getting Started with Dify: A Complete Guide to Deployment, Configuration, and Workflow Practice

A complete guide to Dify: deployment, model integration, workflow nodes, and app publishing.
This guide walks through Dify, the low-barrier AI application platform: its three deployment methods (Docker, source, online), five core application types, workflow node system, large model integration, and three ways to publish your apps—helping you build AI applications fast.
What Is Dify: A Low-Barrier AI Application Building Platform
Dify is an open-source AI application building platform whose core value lies in enabling developers—and even users with zero experience—to quickly build various types of AI applications. Whether you're building a complex enterprise-grade system or a lightweight personal tool, you can accomplish it on this platform.
Dify is built on the concept of LLMOps (Large Language Model Operations) and is a typical representative of the current "low-code/no-code" trend in AI application development. To understand the value of LLMOps, we need to start with its predecessor, MLOps: MLOps (Machine Learning Operations) is a methodology that introduces DevOps engineering practices into the machine learning field, addressing engineering challenges such as model training, version management, deployment, and performance monitoring. With the rise of large language models, traditional MLOps frameworks could not cover the engineering challenges unique to large models—for example, prompts themselves are a kind of "software asset" that requires version management, model hallucinations require dedicated evaluation mechanisms, inference API call costs require fine-grained tracking, and the API specifications of different model providers vary widely. LLMOps was born to solve these problems unique to the era of large models, focusing on full-lifecycle management such as prompt version control, model switching, inference cost control, and output quality evaluation. Dify packages these capabilities into platform-level features, allowing teams to enjoy complete LLMOps capabilities without building the underlying infrastructure themselves.
Under the hood, it connects to various large model APIs through a unified model abstraction layer and implements knowledge base capabilities with the help of components such as a RAG (Retrieval-Augmented Generation) pipeline and vector databases. RAG is a core technical paradigm for addressing the knowledge limitations of large models—the knowledge of large language models is fixed within their training parameters, which presents two inherent flaws: first, the knowledge has a training cutoff date, so the model cannot know about events that occurred after training; second, it cannot directly access an enterprise's private data. The principle of RAG (Retrieval-Augmented Generation) is that before generating an answer, it first retrieves the document fragments most semantically relevant to the question from an external knowledge base via vector similarity search, and injects these fragments into the prompt context as "reference material," enabling the model to answer based on real-time, private domain knowledge. This paradigm effectively remedies the two flaws mentioned above, and it is far cheaper than fine-tuning—fine-tuning requires preparing large amounts of labeled data and consuming substantial GPU compute, whereas RAG only requires maintaining a continuously updatable knowledge base. This suite of components gives the entire platform a complete capability chain from prototype validation to production deployment.
The core storage component supporting RAG knowledge retrieval is the vector database. After text is encoded by an embedding model (such as OpenAI's text-embedding series, or open-source models like BGE and E5), it is converted into a floating-point vector of hundreds to thousands of dimensions. The physical significance of this process is that semantically similar text is also geometrically close in the high-dimensional vector space—the vector distance between "apple" and "fruit" would be far smaller than the distance between "apple" and "car." Vector databases use ANN (Approximate Nearest Neighbor) algorithms (such as the HNSW graph index algorithm, IVF inverted file index, etc.) to achieve millisecond-level semantic similarity retrieval across massive numbers of vectors, and their retrieval capability far surpasses the keyword matching of traditional full-text search—the latter can only find documents containing the same words, while vector retrieval can find content that is semantically similar but uses different wording. Dify supports mainstream vector databases such as Weaviate, Qdrant, Milvus, and Chroma, with default integration solutions ready to use out of the box.
For teams and individuals who want to quickly validate AI application ideas without writing large amounts of underlying code from scratch, Dify dramatically lowers the barrier to building. It packages capabilities such as large model calls, workflow orchestration, and tool integration into visual modules, making "building an AI application" as intuitive as assembling building blocks.
This article is compiled and integrated based on the systematic teaching content of a Bilibili content creator, to help you understand Dify's deployment methods, core application types, and practical paths from a holistic perspective.
Three Deployment Methods: Choose According to Your Needs
Dify's deployment solutions are quite flexible, offering three paths for users with different needs.
Official Online Version
The simplest way to get started is to use the official online version directly. Its interface is almost identical to the locally deployed version. Note that if the AI application you build needs to access a local database or local environment, you'll need to use an intranet penetration tool to expose your local IP to the public internet, so that the online service can access local resources.
Intranet penetration refers to the technique of exposing services within a local area network to the public internet through relaying via an intermediary server. To understand why it's necessary, you need to understand the basic structure of home/enterprise networks: most users are in a NAT (Network Address Translation) environment, where the local IP is a private LAN address (such as 192.168.x.x) that the public internet cannot access directly. The principle of intranet penetration tools (common ones include frp, ngrok, Oray/花生壳, Cloudflare Tunnel, etc.) is: a client runs on the local machine and proactively establishes a persistent tunnel connection to a public server; when external requests reach the public server, they are forwarded through this tunnel to the local service, and the response is returned along the same path. Throughout this process, the local machine remains in an "active connection" state, bypassing NAT restrictions. For scenarios requiring access to local resources, intranet penetration is a key network infrastructure component.
Source Code Deployment
Suitable for developers who want deep customization; you can perform secondary development directly based on the source code, offering the highest flexibility.
Docker Deployment (Recommended for Production)
The tutorial focuses on demonstrating a deployment solution based on Windows Docker. Docker is a containerization technology that packages an application and its dependencies into an independent image, achieving "build once, run anywhere." Docker was developed in 2013 by Solomon Hykes on the basis of an internal project at dotCloud, and quickly became the de facto standard for containerization technology. The fundamental difference from virtual machines (VMs) lies in the isolation level: a VM simulates a complete hardware environment through a hypervisor, with each VM running an independent OS kernel, leading to high resource overhead and slow startup (typically tens of seconds to several minutes); whereas a Docker container directly shares the host's Linux kernel (implemented via WSL2 on Windows), using Linux's Namespace and Cgroups mechanisms to achieve process isolation and resource limits. As a result, container startup speed can reach the second or even millisecond level, and image size is far smaller than that of VM images.
Dify's Docker deployment typically uses docker-compose to orchestrate multiple service containers. docker-compose is Docker's official multi-container orchestration tool, which defines multiple services along with their dependencies, networks, data volumes, etc., through a single YAML configuration file, allowing the entire application stack to be launched with a single command. A complete Dify deployment requires the collaboration of multiple services: the web frontend, API service, Celery Worker (asynchronous task processing), PostgreSQL (the main database, storing application configurations and user data), Redis (caching and message queue), a vector database, and more. docker-compose is precisely the ideal tool for managing such complex multi-service dependencies. This is also why its network interconnectivity is strong—the bridge network Docker creates by default allows free communication between containers and between containers and the host, so Dify containers can communicate normally with a local MySQL instance, or even with an environment inside a VMware virtual machine on the Windows node.

In production scenarios, it's recommended to deploy Dify on your own local machine—for internal company applications, this is more controllable and secure. This is especially critical for enterprise scenarios that require data security and intranet isolation.
Why You Need to Install MySQL Alongside
The tutorial specifically arranges a step for installing MySQL 8 on Windows, for a clear reason: some of the AI applications built in Dify later on need to interact with a database, reading business data to complete AI tasks.
MySQL's deployment location is very flexible, supporting the following three methods:
- Install directly on the Windows system
- Deploy based on a Docker container
- Deploy inside a VMware virtual machine
Because Docker has good network interconnectivity, no matter where MySQL is deployed, Dify can connect to it normally. Once the corresponding connection configuration is complete, you can open up the core link of "AI applications reading business data"—this is also the infrastructure prerequisite for building enterprise-grade AI applications (such as scenarios like intelligent Q&A based on business data, report analysis, etc.).
Dify's Five Core Application Types
This is the most important part of the entire platform. When creating an application in Dify, there are mainly the following five types to choose from:

Basic Applications
Chat Assistant: The simplest and most direct application form, i.e., multi-turn conversational interaction with an AI model.
Text Generation: Lets the AI generate articles, documents, stories, and other content in one go, suitable for batch content creation scenarios.
Agent: Fundamentally different from the previous two. To understand the working mechanism of an Agent, we need to start with its theoretical foundation. The ReAct (Reasoning + Acting) framework proposed by Google Research in 2022 is an important theoretical foundation of modern AI agents—ReAct enables the model to alternately generate "Thought" and "Action" steps when solving a problem: it first reasons about what needs to be done in the current state, then executes the corresponding action (such as calling a tool), observes the result, and then enters the next round of thinking, forming a "Thought → Action → Observation" loop until the task is complete. This paradigm gives the model the ability to solve multi-step, complex tasks. At the engineering implementation level, OpenAI's Function Calling and Anthropic's Tool Use mechanisms standardize tool-calling capabilities: developers provide the model with structured descriptions of tools (name, parameters, purpose), and during reasoning, the model can output—in structured JSON format—"which tool I need to call and what parameters to pass in." After the system executes it, the result is returned to the model, which continues to reason based on the result. This mechanism upgrades tool calling from a "prompt engineering trick" to a "protocol-level capability." In Dify, the Agent calls external tools through these mechanisms; in essence, the model dynamically decides which tools to call and in what order during reasoning. The biggest characteristic of an Agent is that it can call tools, systematically combining multiple tools to complete complex instructions. For example, first crawling web page content, then analyzing and summarizing it—these multi-step tasks that require tool collaboration are exactly where the Agent shines.

Workflow Applications
Beyond the three basic applications, Dify also provides an important workflow application type, which comes in two forms:
- Chatflow: Supports multi-turn conversational interaction with the workflow, suitable for scenarios requiring ongoing communication
- Workflow: Performs a single call and outputs a result, suitable for batch processing tasks with fixed procedures
The design of Dify's workflows draws on the ideas of Dataflow Programming. This programming paradigm originated from research at MIT in the 1970s, and its core idea is to express a program as a directed graph—nodes represent computation units, edges represent the data flow path, and a node is automatically triggered to execute when all its input data is ready, naturally supporting parallel processing. In Dify's implementation, each node encapsulates a specific function (such as HTTP requests, code execution, LLM calls, knowledge base retrieval, etc.), and variables are passed between nodes through data pipelines. Complex RAG processes (such as document chunking → vectorization → retrieval → reranking → generation) can be visually decomposed and debugged, with the input and output of each stage clearly visible. The core difference between the two lies in the interaction mode: Chatflow leans toward conversational interaction, while Workflow leans toward one-off task processing.
Workflow Nodes: The Basic Units for Building Processes
When building Chatflows and Workflows, you need to combine functional modules one by one into a complete process; these modules are called nodes.
Nodes are a key concept for understanding and using Dify workflows. Dify's node system covers all the fundamental capabilities needed to build production-grade AI processes. From a functional dimension, they can be divided into several major categories: model interaction (LLM call nodes, supporting multi-turn conversation context management), knowledge retrieval (knowledge base retrieval nodes, encapsulating the full process of vector retrieval and reranking), external integration (HTTP request nodes, which can connect to any REST API; code execution nodes, supporting Python/JavaScript custom logic run in a sandbox), flow control (conditional judgment nodes for branch routing; iteration nodes for looping over list data; variable aggregation nodes for merging outputs from multiple paths), and tool calling (calling Dify's built-in or custom tools directly within the workflow). The tutorial covers the most commonly used node types, and it's said that these nodes cover most of the nodes provided on Dify's official website, with each node explanation accompanied by detailed hands-on cases—the workflow node section alone plans for over a dozen hands-on exercises.
This combined learning approach of "node explanation + hands-on cases" helps beginners translate abstract process orchestration concepts into concrete operations, effectively improving the speed of getting started.
Integrating Large Models: Choosing the Right Model Makes Things Easier
All AI applications need to interact with a large model, so integrating a large model is the first step in using Dify, and it's also a key factor affecting the application's effectiveness.
It's recommended to use paid external models, such as DeepSeek, ChatGPT, etc. In addition, platforms like Baidu's Ernie Bot and Alibaba's Tongyi Qianwen typically offer a million-level free token quota after registration, which is sufficient for exploration and testing during the learning phase.
Regarding the concept of Token, it's worth understanding in depth: a token is the basic unit through which large models process text, and its essence is the product of a tokenization algorithm. Mainstream large models use the BPE (Byte Pair Encoding) algorithm for tokenization—BPE was originally used for data compression, and after being introduced into NLP, its principle is to start from single characters and iteratively merge high-frequency character pairs into new subword units, ultimately forming a vocabulary that contains both common words and can cover rare words. This makes the granularity of a token fall between characters and words: a common English word usually corresponds to 1 token, while for Chinese, because the character set is larger, one Chinese character usually corresponds to about 1.5 tokens (i.e., about 100 Chinese characters consume 150 tokens). From a billing perspective, model APIs price input tokens (prompt + conversation history + retrieved context) and output tokens (the model's generated reply) separately, and the context window is also limited in units of token count for the total length that can be processed in a single request (e.g., GPT-4 Turbo supports a 128K token window, roughly equal to 300,000 Chinese characters). Understanding the token billing mechanism helps you reasonably design prompt length when building applications, control usage costs, and weigh the number and length of retrieved documents in RAG scenarios.

Regarding cost, you can rest assured: domestic models like DeepSeek are typically priced at just a few RMB per million tokens, an order of magnitude lower than the GPT-4 series—extremely inexpensive. In the tutorial's actual demonstration, 10 RMB was topped up, and after a long period of use, less than 1 RMB had been consumed.
Using a local small model on your own machine is not recommended: Although Dify supports integrating models deployed locally via Ollama, the models an ordinary machine can run have limited parameter counts (typically 7B to 13B parameter scale), and there is a significant gap compared to hundred-billion-parameter closed-source models across dimensions such as complex reasoning, long-text understanding, and instruction following, so the actual results are often unsatisfactory. Of course, if your equipment is powerful enough, or you have enterprise-grade cluster conditions capable of running open-source large models with hundreds of GB of parameters, local deployment can likewise build excellent enterprise-grade AI applications, with the security advantage of data never leaving the intranet.
Application Publishing: From Local to the Public Internet
Built Dify applications are not limited to local use; the platform provides three flexible publishing methods:
- Publish as a public web site: Generate a public access link and publish it to the public internet for others to use directly (local deployment requires coordination with intranet penetration)
- Embed into your own website: Integrate it into your developed website or product as an embedded component. Dify offers two embedding methods, iframe and Web Component; the former is simple and direct, while the latter can be more deeply integrated into the page style
- API calls: Call Dify application capabilities from other programs or systems through a standard REST API interface. Dify automatically generates complete API documentation for each application, supporting both streaming (SSE) and non-streaming response modes; the former can achieve real-time output with a typewriter effect
This diverse publishing capability makes Dify not just a prototype validation tool, but an AII application development platform that can truly be deployed in production environments. The three publishing methods correspond to different integration scenarios: web sites are suitable for quick sharing and demonstration, embedded components are suitable for productized integration, and API calls are suitable for being invoked by other systems as a backend service—this aligns with the software engineering idea of "interface-oriented programming," decoupling AI capabilities into independent microservices for upper-layer business systems to consume on demand, covering the complete application spectrum from personal tools to enterprise systems.
Summary: Suggested Learning Path for Dify
Dify organically integrates capabilities such as large model calls, tool integration, and workflow orchestration through a visual approach, dramatically lowering the barrier to AI application development. Its five application types—Chat Assistant, Text Generation, Agent, Chatflow, and Workflow—cover a wide range of scenarios from simple conversations to complex multi-step tasks.
For beginners, it's recommended to progress step by step along the following path:
- Complete Docker deployment and MySQL database configuration
- Integrate a cost-effective paid large model (such as DeepSeek)
- Start with basic applications like the Chat Assistant to familiarize yourself with platform operations
- Gradually transition to combining workflow nodes
- Master the application publishing methods, so that the AI applications you build can truly be put into practical use
Key Takeaways
Related articles

From Chat to Agent: Automating Your Entire Business Workflow with AI Agents
Veteran AI practitioner Remy breaks down the leap from chat models to AI agents: how agents work, the three pillars of context, tools, and skills, MCP connections, and hands-on architecture to make you a 100x employee.

Understand Anything: The AI Skill That Turns Code into Interactive Knowledge Graphs
Understand Anything is a high-star open-source GitHub skill that runs static analysis on any codebase and generates interactive knowledge graphs. It supports Claude Code, Cursor, Copilot and other agents, letting engineers ask questions in natural language with path references.

Kimi K3 Released: How a 2.8 Trillion Parameter Open Model Reshapes AI Cost-Effectiveness
Moonshot AI unveils Kimi K3: a 2.8 trillion parameter, 1M context, natively multimodal open model. With KDA architecture and ultra-low cost, it rivals GPT-5.6 and Fable 5, redefining AI cost-effectiveness.