Skip to main content

Documentation Index

Fetch the complete documentation index at: https://dify-6c0370d8-docs-hitl-2.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Dify Premium is our AWS AMI offering that allows custom branding and is one-click deployable to your AWS VPC as an EC2 instance. Head to AWS Marketplace to subscribe. It’s useful in a couple of scenarios:
  • 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

1

Edit Environment Variables

Edit environment variables in the relevant file on your EC2 instance:
  • Essential startup values live in /dify/.env. Edit them directly.
  • Optional or provider-specific settings have templates under /dify/envs/. To override a default value, copy the matching template (drop the .example suffix), then edit your copy. For example:
    cd /dify
    cp envs/vectorstores/opensearch.env.example envs/vectorstores/opensearch.env
    
Values in /dify/.env take precedence over values in any /dify/envs/*.env files.If your AWS deployment injects variables through docker-compose.override.yaml, keep those settings there. Service-level environment: values in Compose take precedence over env-file values.
2

Restart Dify

docker compose down
docker compose -f docker-compose.yaml -f docker-compose.override.yaml up -d

Web App Logo & Branding

In Settings > Customization, you can remove the Powered by Dify branding or replace it with your own logo.

Upgrade

  • Before upgrading, check the Release Notes on GitHub for version-specific upgrade instructions. Some versions may require additional steps such as database migrations or configuration changes.
  • Dify’s Docker Compose files now require Docker Compose 2.24.0 or later. Run docker compose version to confirm before upgrading.
In the EC2 instance, run the following commands:
1

Stop the Running Services

cd /dify
docker compose down
2

Back Up Your Data

Back up your .env file, any optional env files you created under envs/, and the volumes directory, which contains your database, storage, and other persistent data:
cp /dify/.env /dify/.env.bak
tar -cvf envs-$(date +%s).tgz envs
tar -cvf volumes-$(date +%s).tgz volumes
3

Update Dify

The upgrade process will overwrite configuration templates but will not affect your .env file, local /dify/envs/*.env files, or runtime data (such as databases and uploaded files) in the volumes/ directory.If you have manually modified configuration files beyond .env and /dify/envs/*.env, back them up before upgrading.
Pull the latest code and sync the configuration files:
git clone https://github.com/langgenius/dify.git /tmp/dify
rsync -av /tmp/dify/docker/ /dify/
rm -rf /tmp/dify
4

Check for New Environment Variables

New versions may introduce variables in .env.example or in optional templates under envs/. Compare each template with its matching local env file and add any missing variables you need:
diff /dify/.env /dify/.env.example
find /dify/envs -name "*.env" -print | while read -r env_file; do
  diff "$env_file" "$env_file.example"
done
If you need to customize a newly added optional template, copy it beside itself without the .example suffix before editing it. See Configuration for details.
5

Start Services

docker compose pull
docker compose -f docker-compose.yaml -f docker-compose.override.yaml up -d