// 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
- Prepare a server: official minimum CPU ≥ 2 cores, RAM ≥ 4 GiB, Docker 19.03+ and Docker Compose 2.24.0+
- Clone the latest release per the docs, enter
docker, copy.env.exampleto.env - Run
docker compose up -dand set up the admin account in the browser - Add models under model providers: the OpenAI-compatible API of vLLM / Ollama on the intranet, or everything through a LiteLLM gateway
- Create a knowledge base, upload documents and pilot a Q&A app with a small group
- 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.