Dify
What This Article Covers
- What Dify is and what you can do with it
- How to set up Dify locally using Docker
- How to build a simple RAG or agent
- How to integrate local models via Ollama
- Who benefits most from Dify
Introduction
Dify is an open-source platform for building AI applications, agents, and workflows. Its main strength is a visual interface. If you prefer clicking to coding, you’ll get results faster. Dify runs locally in Docker and supports models from OpenAI, Anthropic, Ollama, and other providers.
Dify at a Glance
Dify is built around apps, workflows, and agents. An app can be a simple chatbot, text generator, or agent. Workflows chain steps together visually. Agents can leverage tools, knowledge bases, and multiple steps. Behind the interface, configurable API endpoints emerge.
Installation
The quickest path is Docker Compose:
git clone https://github.com/langgenius/dify.git
cd dify/docker
cp .env.example .env
docker compose up -d
After that, Dify is accessible at http://localhost/install. On first startup, you’ll create an admin account. For production setups, adjust the .env file accordingly.
Connecting Ollama as Your Model
Dify can communicate directly with Ollama:
- Open Settings → Model Providers
- Select Ollama
- Enter the URL:
http://host.docker.internal:11434 - Choose your desired model
Make sure the model is already downloaded in Ollama:
ollama pull llama3.1
Getting Started: A Simple Chatbot
- Click Create App
- Choose Chatbot or Agent
- Enter a system prompt
- Select your model
- Test the chat
For RAG, upload documents and add a knowledge base.
When Should You Use Dify?
| Use Case | Benefit |
|---|---|
| Quick prototypes | Build visually without code |
| RAG chatbots | Upload and query documents |
| Agents | Connect tools, knowledge, and workflows |
| Self-hosting | Keep data internal |
Common Pitfalls
- Docker resources - Dify runs multiple containers. You’ll need at least 4 GB of RAM available.
- Ollama URL in Docker -
localhostfrom the Dify container usually won’t reach your host. Usehost.docker.internalinstead. - SMTP configuration - Dify needs mail settings for password resets and invitations.
Further Reading
FAQ - Common Questions
Is Dify free?
The open-source version is. There’s also a cloud version with paid plans.
Can I run Dify locally?
Yes, with Docker Compose. That’s the recommended approach for self-hosting.
Do I need programming skills?
Not for many use cases. Complex workflows and APIs benefit from them.


