Skip to content
English

Switch theme

// How-to · Private LLMs and knowledge bases for the enterprise

Self-host Dify on company servers (Docker Compose)

Dify can be deployed on your own servers with Docker Compose and connected to private models or cloud APIs to build knowledge-base Q&A and internal AI apps.

verified 2026-10-221 official sources

Scenario: Private LLMs and knowledge bases for the enterprise →

Symptoms

  • You want an internal AI app platform for the company
  • Data cannot go to a third-party SaaS

Common causes

  • The SaaS edition keeps data on the vendor cloud
  • No private model integration exists yet

How to fix

  1. Prepare a server: official minimum CPU ≥ 2 cores, RAM ≥ 4 GiB, Docker 19.03+ and Docker Compose 2.24.0+
  2. Clone the latest release per the docs, enter docker, copy .env.example to .env
  3. Run docker compose up -d and set up the admin account in the browser
  4. Add models under model providers: the OpenAI-compatible API of vLLM / Ollama on the intranet, or everything through a LiteLLM gateway
  5. Create a knowledge base, upload documents and pilot a Q&A app with a small group
  6. Back up data volumes before upgrading per the official upgrade notes

Notes

  • Dify uses an open-source licence with extra conditions; read it before offering multi-tenant SaaS
  • Production needs HTTPS, SSO and backups

Official references

Compiled from official documentation and public discussions on 2026-10-22; not yet reproduced in our own environment. Follow the official docs if they differ.

Data updated: Problems & errors