Self-hosting Dify
Self-hosting Dify costs nothing and, against a common reading, permits commercial use. What it does not permit, absent written authorisation from Dify, is operating a multi-tenant environment, and it never permits shipping the console without Dify's logo; the licence defines a tenant as a workspace. This page sets out what the Community Edition actually gives you, what the enterprise gate is mechanically, and when the honest answer is to buy Enterprise.
Pick self-hosted Community if you run one workspace for one organisation and can keep the Dify branding: it is free, it includes the core platform, and no licence key is required. Stay on Cloud, or buy Enterprise, if you need a second workspace, SSO, role management or unbranded apps, because each of those is a paid row and the first is also a licence condition.
Side by side
Dify Cloud vs self-hosted Community
| Dify Cloud | Self-hosted Community | |
|---|---|---|
| Price and cycle | Sandbox $0; Professional $59 per workspace/month or $590 per workspace/year; Team $159 per workspace/month or $1,590 per workspace/year | ✓ Free, and "no license required" |
| Terms that apply | Dify's terms for the hosted service | The LICENSE file: modified Apache 2.0, two restrictions plus a clause letting Dify tighten the terms |
| Commercial use | ✓ Yes | ✓ Yes, explicitly: "may be utilized commercially, including as a backend service for other applications" |
| Workspaces | "1 Team Workspace" on all three published tiers | ✗ One workspace per tenant: the licence defines one tenant as one workspace, so running separated areas for other parties needs written authorisation |
| Team members | 1 free, 3 on Professional, 50 on Team | Not counted by the licence; roles and RBAC are enterprise features |
| Branding | "WebApp Branding Customization" is Enterprise-only | ✗ The logo and copyright must stay in the web/ frontend |
| SSO (SAML, OIDC, OAuth2) | Enterprise only | ✗ Not included: behind the enterprise licence gate |
| App log history | 30 days on Sandbox, unlimited on Professional and Team | 30 days; unlimited is an Enterprise row |
| Knowledge storage | 50 MB free, 5 GB Professional, 20 GB Team | ✓ Your own disk; Vector DB listed as "Self Manage" |
| Model spend | Message credits, then your own API key | ✓ Your own API keys, no credit meter |
| Setup effort | ✓ None | ✗ Copy .env.example and edit 100+ variables, with no automatic secret generation (issue #33051, closed as not planned) |
| High availability and support | Managed; Enterprise contract for HA and load balancing | "Github Community" support; HA is an Enterprise row |
Sources: Dify pricing · Dify Enterprise · Dify LICENSE · Dify docs. Compiled August 2026.
Where self-hosting wins
It is free, and commercial use is explicit
Two primary sources agree. The licence says Dify "may be utilized commercially, including as a backend service for other applications or as an application development platform for enterprises", and the Enterprise FAQ says the Community Edition "can be self-hosted for free on your own infrastructure, with access to the core platform features", and adds that no licence key is required. The pricing page describes Community as being for "open-source enthusiasts, individual developers, and non-commercial projects", which is positioning rather than a licence term. The accurate reading is that paid work on a single-tenant install is allowed.
One workspace is enough for most teams
The multi-tenant clause binds only when you run more than one separated area without written authorisation from Dify: "one tenant corresponds to one workspace." For a single organisation on a single workspace, both extra conditions are quiet, as long as the console keeps its logo. Note also that people are a Cloud meter rather than a licence term: on Cloud, 3 members cost $590 per workspace per year and 50 cost $1,590 per workspace per year, while the licence itself does not count heads.
Your data, your model keys, your vector database
Self-hosting removes the message-credit meter entirely, since model calls go to your own API keys. The pricing page lists Vector DB Customize as "Self Manage" for Community, which is a limitation and a freedom in the same row: nobody caps your knowledge storage at 50 MB, and nobody runs it for you either.
Where Cloud and Enterprise still win
The install is the first cost. Issue #33051, opened 2026-03-05, is titled "Self-hosted deployment is too complex" and reports that "Users must manually copy .env.example to .env and then edit 100+ variables", with "No automatic secret generation"; it was closed as not planned. Community also keeps app logs for 30 days against unlimited on Enterprise, lists support as "Github Community", and leaves high availability, LLM API load balancing and the knowledge pipeline templates on the paid side.
The second thing to understand is that the enterprise gate is mechanical, not a flag you can flip. There is no ee/ directory and no second licence file: Dify ships one LICENSE for the whole repository, plus a DEPLOYMENT_EDITION setting. The module api/services/openapi/license_gate.py documents itself as "Enterprise-edition only. Community and Cloud deployments skip the gate entirely" and raises a forbidden response with the reason license_required when the deployment edition is ENTERPRISE, and a decorator named enterprise_license_required guards console endpoints. The features themselves are not in the public tree at all: the modules under api/services/enterprise/ are HTTP clients for a closed companion service, one of them commented as speaking to "dify-enterprise's /inner/api/rbac/* endpoints". So SSO, role management and multiple workspaces are not switched off in the code you have; the code that implements them was never shipped to you.
Choosing between Community and Enterprise
The decision in four steps:
1. Count workspaces first. If the answer is more than one, stop reading the feature table: that is a licence condition, and the remedy is written authorisation from Dify rather than a configuration change.
2. Check the branding requirement. If what you ship must not carry the Dify logo in the console or the web app, that is both the second licence condition and the Enterprise row "WebApp Branding Customization".
3. Price the gap honestly. Enterprise has no published price, so compare it with what you would otherwise buy: Cloud Team at $1,590 per workspace per year for 50 members, or the equivalent row from another vendor.
4. Budget the install, not only the licence. Expect the environment-variable work described in issue #33051, plan and operate your own vector database, and remember that Community app logs keep 30 days.
Common questions
FAQ: self-hosting Dify
Does self-hosted Dify need a licence key?
Not the Community Edition. Dify's own FAQ says the Community Edition "can be self-hosted for free on your own infrastructure, with access to the core platform features", with no licence key required. The same FAQ calls it "open source" while the LICENSE file calls itself "a modified version of the Apache License 2.0"; the licence text is what governs. A key is a separate thing: "A license key activates the paid Enterprise features on your self-hosted Dify deployment." In the code the gate engages only when the deployment edition is set to ENTERPRISE, and the module that implements it notes that "Community and Cloud deployments skip the gate entirely".
Can I enable SSO or multiple workspaces on a self-hosted install?
Not by configuration. Those features are not in the public repository. The directories under api/services/enterprise are clients that call a closed companion service over HTTP, described in a code comment as "Headers recognised by dify-enterprise's /inner/api/rbac/* endpoints", so there is nothing local to unlock. Multiple workspaces are also a licence matter rather than a feature matter, because the licence defines one tenant as one workspace and forbids using the source "to operate a multi-tenant environment" without written authorisation.
How hard is it to run Dify yourself?
Harder than the single-command pitch suggests. Issue #33051, opened 2026-03-05 and titled "Self-hosted deployment is too complex", reports that "Users must manually copy .env.example to .env and then edit 100+ variables" and that there is "No automatic secret generation"; it was closed as not planned. You also own the vector database, which the pricing page lists for Community as "Self Manage", and app log history is capped at 30 days where Enterprise is unlimited. None of that is a blocker; it is simply the work to budget.