These steps follow Dify's official Docker Compose guide, the README for Dify's official Ollama plugin and Ollama's FAQ, all read on 3 December 2026. Menu names and settings may change between releases.
Dify is an open-source platform for building AI apps: chatbots, document question-answering (RAG), agents and multi-step workflows, all assembled in a web interface rather than in code. Most people meet it through Dify Cloud, but the Community Edition runs on your own PC with Docker. Pair it with Ollama and the language model runs on your own graphics card too, so prompts and documents don't have to leave your machine.
This guide covers installing Dify, connecting it to Ollama, and the one networking step that trips most people up.
What you need
Dify's documentation lists a minimum of a 2-core CPU and 4GiB of RAM for the Dify services themselves. That figure doesn't include the language model. Ollama runs the model on your graphics card's VRAM where it can, spilling into slower system RAM when it doesn't fit, so plan your hardware around the model you want to run. Our guides to how much VRAM you need and how much RAM you need for local AI give the sizing rules. A 16GB card such as the ASUS RTX 5060 Ti 16GB Dual OC gives room for mid-sized models alongside an embedding model.
Software-wise, Dify asks for:
Docker with Docker Compose 2.35.0 or later, with the Docker daemon running
Git, to download Dify
OpenSSL, to generate a token for Dify's agent sandbox
On Windows, Dify's guide says to use Docker Desktop with WSL 2 and to store the source code and container data in the Linux file system rather than on a Windows drive. On a Mac, it says to give Docker Desktop's virtual machine at least 2 virtual CPUs and 8GiB of memory. On Linux, install Docker Engine and the Compose plugin for your distribution.
Check your Compose version first:
docker compose version
Step 1: Install Ollama and pull a model
Install Ollama from ollama.com/download, then pull a chat model and, if you plan to use document search, an embedding model. Dify's Ollama plugin README uses these examples:
ollama run gemma3
ollama pull qwen3
ollama pull embeddinggemma
Ollama's local API then listens at http://localhost:11434. If you have a graphics card, it's worth confirming Ollama is actually using it; see how to check Ollama is using your GPU.
Dify's guide tells you to pick a version from Dify's releases page and clone that tag. At the time of writing the latest release listed on GitHub is 1.20.0, published on 18 November 2026. Replace <version> with the tag you choose:
git clone --branch <version> --depth 1 https://github.com/langgenius/dify.git
cd dify/docker
cp .env.example .env
openssl rand -hex 32
Open .env in a text editor and set DIFY_AGENT_LOCAL_SANDBOX_AUTH_TOKEN to the string the openssl command printed. Dify's guide says the agent backend and its local sandbox need this shared token to start.
Step 3: Start Dify
From the dify/docker folder, run:
docker compose up -d
docker compose ps --all
Long-running services should show Up or healthy. A one-off task called init_permissions should show Exited (0), which Dify says is expected. The Compose deployment includes PostgreSQL, the Weaviate vector database and the other services Dify needs, so you don't have to set up a database yourself.
Open http://localhost/install in your browser, create the administrator account, then sign in at http://localhost. Dify uses port 80 by default. If something else on your PC already uses port 80, set EXPOSE_NGINX_PORT in docker/.env to another port and add it to the address, for example http://localhost:8080.
Step 4: Let Dify's containers reach Ollama
This is where most set-ups go wrong. Inside a Docker container, localhost means the container itself, not your PC, so a Base URL of http://localhost:11434 won't reach Ollama running on the host.
Dify's Ollama plugin README says Docker deployments should use a host address the Dify container can reach, such as http://host.docker.internal:11434 or your PC's LAN IP address.
Ollama's FAQ adds that Ollama binds to 127.0.0.1 on port 11434 by default, and that you change this with the OLLAMA_HOST environment variable. If Dify can't connect, set OLLAMA_HOST so Ollama listens on an address the containers can reach, then restart Ollama. Our guide to setting Ollama environment variables on Windows shows where to do it. Only make Ollama reachable beyond your own PC on a network you trust.
Step 5: Install the Ollama plugin and add models
In Dify, open the Marketplace, install the Ollama plugin, then go to Settings > Model Providers > Ollama and add a model. The plugin README describes these fields:
Model Name: the Ollama model name, for example gemma3 or qwen3
Base URL: the host root, such as http://host.docker.internal:11434. Don't add /api; the plugin adds the endpoint paths itself
API Key: optional for a local Ollama
Model Type: Chat for chat, tool calling and vision
Model Context Length: match the model's context window
Vision support and Function call support: choose Yes only if the model supports images or tools
Add your embedding model the same way with the model type set to Text Embedding. Dify uses it to index documents for its knowledge base. Our best local embedding models guide helps you choose one.
A larger context length uses more VRAM, so don't set it higher than you need. Our guide to setting Ollama's context length explains the trade-off.
Step 6: Build your first app
In Dify you can create a chatbot, an agent or a workflow and pick your Ollama model in its settings. A simple first project is a private document assistant: create a knowledge base, upload PDFs, let Dify index them with your local embedding model, then attach the knowledge base to a chatbot.
The plugin README also says it supports streamed responses, thinking output, tool calling and vision, so reasoning and multimodal models from Ollama work in Dify apps as long as you tick the matching options when adding them.
Before you let anyone else in
Dify's guide warns that the bundled credentials are for development. Before other people can reach the deployment, it says to configure HTTPS and replace the default database, Redis, sandbox and Weaviate secrets in docker/.env. For a single-user set-up on your own PC this matters less, but don't expose it to the internet as-is.