Dify Enterprise staging and production environments

Dify Enterprise environments let a team promote tested app versions from staging to production with separate credentials, variables, runtime modes and CPU quotas. This page explains what to plan before you rely on them.

On this page

Why Dify Enterprise staging and production environments need a plan

An organization running LLM apps in production needs a way to test a changed prompt, workflow or model choice before end users see it. Dify Enterprise Environments answer that need by letting you promote app versions from a staging environment to a production environment, with each side holding its own credentials and variables, a runtime mode, and a CPU quota set by the license. Rollback is part of the same design, so a bad release has a defined way back. The decisions to make are which apps need this separation, which secrets must differ between the two sides, and how much isolation the runtime needs.

Dify's Community edition is free and limited to a single workspace, so an organization that wants separate teams or business units to run apps side by side will hit that limit quickly. The Enterprise edition adds multi-workspace management, SSO and professional support, and the environments feature sits within that multi-workspace administration model. Regulated teams usually need this separation most: a change to a customer-facing agent or a knowledge retrieval flow can alter what data is read and what is returned, and the audit trail should show who promoted what and when. Before you plan the rollout, confirm with Dify which environment features and runtime modes your license includes, since the supplied material does not detail them.

Shared versus isolated runtime modes

In shared mode, staging and production apps draw on the same pool of runtime capacity, so the platform spends less on dedicated capacity but gives up hard separation between environments. Teams usually pick shared mode when the organization is small, the number of deployed apps is modest, or the restricted cluster cannot support extra runtime footprint. The main question to settle is whether a load test or runaway workflow in staging can slow production answers.

  • Lower footprint: One runtime pool serves both environments, which reduces idle capacity and the number of components to operate.
  • Noisy-neighbor risk: A heavy staging workflow can consume CPU that production requests need at the same time.
  • Shared quota exposure: Any CPU quota taken from the license applies across the pool, so staging usage counts against the same limit production relies on.
  • Simpler operations: One set of runtime settings and one place to look when an agent run is slow.
  • Weaker blast-radius control: A misconfigured app in staging is more likely to affect production users.

Before you choose shared mode, ask your vendor and your own platform team to confirm how the installed version enforces CPU quotas across environments and whether staging load can be capped.

Environment settings to decide before promotion

This table compares the environment settings you need to decide before promoting a Dify app from staging to production, with the trade-off of each option and what to confirm with the vendor. Read each row as a decision to record in writing before the first promotion. The main takeaway is that credentials, runtime mode and CPU quota shape both security and availability, so they should be settled before any app is promoted.

DecisionWhen it fitsTrade-offConfirm with the vendor
Separate credentials per environmentStaging and production use different model provider keys, tool credentials or data sources.More keys to issue and rotate, but a leaked staging key cannot reach production systems.Whether credentials are assigned per environment in the admin dashboard, and whether production can block workspace-managed credentials.
Environment variablesEndpoints, storage targets or feature settings differ between staging and production.Values drift when edited by hand, and DSL exports do not carry third-party API keys.Whether variables are scoped per environment and which values a promoted app reads at run time.
Shared runtime modeThe team wants lower operating overhead and the cluster allows shared execution.Staging and production workloads share compute, so heavy staging tests can affect production latency.Which app types run in shared mode and how it interacts with the agent sandbox on Kubernetes.
Isolated runtime modeProduction needs latency guarantees or stronger separation, or load tests must not touch production.More capacity to plan and monitor, and the CPU quota must be divided between environments.What isolation the mode provides at process, namespace or node level, and what each mode consumes.
CPU quota from the licenseThe Enterprise license limits CPU for deployed environments and must be split between tiers.A generous staging share can starve production at peak, while a tight share slows pre-release testing.How quota is measured, how it is divided, what happens when a workload exceeds it, and the figures in writing.
Promotion approvalChanges to production apps affect customer-facing flows or regulated data.A named approver adds a step, but without one there is no evidence of who approved a change.Whether the platform records approver identity, or whether approval must be kept in your change management tool.
Rollback targetA promoted version misbehaves and production must return to the previous working version.Rollback restores app configuration but may not reverse data changes or credential updates.Whether earlier app versions stay deployable and whether rollback also restores environment variables.

How to set up staging and production environments

This sequence takes a Dify Enterprise deployment from a confirmed license and workspaces to a tested app version running in production, with separate credentials, runtime settings, CPU quotas and a rollback path at each stage. Each step ends with a check you can record, so the team can see what changed before it moves on.

  1. Confirm the Enterprise license and workspaces

    The platform team confirms that the Dify Enterprise license is active in the namespace where Dify runs and that the workspaces for the teams involved in staging and production exist, each with a named owner. Check the platform prerequisites in the Enterprise resources checklist: 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 or cloud object storage. Verify each item in your own environment. This step is done when the license status and workspace list match the plan and each prerequisite version or capacity is recorded.

  2. Define the staging and production environments

    The application owner and platform lead agree which environment each deployment target represents, who may publish to each one, and which external systems staging is allowed to reach. Write these decisions down before any credential or quota is set, because later steps depend on the environment names. Ask your Dify Enterprise contact how environments are represented in your version. This step is done when each environment has a named owner, an approver for production changes and a documented list of the systems it connects to.

  3. Assign separate credentials and variables

    Give staging and production their own model provider keys, tool credentials and environment variables, so a test run never draws on production spending limits or production data sources. The platform team sets these in the admin dashboard and assigns each set to the matching workspace or environment. Confirm in the Enterprise documentation which credential types can be managed centrally. This step is done when a register lists each credential with its owner and environment, and a test call from staging demonstrably uses the staging key.

  4. Choose the shared or isolated runtime mode

    Decide whether each environment runs in shared or isolated runtime mode. Confirm in the Enterprise documentation what each mode isolates and what it requires, then choose the mode for each environment based on how much production should be shielded from staging load. The choice affects the CPU quota step that follows, so make it first. This step is done when the mode for each environment is recorded in the change record and a staging app starts successfully under the selected mode.

  5. Set CPU quotas within the licensed capacity

    Assign a CPU quota to each environment so the combined allocation stays within the CPU capacity covered by the license. Ask your Dify Enterprise contact how licensed CPU is measured and whether a quota can be changed without a restart, since that determines how often the quotas need review. Leave headroom for production so a staging load test cannot starve live users. This step is done when the quota total is recorded against the license and a staging load test stays within its quota without slowing production responses.

  6. Promote a tested app version to production

    Export the tested app version as a DSL file, promote it to the production environment and record the version identifier. Before promoting, confirm that the app uses only node types and integrations the Enterprise deployment limits allow, because knowledge retrieval, agents and human input may need redesign first. Confirm how to return to the previous version and test that path in staging, since rollback is part of the promotion plan. This step is done when production shows the promoted version identifier and the rollback path has been written down and tested.

  7. Compare production runs against staging results

    After promotion, run the same test inputs that passed in staging against production, then compare outputs, token use, duration and failure status for each run. Use the organization-wide invocation logs to review the production runs, and flag any difference the team cannot explain. Check the model provider and credential set first, since they are the most common cause of divergence. This step is done when each difference is explained or fixed and the owner signs off, or the team rolls back to the previous version and repeats the comparison.

Protecting credentials and data across environments

Staging and production share one Dify Enterprise installation's services, so a leak or misconfiguration in one environment can reach the other. The cards below cover the controls to decide before promotion starts, from secret separation to the audit trail for promotion and rollback.

Separate staging and production secrets

Give staging and production their own model API keys, tool credentials and environment variables, so a test workflow cannot call a production model account or write to a production system. Confirm in your environment that each environment's credentials are assigned separately and that no production key is copied into a staging variable for convenience. Ask your Dify Enterprise contact how credentials are scoped in the admin dashboard before you define the naming convention.

Treat SECRET_KEY as a permanent value

Changing SECRET_KEY after deployment logs out all users. The key signs session cookies and JWTs and encrypts OAuth credentials, so it must be generated once, stored in your secrets manager and kept identical across the services that read it. Plan any rotation as a scheduled change with users notified, and confirm how it interacts with stored OAuth credentials before you touch it.

Manage workspace encryption keys

Workspace encryption keys can be stored locally or in Azure Key Vault. Decide which option fits your key custody model before the first promotion, because the choice affects who can recover encrypted data and how backups are restored. Confirm with your security team where the key material lives, who holds administrative access to it, and how it is included in your backup and disaster recovery plan.

Filter outbound requests through the SSRF proxy

The SSRF_PROXY settings route outbound requests through a proxy that blocks internal and private IP ranges. This limits what a workflow, tool or HTTP node can reach from either environment. Verify that staging and production traffic both pass through the proxy, and review any allowlist exceptions your team adds, since a broad exception in staging can become a path into internal networks used by production.

Limit who may promote and roll back

Promotion moves a tested app version into production, so it is a change to a live system and should not be open to every builder. Define a short list of approvers who may promote and roll back, separate from those who build and test apps. Ask your team to document the approval step for each promotion, and confirm in the Enterprise admin settings which roles can perform these actions.

Audit promotion and rollback events

Record who promoted which app version, when, from which environment and what was rolled back. Without this record, an unexpected production change is hard to explain to auditors or to your incident team. Confirm which events Dify Enterprise logs natively, which must be captured through telemetry or your own change records, and how long each record is retained in your infrastructure.

Limits to confirm before you design around environments

Which app types and nodes can be promoted to deployed environments?

Confirm the promotable app types and nodes with Dify before you commit to an environment model, because the answer decides whether your apps can move from staging to production at all. Apps that depend on knowledge retrieval, agents or human input may need redesign before promotion. Ask Dify for the current list for your release, and test one representative app from each type you plan to run in staging. Treat any app that fails promotion as a design change, not a configuration fix, and record it in your release plan.

Does rollback restore app configuration, data or both?

Confirm this for your release, because rollback behavior for app configuration and for data is not the same question. Configuration such as prompts, workflow nodes and model parameters is what an app version carries, so restoring a prior version affects that layer. Knowledge base content, usage logs and conversation data sit outside the app version. Test a rollback in a non-production workspace and check what changed in the database and in the knowledge base before you rely on it as a recovery step.

How do knowledge base content and third-party API keys move between environments?

Plan for them to be recreated or re-entered, because the DSL export does not carry them. According to the Dify app management docs, a YAML DSL export includes app configuration, workflow nodes, model parameters, prompts and knowledge base connections, but not third-party API keys, knowledge base content or usage logs. Each environment therefore needs its own credentials, and the knowledge base must be loaded and indexed in production. Document the manual steps and who performs them in each release.

How are CPU quotas from the license enforced in each environment?

Ask Dify exactly how the licensed CPU quota is counted and what happens when a workspace or environment reaches it. The quota is set by the license, so the number of environments you run and how they share it are a design decision. Confirm whether staging and production draw from one pool, whether runs queue or fail at the limit, and how usage is reported. Test a load that approaches the limit in staging before a production launch.

Which Dify release versions are compatible with this environment model?

Confirm compatibility with the exact Dify Enterprise release you run, because environment features and promotion behavior can change between releases. Dify publishes minor releases roughly monthly on its GitHub releases page, so a staging and production pair can drift if they are upgraded on different schedules. Keep both environments on matching versions, follow the upgrade guide for each target version, and back up before every upgrade, as the Docker Compose docs recommend.

Can a runtime mode change after an environment is in use?

Confirm with Dify whether switching between shared and isolated runtime modes is supported on a live environment, and what it does to running apps. The choice affects isolation between staging and production, so changing it late can undo the separation you designed. Ask whether a switch needs a restart, whether it affects credentials and variables, and how to test it in staging first. If the mode cannot be changed safely in place, plan the choice before the first production promotion.

Who approves changes to production environment variables and credentials?

Confirm how Dify records and restricts changes to environment variables and credentials, and define the approval step yourself, because the platform does not decide your change policy. Ask whether audit records show who changed a value and when, and whether roles can limit production edits to named administrators. Pair this with your secrets management process, so that production values are rotated under the same controls you apply to other systems.

Does the Enterprise license cover every environment we plan to run?

Confirm the license terms in writing before you design more than one production-grade environment, since the Community license is limited to a single workspace and the Enterprise terms define what is included. Ask Dify how environments count against your license, whether non-production environments carry the same entitlements, and what changes if you add workspaces. The license terms determine the design, so confirm them before you finalize the environment model.

How the operating model changes after go-live

After go-live, the main recurring obligation is keeping staging and production on compatible Dify versions. Promotion only works when both environments run versions that understand the same app configuration, so every release needs to be tested on staging before production receives it. Dify's releases page shows minor releases arriving roughly monthly (1.16.0 on July 17, 2026, 1.17.0 on August 25, 2026 and 1.17.1 on September 10, 2026), so the team should assign someone to review each release against its release notes and decide when staging takes it. Confirm with your Dify Enterprise contact how Enterprise versions map to these open-source releases before you set a cadence.

Each upgrade should start with a backup. The Docker Compose docs advise a backup before every upgrade and checking .env.example for new variables afterward, so build those two steps into the change record. Upgrade steps differ by deployment type, though. A Docker Compose install follows the upgrade guide for the target version, while an Enterprise install on Kubernetes follows the Enterprise procedure and its Helm chart, and the two must be planned separately. Ask your vendor for the Enterprise upgrade documentation for each target version, and confirm whether staging and production can be upgraded in the same window or must be staggered.

Promotion logs are part of the operating routine too. Review them after each promotion and on a regular schedule to confirm that the right app version reached production, that credentials and variables resolved to the production values, and that rollbacks were used only when intended. Keep a short record of who approved each promotion, which version moved, and what changed in the environment settings. This record is also the evidence an auditor or internal reviewer will ask for when production behavior changes.

Questions teams ask before setting up Dify environments

How much effort and cost should we expect to set up Dify staging and production environments?

Cost depends on the number of environments, the platform you deploy onto and how much of the promotion process you want automated. Enterprise Environments are part of the Dify Enterprise edition, which the Dify pricing page describes as custom priced, so there is no published figure to plan against. Your quote should separate the license, the Kubernetes and infrastructure work, the environment design and the first promotion dry run. Ask the vendor which items recur each year, such as license renewal and support, and which are one-time, such as setup and approval workflow design. Each additional environment adds configuration, credential and testing work.

How long does it take to set up separate staging and production environments?

Duration depends mainly on how many environments you need, whether the prerequisites are already in place and how many approvers must sign off on each promotion. The Dify Enterprise resources checklist lists the platform prerequisites: 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 or cloud object storage. Teams that already run these services can move faster. Teams that need to build them first should expect the infrastructure work to dominate the schedule. Ask for a written timeline tied to the agreed scope before work starts.

What does our team need to provide for this work?

You need an active Dify Enterprise license, a Kubernetes cluster that meets the resource checklist, and named people who can approve credential, variable and promotion changes. Plan for an engineer who understands Kubernetes namespaces, Helm releases and secret handling, and an application owner who knows which apps and models each environment must reach. Security or compliance staff should review how production credentials are separated from staging. Confirm with the vendor how the license is bound to your cluster before you start, since activation depends on it.

Can our own team set up staging and production environments without a partner?

Yes, if your team has Kubernetes and Helm experience and time to work through the Enterprise documentation. The harder parts are usually decisions rather than commands: whether staging shares runtime resources with production, how CPU quotas are divided, who may promote a version and how a failed release is reversed. A partner is useful when those decisions need to be made quickly and documented for auditors. Whichever path you choose, ask for the environment design and rollback procedure as written deliverables.

How does rollback work when a promoted app version fails in production?

Rollback depends on what the promotion changed. An app version promoted from staging can be restored to a previous known-good version if your process keeps that version available and records which version production is running. Configuration that lives outside the app, such as environment variables or credentials, must be rolled back separately, which is why keeping them isolated per environment matters. Before go-live, test a rollback in staging, confirm how long it takes and identify who is authorized to trigger it. Confirm with the vendor which app types can be promoted at all, because some app designs need redesign first.

What is the difference between shared and isolated runtime modes, and which should we choose?

Shared mode lets environments use common runtime resources, which is simpler to run but means a heavy staging workload can affect production. Isolated mode gives each environment its own runtime, which costs more capacity and operational effort but limits cross-environment impact. The choice depends on your risk tolerance, your cluster capacity and whether production data or regulated workloads must be kept apart. Confirm with the vendor how each mode behaves for your app types and how CPU quotas from the license apply to each environment before you decide.

Do we need a backup before promoting an app to production?

Yes, you should take a backup before any change that touches production data or configuration. The Dify Docker Compose documentation recommends a backup before every upgrade, and the same discipline applies to promotions. Back up the database, file storage and configuration that production depends on, and test that you can restore it in a non-production environment. Ask your vendor to document which items a promotion changes and which backups cover them.

How DeployOpen scopes and supports environment setup

DeployOpen is a Chainscore Labs company that plans and implements self-hosted open-source platforms in infrastructure you control. The cards below describe how an engagement for Dify Enterprise staging and production environments is scoped, supported after go-live and handed over to your team.

Fixed-scope engagement with written scope

Most engagements are fixed-scope, so the environments, promotion path, credential model and rollback procedure are agreed in writing before work starts. The written scope should name which workspaces and applications move through staging, which runtime mode each environment uses and what counts as a completed deliverable. Ask for the deliverables list and the timeline in the same document, and check that it states who provides the Kubernetes cluster, the license and the network access.

Quote follows the written scope

DeployOpen does not publish a price list. A quote follows from the written scope, so the cost depends on how many environments, workspaces and integrations are in scope and how much of the promotion path must be redesigned. Ask the quote to separate one-time setup work from any recurring retainer, and to list which items your own team must supply, such as identity provider configuration and secrets storage.

Retainer for ongoing support and upgrades

A retainer covers ongoing support, upgrades and continuous testing after the initial environment work is complete. For Dify Enterprise, this matters because minor releases arrive roughly monthly, so each environment's runtime and credential settings need to be checked against every upgrade. Confirm the response expectations, upgrade cadence and which environment changes are included before you sign.

Runbooks handed over to your team

The handover should include runbooks for promoting an app version, rotating environment-specific credentials, switching a workspace back to a previous version and checking CPU quota use. Each runbook should name the operator role, the approval step and the evidence to keep, so that your platform team can run the procedures without the original implementers. Ask for the runbook format and a walkthrough before acceptance.

Verification before acceptance

Acceptance should rest on checks you can repeat: a test promotion from staging to production, confirmation that production credentials and variables differ from staging, a rollback test and a review of runtime isolation. Agree these checks in the scope so that go-live is judged against stated criteria rather than a verbal sign-off. Your security team should also review the results before production traffic is moved.

Chainscore Labs company

DeployOpen is a Chainscore Labs company. It plans, implements, customizes, hardens, backs up, upgrades, documents and supports self-hosted open-source platforms inside your cloud accounts, data centers or air-gapped networks. It does not issue audit reports or certifications, so any compliance evidence from this work should be reviewed by your own independent auditor.

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.