Excuse me, I’d like to ask, what are the basic configuration requirements if I want to git clone the source code on a local server, then use Docker to set up a complete Dify instance, and reference all resources within docker-compose.yaml?
Where did you download the source code from? It’s explained above, please check again.
@Dify_Forum_Helper help
Hello! To deploy a complete Dify locally from source code and Docker Compose, although the official documentation doesn’t provide a strict “minimum configuration table,” based on community experience and the actual consumption of container components, here are the recommended configuration requirements:
Basic Configuration Requirements
Since Dify’s docker-compose.yaml will simultaneously start about 9 containers (including API, Worker, Frontend, PostgreSQL, Redis, Weaviate/Qdrant vector database, Sandbox, etc.), it has certain memory requirements.
- CPU: Recommended 2 vCPU or more (4 vCPU recommended for better performance).
- Memory (RAM):
- Minimum startup: 4 GB (may be sluggish and prone to OOM (Out Of Memory) errors).
- Recommended configuration: 8 GB or more (to ensure stable operation of PostgreSQL and the vector database, especially when uploading documents for indexing).
- Disk Space: Recommended to reserve 30 GB - 50 GB or more (for storing Docker images, logs, database data, and uploaded files).
Software Environment Requirements
- Operating System: Linux (Ubuntu 20.04/22.04, etc.), macOS, or Windows (WSL2).
- Docker: Recommended to install the latest version of Docker Desktop or Docker Engine.
- Docker Compose: Recommended to use Docker Compose V2.
Why are these resources needed?
A complete deployment includes the following main components, all of which consume resources:
- Web & API: Python (Flask) application, handles requests.
- Worker: Asynchronous task queue, handles complex Agent inference and file parsing.
- PostgreSQL: Stores business data.
- Redis: Caching and session storage.
- Weaviate/Qdrant: Vector database (this is often a major memory consumer, especially as the knowledge base data grows).
- Sandbox: Code execution sandbox.
If your server resources are limited, you can consider modifying the configuration in docker-compose.yaml or reducing the number of Worker replicas (the default configuration is usually already very lean).
Related Documentation:
Hope this helps you!