Can Dify be self hosted on premise, and which edition do you need?
Yes. Dify can run on your own servers in the free Community edition, but that edition is limited to a single workspace, and the Dify Open Source License does not allow you to use the source code to operate a multi-tenant environment without written authorization. If you need air-gapped operation on premise, several workspaces, or SSO, you are looking at the Enterprise edition. The four ways to run Dify are Dify Cloud plans, the self-hosted Community edition, Dify Premium on AWS, and the Enterprise hosting models. Which one fits depends on three questions: where your data must physically sit, how many tenants or business units will share the platform, and which identity provider your staff must sign in through.
Dify Cloud is the fastest route to a running platform, but your prompts, documents and app data are hosted by Dify on its cloud provider, and its plans carry usage caps on team members, apps, knowledge documents and knowledge storage. Dify Premium is an AWS AMI that launches as an EC2 instance in your own VPC, so the data stays in your AWS account, and it adds branding control under Settings > Customization. Dify's Enterprise page lists three hosting models: a Dify-managed dedicated cluster in your region, a customer-managed deployment in your own AWS, GCP or Azure account using Helm charts, and an air-gapped on-premises option with locally deployed models. Confirm with Dify which of these include the Enterprise features you need, and which pricing and support terms apply to each.
Install steps and sizing live on the deployment pages, so this section only helps you choose the path. Before you pick the Community edition, check the single-workspace limit against how your organization plans to divide access. Before you pick Enterprise, ask Dify in writing which hosting model it supports for your region, cloud account and network isolation requirements, and what it expects from your infrastructure. Read the Dify pricing page and the Dify Enterprise page side by side, and keep the written answers with your architecture records.
Hosting options compared by edition and deployment model
This table compares each way to run Dify across where data runs, workspace and tenant limits, SSO, air-gapped support, who operates the platform and the published price basis. Read each row as a separate option, and treat any cell marked to confirm as a question to put to Dify before you commit. The main takeaway is that only the self-hosted and Enterprise options keep data inside your own boundary, and the published limits on Cloud plans apply regardless of how many people you invite.
| Option | Where data runs and who operates it | Workspace or tenant limits and SSO | Air-gapped support and published price basis |
|---|---|---|---|
| Dify Cloud Professional | Dify-hosted cloud service, operated by Dify's cloud support team | Limits to confirm on the pricing page; SSO not listed in supplied facts, confirm with Dify | Not offered; 590 US dollars per year as listed on the Dify pricing page |
| Dify Cloud Team | Dify-hosted cloud service, operated by Dify's cloud support team | 50 members, 200 apps, 1,000 knowledge documents, 20GB knowledge storage in 1 workspace; SSO to confirm | Not offered; 1,590 US dollars per year as listed on the Dify pricing page |
| Self-hosted Community via Docker Compose | Your servers or cloud VMs; you operate the stack, upgrades and backups | Single workspace only; no SSO listed for Community, confirm login options with Dify | Runs offline if you supply models and images; free license, with no published support tier |
| Dify Premium on AWS | EC2 instance inside your own AWS VPC; you operate the instance | Branding can be removed in Settings > Customization; workspace and SSO terms to confirm with Dify | Not listed as air-gapped; price basis to confirm with Dify |
| Enterprise dedicated single-tenant | Dify-managed single-tenant cluster in your region; Dify operates it | Enterprise tier features such as SSO and multiple workspaces; exact tenant terms to confirm | Custom priced; not listed as air-gapped, confirm with Dify |
| Enterprise customer-managed VPC via Helm | Your AWS, GCP or Azure account, deployed with Helm charts; you operate it | Enterprise SSO and multiple workspaces; supported identity providers listed in Enterprise docs | Custom priced; confirm support scope and upgrade responsibility in the contract |
| Enterprise air-gapped on premise | Your data center or isolated network; runs fully offline with locally deployed models | Enterprise features including SSO to confirm for offline installs | Custom priced; confirm offline update, image delivery and support terms with Dify |
How the self-hosted Community stack places data and controls inside your network
A self-hosted Dify Community deployment keeps the application data inside the infrastructure you run. The Docker Compose stack starts the api, worker, web, plugin daemon, Nginx, a code sandbox and an SSRF proxy, alongside PostgreSQL, Redis and Weaviate. The metadata database, prompts, app definitions, uploaded files and vector embeddings all live in the services you host, so the first design question is where each of those stores sits, who can reach it and how it is backed up. The metadata database can be PostgreSQL (the default), MySQL or OceanBase. File storage can use local volumes, OpenDAL, S3-compatible storage, Azure Blob or Google Cloud Storage. The vector store defaults to Weaviate, with Qdrant, Milvus, pgvector, OpenSearch and Elasticsearch as options. Confirm each choice against the environment variable reference before you commit to a layout, because moving stores later is a migration rather than a setting change.
Two secrets carry more weight than their names suggest. SECRET_KEY signs session cookies and JWTs and encrypts OAuth credentials, and the reference notes that changing it after deployment logs out all users. Treat it as a long-lived secret in your secrets manager, generated once and included in your backup and restore runbook. Workspace encryption keys can be stored locally or in Azure Key Vault. Local storage means the key material sits on the same host set as the data it protects, so a backup that copies the database without the key store may not restore cleanly. Decide where that key lives before go-live and test a restore that uses only what your backup contains.
Outbound traffic is the other half of the data boundary. The SSRF proxy routes outbound requests through a proxy that blocks internal and private IP ranges, which limits what a workflow or tool can reach on your network. It does not decide where model prompts go. Every model provider you configure receives the prompts and retrieved context sent to it, so a cloud model endpoint is an external data flow that needs its own approval. Air-gapping therefore depends on local models: the Community stack can run without internet egress only when every model, embedding and rerank endpoint, plugin source and update path is also inside your network. Map each outbound destination and confirm which ones your security team has approved before you describe the deployment as isolated.
Decisions to make before choosing a hosting model
Each decision below changes which way of running Dify fits your organization. Settle the edition, the tenant boundary and the identity model first, because they determine whether Community, Premium, Dify Cloud or Enterprise can meet the rest of your requirements.
Edition and workspace count
The free self-hosted Community edition is limited to a single workspace, so the number of teams that need separate workspaces sets the edition question. Multiple workspaces, SSO and professional support belong to the custom-priced Enterprise edition. Ask the vendor for a written edition comparison against your workspace plan before you install anything, because moving from Community to Enterprise is a later migration step.
- Community workspace
- 1
Tenant boundary and license reading
The Dify Open Source License forbids operating the source code as a multi-tenant environment without written authorization, and one tenant is one workspace. If you plan to offer Dify to partners, subsidiaries or customers as separate workspaces, that is a licensing question to resolve with the vendor before deployment. Also confirm with counsel whether removing the console logo is permitted for your use.
Dify license textIdentity provider and SSO scope
Enterprise SSO supports OpenID Connect, SAML and OAuth2, with named providers such as Microsoft Entra ID, Okta and GitHub. Separate scopes control workspace access and web app access, so decide which users sign into the console and which only reach published apps. Community login options are narrower, so confirm which protocol your identity provider must use before choosing the hosting model.
Enterprise SSO docsData residency and cloud provider
Dify Cloud runs on infrastructure whose cloud provider is Amazon Web Services, which the Trust Center lists among sub-processors alongside Cloudflare, GitHub and Google Workspace. If prompts, documents or logs must stay in a named region or account, a self-hosted or customer-managed VPC model keeps that data in your environment. Confirm the storage location of every component, including object storage and vector databases, against your residency requirements.
Dify Trust CenterModel endpoints reachable or fully local
A hosting model that can reach external model providers differs from one that must run offline. Enterprise offers an air-gapped on-premises option with locally deployed models, which removes outbound calls to hosted model APIs. If your teams use cloud model endpoints, confirm network egress rules, the SSRF proxy behavior and which models each workspace can call before you commit to a design.
High availability needs and Kubernetes
Docker Compose is the starting point for self-hosted Dify, and Kubernetes high availability is part of Dify Enterprise. If you need multiple worker nodes, a clustered vector store and failover, plan for Kubernetes 1.24 or later, Helm 3.14 or later, PostgreSQL 14 or later and Redis 6 or later. Ask who operates the cluster, since that effort recurs after launch.
Resources checklistHow the right hosting model changes by situation
A small team that wants Dify on hardware it controls usually starts with the self-hosted Community edition. The Dify self-host deployment overview says Dify runs anywhere Docker runs, from a laptop to an on-premises server or a cloud VM, with Docker Compose as the starting point. The pricing page lists Community as free and limited to a single workspace, so one team can work in one shared space at no license cost.
- Install footprint: The Compose stack needs at least 2 CPU cores, 4 GB of RAM and Docker Compose 2.24.0 or later. It starts PostgreSQL, Redis, Weaviate and the sandbox alongside the application services.
- Operations sit with you: Backups, upgrades and restores are your responsibility. Take a backup before every upgrade and check
.env.examplefor new variables afterward. - Upgrade cadence: Minor releases have arrived roughly monthly, so a schedule for testing and applying them matters more than the first install.
- Support ownership: Plan internal ownership for incidents and confirm what support Dify provides for Community before you rely on it.
Before committing, confirm that your intended internal use fits the Dify Open Source License, that the single-workspace limit covers the whole team and that someone owns the upgrade calendar.
When several departments need their own spaces, the Community edition stops fitting. Its single-workspace limit applies, and the license forbids operating a multi-tenant environment without written authorization. The Enterprise edition adds multiple workspaces, SSO and multi-workspace management, and the Dify deployment overview says Enterprise can run on Kubernetes for high availability. The Dify Enterprise page describes the commercial options.
- Enterprise edition: It adds SSO, multiple workspaces, advanced security, a commercial license and professional support. It is custom priced, so request a written quote tied to your expected workspace count.
- Kubernetes platform: Enterprise resources require Kubernetes 1.24 or later, Helm 3.14 or later, PostgreSQL 14 or later, Redis 6 or later, a Qdrant vector database and S3-compatible storage.
- Cloud Team limits: The Team plan allows 50 team members, 200 apps, 1,000 knowledge documents and 20GB of knowledge storage in 1 workspace, as of November 2026. That suits one group, not a set of departments that each need a workspace.
- Identity model: Enterprise SSO supports OpenID Connect, SAML and OAuth2, with separate scopes for workspace access and web app access. Map groups to workspaces before onboarding begins.
Before committing, confirm how workspaces are counted under the commercial license, whether a shared Kubernetes cluster is permitted and how support covers each department.
Regulated teams often need prompts, documents and knowledge base content to stay in an account the organization controls. Two options in the supplied facts fit that goal. Dify Enterprise offers a customer-managed VPC option that runs in your own AWS, GCP or Azure account, deployed with Helm charts. Dify Premium is an AWS AMI that deploys as an EC2 instance in your own AWS VPC, and Settings > Customization lets you remove the Powered by Dify branding or replace it with your own logo.
- Customer-managed VPC: Data stays in your cloud account, but your platform team also runs the cluster, storage, backups and upgrades.
- Premium on AWS: An EC2 instance is simpler to start, but confirm its scaling, backup and high availability options before treating it as a production layout.
- Vendor touchpoints: Dify's Trust Center lists Amazon Web Services as its cloud provider among sub-processors, alongside Cloudflare, GitHub and Google Workspace. Map which of these touch your data in your chosen model.
- Dedicated managed option: A Dify-managed single-tenant cluster in your region shifts responsibility lines. Ask whether it meets your residency and access requirements.
Before committing, confirm where logs, telemetry and support access go, who controls the encryption keys (workspace keys can be stored locally or in Azure Key Vault) and whether the chosen deployment meets your data residency rules.
A fully air-gapped network removes internet access from the runtime path, so any dependence on external model APIs or online updates must be redesigned. Dify's Enterprise page describes an air-gapped on-premises option that runs fully offline with locally deployed models. Treat that as the starting point and confirm the rest of the design in writing with Dify, including whether the Community edition can be installed offline.
- Local models: Every model endpoint, including embedding and rerank models, must run inside the enclosure. Plan inference servers before the platform build begins.
- Supporting services: Enterprise also depends on PostgreSQL, Redis, Qdrant and S3-compatible storage inside the network, each needing its own sizing and backups.
- Outbound filtering: The SSRF proxy blocks internal and private IP ranges for outbound requests. Test those rules against your offline model endpoints, because internal addresses may be blocked by default.
- Update path: Releases arrive on GitHub roughly monthly. Ask how new images, plugins and security fixes are moved across the gap and how their integrity is verified.
Before committing, confirm update and plugin delivery, which models and embedding services run locally, how the SECRET_KEY is managed and who provides support when the network cannot reach the vendor.
Choosing a Dify hosting model
The decision starts with where your data may live and whether one organization or several will share the platform. A single-workspace need can stay on the free self-hosted Community edition, while a need for SSO or several workspaces points to Enterprise, and a need to remove the Powered by Dify branding on AWS points to Premium. Check the license before any shared or multi-tenant use, and confirm with the vendor which Enterprise hosting model supports your network and air-gap requirements.
Decision path from data location and tenancy to the Dify hosting options.
Sequence for approving a self-hosted Dify deployment
This sequence turns a self-hosted Dify idea into a documented approval, with each step closed by a check that the reader can verify before moving on. It keeps the edition, hosting model, model reachability, identity scope, license and recovery decisions in an order that avoids rework.
Confirm requirements and edition with Dify
Your architecture or platform lead lists the workloads, user counts, number of workspaces, and whether you need SSO, multiple workspaces or a commercial license. Compare that list against the Community edition, which the pricing page describes as free and limited to a single workspace, and the Enterprise edition, which is custom priced. Confirm the Enterprise resource requirements, including Kubernetes, PostgreSQL, Redis, a Qdrant vector database and object storage, with Dify before you assume Community is enough. Done when the edition choice and a written list of required features are signed off by the sponsor and the vendor has confirmed the Enterprise prerequisites in writing.
Decide the hosting model
Choose between Dify Cloud, Dify Premium on AWS, a self-hosted Community install, and the Enterprise options: Dify-managed dedicated, a customer-managed VPC deployment, or an air-gapped on-premises install. Record where prompts, documents, embeddings and logs will sit, and who operates the servers. Confirm that the chosen option can meet your data residency and network isolation rules, and that the Cloud plan limits (for example, workspace, app and knowledge storage caps) fit the expected use. Done when the hosting decision and its data location statement are written down and approved by the data owner.
Confirm model endpoints and reachability
List every model provider, embedding model, rerank model and vector store the applications will call, including any private inference servers. For each one, test from the planned Dify network segment that the endpoint resolves, accepts traffic and returns expected responses. Check the outbound path through the SSRF proxy, because it blocks internal and private IP ranges, so an internal model server may need an approved route. For an air-gapped plan, confirm that every model runs locally. Done when each endpoint has a reachability result, an owner and a credential storage location, and no required endpoint depends on an unapproved outbound route.
Confirm identity and SSO scope
Identify the identity provider, the protocol (OpenID Connect, SAML or OAuth2 according to the Enterprise SSO documentation), and whether SSO must cover workspace access, web app access or both. Decide how external users, sign-up and workspace roles will be handled, and who owns group mapping. Test a login with a pilot account and confirm that the Community login options are enough if SSO is not required. Done when a test user can sign in through the chosen path, role mapping is documented, and the scope owner has accepted the access model.
Validate license terms with counsel
Ask counsel to review the Dify Open Source License, which is a modified Apache License 2.0. Focus on the two conditions that need written authorization or a commercial license: operating a multi-tenant environment where one tenant is one workspace, and removing or modifying the logo or copyright information in the console. Also review the terms for any Enterprise or Premium commercial agreement and confirm how your intended use maps to those conditions. Done when counsel has written a view on each planned use, and any use that needs authorization has a named vendor contact and a signed route before deployment proceeds.
Run a pilot with backups and an upgrade rehearsal
Install the chosen edition in a non-production environment that matches the target layout. Take a backup of the database, file storage and configuration, restore it into a separate instance and check that apps, knowledge bases and secrets work. Rehearse one upgrade by following the upgrade guide for the target version on the GitHub Releases page, and check the .env.example file for new variables. Note that minor releases arrive about monthly, so plan a regular cadence. Also confirm that SECRET_KEY is set before first use, since changing it later logs out all users. Done when a restore test passes, the upgrade rehearsal is recorded with its steps and rollback point, and the pilot results are reviewed by operations.
Document the approval
Assemble a single approval record that includes the edition, hosting model, endpoint inventory, identity scope, license opinion, pilot results, backup and restore evidence, and the upgrade runbook. Name the owner for each area, the review date, and the conditions that would trigger a new review, such as a change in workspace count or hosting location. Share the record with security, compliance and the business sponsor for sign-off. Done when every area has a named owner, every open item has a decision or a due action, and the approvers have signed.
What a security reviewer asks to see for hosting and data location
This table pairs the questions a security reviewer usually raises about where Dify stores data and how it handles secrets and outbound traffic with the evidence to request and where it comes from. Read it before a hosting decision, then use the confirm column to close gaps with the vendor or in your own environment. Hosting in your own infrastructure moves most data-location answers to your team, while Dify Cloud answers depend on the vendor's published materials.
| Reviewer question | Evidence to request | Where it comes from and what to confirm |
|---|---|---|
| Where is application data stored? | A written map of the metadata database, file storage, vector store and logs for the chosen hosting model | Environment variable reference lists PostgreSQL (default), MySQL or OceanBase, plus OpenDAL, S3-compatible and other object stores. Confirm which store holds knowledge files and where backups go. |
| Which sub-processors apply? | The vendor's current sub-processor list and the date it was read | Dify Trust Center lists Amazon Web Services as cloud provider, alongside Cloudflare, GitHub and Google Workspace. These apply to Dify Cloud and vendor operations, not to a self-hosted install in your account. Confirm with the vendor in writing. |
| Which hosting model keeps data inside our boundary? | The hosting option named in the contract and the deployment architecture | Dify Enterprise lists a Dify-managed dedicated option, a customer-managed VPC option and an air-gapped on-premises option. Confirm which option the contract covers and who operates the infrastructure. |
| How are secrets and session keys protected? | Documented key handling, storage location and rotation procedure | SECRET_KEY signs cookies and JWTs and encrypts OAuth credentials, and changing it logs out all users. Workspace encryption keys can be stored locally or in Azure Key Vault. Confirm where keys live and who can read them. |
| How are outbound requests filtered? | Proxy configuration and the list of blocked address ranges | SSRF_PROXY settings route outbound requests through a proxy that blocks internal and private IP ranges. Confirm the proxy is enabled and that agent sandbox egress is restricted as the release notes describe. |
| What does the license permit? | The license text and a written opinion from legal on your use case | The Dify Open Source License forbids operating a multi-tenant environment without written authorization and removing the logo. Confirm whether your deployment serves more than one tenant or customer. |
| How are upgrades applied and verified? | Upgrade runbook, backup evidence and change record for each release | Upgrades follow the guide for the target version, with a backup before each upgrade and a review of .env.example for new variables. Confirm your change window, rollback plan and who approves the upgrade. |
Questions buyers ask before approving a hosting model
Can the free Community edition serve a whole company?
Usually not on its own. The self-hosted Community edition is free but limited to a single workspace, so one team or one shared space is the natural fit. Serving several business units with separate workspaces, SSO and centralized administration points to Dify Enterprise, which the Dify pricing page lists as adding SSO, multiple workspaces, advanced security, a commercial license and professional support. Confirm the workspace count you need before you pick an edition. Separately, the Dify license forbids running the source code as a multi-tenant service without written authorization, so a model where you serve outside customers needs its own license conversation.
What does Dify Enterprise cost?
Dify Enterprise is custom priced, so there is no published figure to compare. The price follows from the features, deployment model and support level you choose, and Dify quotes it. Ask for the quote to name the license term, the deployment model (Dify-managed dedicated, customer-managed VPC or air-gapped on premises), the number of workspaces and the support terms. Your own cost also includes the infrastructure to run it, the people who operate it and model usage, which Dify's license price does not cover. Compare quotes against that full picture rather than the license line alone.
Does air-gapped Dify work without internet access?
Dify's Enterprise page describes an air-gapped on-premises option that runs fully offline with locally deployed models, so the answer depends on the Enterprise deployment model, not on the Community Docker Compose install. Before you plan, confirm with Dify which components need outbound access in your environment, how images and plugins reach the network, and how updates arrive. Local model endpoints, an offline vector store and your own object storage all need to be in the design. Treat the air-gapped path as a scoped project that needs its own verification, not a toggle.
How much effort does self-hosting Dify take to run?
The effort is set by four drivers: the infrastructure, the upgrade cadence, the model endpoints and the backups. The Docker Compose stack starts several services, including the api, worker, web, plugin daemon, PostgreSQL, Redis, Weaviate, Nginx, a code sandbox and an SSRF proxy, and the minimum stated for that path is 2 CPU cores and 4 GB of RAM. Dify's releases arrive roughly monthly, and the Docker Compose docs advise a backup before every upgrade and a check of .env.example for new variables. Each model provider or inference server you connect adds its own credentials and availability work. Ask any partner to size the effort against these four drivers in writing.
Can our own team run a self-hosted Dify alone?
A small platform team can run a single Community instance if it is comfortable with Docker Compose, PostgreSQL, Redis, object storage and regular upgrades. The harder work is keeping that instance current, tested and backed up across monthly releases, and operating the model endpoints behind it. Enterprise on Kubernetes adds Helm 3.14 or later, Kubernetes 1.24 or later, PostgreSQL 14 or later, Redis 6 or later and a Qdrant cluster, which is a larger skill set. Be honest with yourselves about who owns on-call, upgrade testing and recovery drills, and whether that person exists at the required level.
Is Dify Cloud suitable for regulated data?
It depends on what your regulator and contracts require about where data is processed and who can access it. Dify Cloud is hosted by Dify, the Trust Center lists Amazon Web Services as its cloud provider among its sub-processors, and the Team plan has published limits. A self-hosted deployment keeps the application, data stores and logs inside infrastructure you control, which many regulated teams need. Review Dify's Trust Center and the sub-processor list with your legal and compliance team, and confirm with Dify which attestations cover the cloud service before you approve it. Do not assume the cloud service meets a control because the self-hosted option does.
How long does a Dify deployment take?
No duration is published for a deployment, and the answer depends on what you are building. The main drivers are the hosting model, the number of model providers and vector stores to connect, identity integration, the sign-up and access policy, backup and restore testing, and how much review your security team requires. A single Community instance on existing infrastructure moves much faster than an Enterprise deployment on Kubernetes with SSO and an air-gapped model path. Ask for a timeline in the written scope, with each milestone tied to a deliverable and to the decisions your team has to make.
How DeployOpen plans and runs Dify in your infrastructure
DeployOpen plans, implements, hardens, backs up and documents self-hosted Dify inside your own cloud accounts, data centers or air-gapped networks. We start from the choice between Dify Cloud, the Community edition, Premium and Enterprise, so the platform you run matches your data, identity and licensing needs.
How we scope
- We agree the deployment model, licensing position and tenant count in writing before any build starts.
- Engagements are fixed-scope, with deliverables, timelines and responsibilities confirmed up front.
- We map which data, models and identity sources must stay inside your boundary before choosing a hosting option.
How we build
- We size compute, PostgreSQL, Redis, vector store and object storage against your planned workloads and users.
- We configure secrets, outbound request filtering, sandboxing and network boundaries as part of the build.
- We test restores, upgrades and the Community or Enterprise edition limits before anything goes live.
How we hand over
- You receive architecture, configuration and runbook documentation written for your own operators.
- We walk your team through backups, upgrade steps, the .env variables to review and license administration.
- We document which controls are yours and which vendor attestations apply, so evidence is not overstated.
How we support
- Ongoing support, upgrades and continuous security testing are available as retainers after handover.
- Upgrades follow the target release guide, with a backup taken before each version change.
- We confirm vendor support terms with Dify for your edition rather than assuming them.

