Dify Local Deployment Tutorial: A Beginner's Guide Using Virtual Machine + BT Panel

A beginner-friendly guide to deploying Dify locally using VMware, Ubuntu, BT Panel, and Docker.
This tutorial walks you through deploying Dify — an open-source LLM application development platform — on your local machine. Using VMware to run Ubuntu, BT Panel for server management, and Docker for containerized deployment, even users with no Linux experience can complete the setup. The guide covers VM creation, Ubuntu installation, BT Panel configuration, Docker setup, and Dify initialization.
What Is Dify? Why Deploy It Locally?
Dify is an open-source large language model (LLM) application development platform that combines the concepts of Backend-as-a-Service (BaaS) and LLMOps, enabling developers to quickly build production-grade generative AI applications. Even non-technical users can participate in defining AI applications and managing data operations.
Backend-as-a-Service (BaaS) is a cloud computing service model that encapsulates server-side infrastructure (such as databases, user authentication, file storage, etc.) into ready-made APIs, so developers don't need to build and maintain backend servers themselves. LLMOps, inspired by the MLOps concept, is specifically designed for managing the full lifecycle of large language model applications, covering model selection, prompt engineering, evaluation, monitoring, cost control, and more. By combining these two approaches, Dify provides both out-of-the-box backend capabilities and a built-in toolchain for managing LLM applications from development to production.

Dify comes with the essential tech stack needed to build LLM applications and supports integration with hundreds of models, including Chinese models like ERNIE Bot, Doubao, Zhipu, Baichuan, Spark, and Qwen, as well as international models like OpenAI, Gemini, Claude, and other mainstream LLMs. It offers an intuitive prompt orchestration interface and a high-quality RAG engine (external knowledge base), significantly reducing the time cost of building from scratch.
RAG (Retrieval-Augmented Generation) is currently the mainstream technical approach for addressing LLM "hallucination" issues and knowledge timeliness problems. Its core principle works as follows: when a user asks a question, the system first retrieves relevant document fragments from an external knowledge base, then feeds these fragments as context along with the user's question into the LLM, allowing the model to generate answers based on real data. Dify's built-in RAG engine supports importing multiple document formats, automatic chunking, vectorized storage, and semantic retrieval. Users only need to upload documents to build a custom knowledge base — no need to understand the underlying Embedding models or vector database technical details.
Compared to development libraries like LangChain, if LangChain is a toolbox, then Dify is a complete scaffolding system — it not only provides tools but has also undergone engineering design and software testing, making it closer to a production-ready solution. LangChain is a Python/JavaScript development framework that provides various components for interacting with LLMs (such as chain calls, memory management, tool invocation, etc.), requiring developers to write code to assemble these components into applications and handle deployment, monitoring, and other engineering concerns on their own. Dify, on the other hand, includes built-in visual orchestration interfaces, user management, API gateways, log monitoring, and other production-grade features — developers can even build applications through drag-and-drop. The two are not mutually exclusive: LangChain is better suited for highly customized scenarios, while Dify has a clear efficiency advantage for quickly validating ideas or small-to-medium-scale production deployments. Most importantly, Dify is completely open-source and free, allowing developers to extend it as they see fit.
Overall Tutorial Architecture
This tutorial covers the complete workflow from local Dify deployment to application publishing, divided into seven parts:
- Understanding Dify — Learn about the platform's positioning and capabilities
- Local Deployment — Set up the runtime environment (the focus of this article)
- Building AI Applications — Create intelligent chatbots and Agent-based assistants
- Tool Usage — Configure and invoke external tools for AI applications
- Workflow Design — Design automated execution flows for specific scenarios
- Knowledge Base Integration — Attach enterprise product data as a RAG knowledge source
- Application Publishing — Publish as a web site or embed into existing systems via API
Preparing the Local Deployment Environment
Installing VMware Virtual Machine
This tutorial uses BT Panel (Baota Panel) for Dify deployment — the most beginner-friendly approach after evaluating multiple methods. You'll need two pieces of software:
- VMware Workstation (or VMware Player) — Virtualization software for running a Linux system
- Ubuntu 22.04 ISO image — The Linux operating system installation file
VMware Workstation is a desktop-level virtualization software that uses Hypervisor technology to create isolated virtual hardware environments on a physical host, allowing multiple operating systems to run simultaneously on a single computer. Each virtual machine has its own independent CPU, memory, disk, and network resource allocation, completely isolated from one another. This tutorial deploys in a virtual machine rather than directly on Windows for three main reasons: first, Dify's Docker deployment is more stable on Linux with better documentation support; second, the virtual machine provides sandbox isolation, so even if something goes wrong, it won't affect the host system; third, virtual machines can be snapshotted, cloned, and migrated at any time for easy backup and recovery.
When installing VMware, note: do not install it on the C: drive, as virtual machines generate large cache files during operation that can easily fill up the system drive. After installation, a VMware icon will appear on your desktop.
Creating and Installing the Ubuntu System
After opening VMware, follow these steps to create a virtual machine:
- Click "Create a New Virtual Machine"
- Select "I will install the operating system later"
- Choose Linux as the system type, with Ubuntu 64-bit as the version
- Set the virtual machine name and storage location (again, avoid the C: drive)
- Allocate 20GB of disk space (sufficient for Dify deployment only)
- Select "Split virtual disk into multiple files" and click Finish
After creation, you need to mount the Ubuntu ISO image: go to Virtual Machine Settings → CD/DVD → select "Use ISO image file" → browse and select the downloaded Ubuntu 22.04 ISO file.
After starting the virtual machine, select "Try or Install Ubuntu." On the installation screen, choose your preferred language, then select "Minimal installation" (if using it solely for Dify deployment). During installation, set a username and password (a simple password like 123456 is recommended, and enable auto-login). After installation completes, restart and remove the disc image.
BT Panel Installation and Configuration
Installing BT Linux Panel
BT Panel (Baota Panel) is a widely used server management tool in China that wraps common Linux system administration tasks (such as installing software, configuring firewalls, managing websites, viewing logs, monitoring resources, etc.) into a web-based graphical interface. For users unfamiliar with the Linux command line, BT Panel dramatically lowers the barrier to server management. In this tutorial's tech stack, BT Panel serves two main purposes: first, it provides one-click Docker installation and a visual management interface; second, it offers a one-click Dify deployment template that automatically handles downloading Docker Compose orchestration files and starting containers, simplifying what would otherwise be a dozen command-line steps into just a few mouse clicks.
In the Ubuntu system, open the terminal with the shortcut Ctrl+Alt+T, then execute the installation command copied from the BT Panel official website. The specific steps are: visit the BT Panel website → Products → BT Linux Panel → Install Free Version → select Ubuntu → copy the installation command.
Paste the command in the terminal and press Enter. Enter the system password (it won't be visible as you type — this is normal Linux behavior). Confirm installation to the default directory and wait for the process to complete.
Once installation finishes, the terminal will display panel login information, including the local network address, username, and password. Since this is a local deployment, you can access it directly using the local network address.
Optimizing BT Panel Configuration
After installation, it's recommended to modify the following settings for easier daily management:
- Port number: The default port is hard to remember; change it to something memorable like 8899
- Username and password: Run the
btcommand in the terminal to access the BT management tool and make changes - Security entry path: Change the default random string to a short, memorable path like
/backend
After making these changes, you can access the BT Panel at http://192.168.x.x:8899/backend.
Deploying Dify via Docker
Installing the Docker Environment
Find the "Docker" module in the left sidebar of the BT Panel, click install, select the default installation method, and wait for it to complete.
Docker is an OS-level virtualization technology that packages an application and all its dependencies (runtime environment, system libraries, configuration files, etc.) into a standardized "container" image. Unlike traditional virtual machines, Docker containers share the host machine's OS kernel, resulting in fast startup times (seconds) and low resource consumption. Dify uses Docker Compose for deployment, which means it encapsulates multiple services (such as the web frontend, API backend, PostgreSQL database, Redis cache, Weaviate vector database, etc.) into separate containers, with an orchestration file defining their network communication and dependency relationships. This microservices architecture ensures that each component can be independently upgraded and scaled, while also avoiding the classic "it works on my machine" environment inconsistency problem.
Pulling and Installing Dify
After Docker is installed, search for "Dify" in the Docker module and click install. If you encounter image pull failures, this is usually caused by network issues. Try one of the following solutions:
Option 1: Modify DNS Configuration
In the virtual machine terminal, execute:
sudo nano /etc/resolv.conf
Change the nameserver entries to:
nameserver 8.8.8.8
nameserver 8.8.4.4
Save the file and restart the BT Panel.
The addresses 8.8.8.8 and 8.8.4.4 are Google's public DNS servers. DNS (Domain Name System) is responsible for resolving domain names to IP addresses. When the default DNS server cannot correctly resolve the Docker image registry address, switching to a more reliable public DNS usually resolves the connection issue.
Option 2: Configure Docker Mirror Acceleration
Add mirror acceleration URLs in the Docker settings. The BT Panel help documentation provides several available acceleration links — try adding them one by one, then restart the Docker service. Docker mirror acceleration works by using domestic proxy servers to cache and forward images from Docker Hub, avoiding the network latency and connection failures caused by directly accessing overseas servers.
Completing Dify Deployment and Initialization
After successful installation, Dify will enter a running state. Change HTTPS to HTTP in the access URL, set the port to 8088, and append /install at the end to access Dify's initialization setup page. After setting up the admin email and username, your local Dify deployment is complete.
Summary: Anyone Can Deploy Dify Locally — No Prior Experience Required
With the VMware + Ubuntu + BT Panel + Docker combination, even users with no Linux administration experience can successfully complete a local Dify deployment. The core advantages of this approach are:
- Primarily GUI-based operations with minimal command-line usage
- BT Panel provides an intuitive server management interface
- Docker containerized deployment ensures environment isolation and consistency
Once deployment is complete, you can start building AI applications, configuring Agent-based assistants, designing workflows, integrating RAG knowledge bases, and ultimately publishing your applications as web sites or integrating them into existing business systems via API.
Key Takeaways
Related articles

Claude Code for Test Development in Practice: An AI Programming Workflow That Doubles Your Efficiency
A practical guide to Claude Code for test development: auto-generating test scripts, Plan Mode workflows, MCP + Playwright integration, and Subagent parallel tasks to build systematic AI-assisted workflows.

Hermes Agent Hands-On Review: An AI Efficiency Revolution for Indie Game Developers
Indie game developer reviews Hermes Agent vs OpenClaude: intelligent context compression, real-time Memory, remote control via Telegram, and practical use cases in game dev, social media, and email.

Vibe Coding Beginner's Guide: Tool Selection Across Three Categories with Practical Examples
A comprehensive guide to Vibe Coding's three tool categories: Agent frameworks, CLI Coding, and IDE tools, with practical examples including Snake game and data analysis workbench.