- You’re looking to create one or a few applications as a small/medium business and you care about data residency.
- You are interested in Dify Cloud, but your use case requires more resources than supported by the plans.
- You’d like to run a POC before adopting Dify Enterprise within your organization.
Access & Set up
After the AMI is deployed, access Dify via the instance’s public IP found in the EC2 console (HTTP port 80 is used by default). If this is your first time accessing Dify, enter the Admin initialization password (your EC2’s instance ID) to start the setup process.Customize
Configuration
Use Docker Compose 2.35.0 or later. Rundocker compose version to check.
1
Edit Environment Variables
Put each setting where Set a Variable says it goes:
- Settings Compose reads first, such as
COMPOSE_PROFILESandVECTOR_STORE, and the shared credentials go in/dify/.env. - Settings your AWS deployment already sets in
docker-compose.override.yamlstay there. - Every other setting goes in a local
.envfile under/dify/envs/, never in a.defaultsfile.
2
Apply Changes
From If a change doesn’t take effect, check whether
/dify, validate the configuration and recreate the affected services. Keep your existing AWS override file in both commands; if it is absent, omit -f docker-compose.override.yaml./dify/.env or docker-compose.override.yaml also sets it: both win over a local file (see Precedence).Web App Logo & Branding
In Settings > Customization, you can remove thePowered by Dify branding or replace it with your own logo.
Upgrade
Run every Compose command below on your EC2 instance with the deployment’s existing project name and files, including any-p or COMPOSE_PROJECT_NAME. A different project name starts with new, empty named volumes. If you don’t have docker-compose.override.yaml, leave out its -f option.
1
Back Up the Deployment
-
From
/dify, stop the deployment so the databases aren’t writing while you copy their files:If you can’t stop it, back up the databases with their own dump tools instead. -
Back up
/dify/.env, every local.envfile under/dify/envs/,docker-compose.override.yaml, and other custom deployment files. Then back up persistent data, including/dify/volumes/and any external databases or storage. -
If your deployment includes
local_sandbox, also back up its named volumes, mounted at/home/difyand/workspace. List them with:
2
Update to the Selected Release
Replace The exclusions preserve your local environment files, AWS override file, and runtime data. Reapply changes to any other custom deployment files from your backup.
<version> with the release tag you chose. Copy its Docker files and templates together:3
Review Your Configuration
Compare
/dify/.env with /dify/.env.example, and each local file under /dify/envs/ with its new template. Where they differ:- Keep the values you set on purpose, including your database and vector store settings.
- Take the template’s value for the rest.
- Use the new name where the release notes rename a setting.
If
/dify/.env doesn’t set DIFY_AGENT_LOCAL_SANDBOX_AUTH_TOKEN yet, generate a value with openssl rand -hex 32 and set it there. The agent backend and its local sandbox require this shared token to start.4
Apply and Check the Upgrade
Up or healthy and that init_permissions finishes with Exited (0). Then open Dify and check the features that use your custom settings.