Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions en/self-host/advanced-deployments/local-source-code.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,10 @@ A series of middlewares for storage (e.g. PostgreSQL / Redis / Weaviate (if not
```bash
cd docker

cp middleware.env.example middleware.env
cp envs/middleware.env.example middleware.env

# change the profile to mysql if you are not using postgresql
# change the profile to other vector database if you are not using weaviate
docker compose -f docker-compose.middleware.yaml --profile postgresql --profile weaviate -p dify up -d
# Change DB_TYPE or COMPOSE_PROFILES in middleware.env if you are not using PostgreSQL and Weaviate.
docker compose --env-file middleware.env -f docker-compose.middleware.yaml -p dify up -d
```

---
Expand Down
21 changes: 18 additions & 3 deletions en/self-host/configuration/environments.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,23 @@ title: Environment Variables
description: Reference for all environment variables used by Dify self-hosted deployments
---

Dify works out of the box with default settings. You can customize your deployment by modifying the environment variables in the `.env` file.
Dify works out of the box with default settings. To customize your deployment, edit environment variables in the relevant file:

- **Essential startup values** live in `docker/.env`, which you created from `docker/.env.example` during deployment. Edit them directly.

- **Optional or provider-specific settings** have templates under `docker/envs/`. To override a default value, copy the matching template (drop the `.example` suffix), then edit your copy.

For example:

```bash
cd dify/docker
cp envs/vectorstores/milvus.env.example envs/vectorstores/milvus.env
```

Values in `docker/.env` take precedence over values in any `docker/envs/*.env` files.

<Tip>
After upgrading Dify, run `diff .env .env.example` in the `docker` directory to check for newly added or changed variables, then update your `.env` file accordingly.
After upgrading Dify, compare each `.env.example` with its matching `.env` for new or changed variables.
</Tip>

## Common Variables
Expand Down Expand Up @@ -1294,6 +1307,8 @@ These configure the Squid-based SSRF proxy container that blocks requests to int

## Docker Compose

These variables stay in `docker/.env` because Docker Compose uses them to select profiles and expose ports before containers start.

| Variable | Default | Description |
|---|---|---|
| `COMPOSE_PROFILES` | `${VECTOR_STORE:-weaviate},${DB_TYPE:-postgresql}` | Automatically selects which service containers to start based on your database and vector store choices. For example, setting `DB_TYPE=mysql` starts MySQL instead of PostgreSQL. |
Expand Down Expand Up @@ -1614,4 +1629,4 @@ The plugin daemon can store plugin packages in different storage backends. Confi
| `PLUGIN_VOLCENGINE_TOS_REGION` | (empty) | Volcengine TOS region. |

</Accordion>
</AccordionGroup>
</AccordionGroup>
57 changes: 43 additions & 14 deletions en/self-host/platform-guides/dify-premium.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: Dify Premium on AWS
description: Deploy, customize, and upgrade Dify Premium on AWS
---

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](https://aws.amazon.com/marketplace/pp/prodview-t22mebxzwjhu6) to subscribe. It's useful in a couple of scenarios:
Expand All @@ -18,12 +19,32 @@ If this is your first time accessing Dify, enter the Admin initialization passwo

### Configuration

Just like a self-hosted deployment, you may modify the environment variables in the `.env` file in your EC2 instance as you see fit. Then, restart Dify with:
<Steps>
<Step title="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.

```bash
docker-compose down
docker-compose -f docker-compose.yaml -f docker-compose.override.yaml up -d
```
For example:

```bash
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.
</Step>
<Step title="Restart Dify">
```bash
docker compose down
docker compose -f docker-compose.yaml -f docker-compose.override.yaml up -d
```
</Step>
</Steps>

### Web App Logo & Branding

Expand All @@ -32,7 +53,9 @@ In **Settings** > **Customization**, you can remove the `Powered by Dify` brandi
## Upgrade

<Warning>
Before upgrading, check the [Release Notes](https://github.com/langgenius/dify/releases) on GitHub for version-specific upgrade instructions. Some versions may require additional steps such as database migrations or configuration changes.
- Before upgrading, check the [Release Notes](https://github.com/langgenius/dify/releases) 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.
</Warning>

In the EC2 instance, run the following commands:
Expand All @@ -41,22 +64,23 @@ In the EC2 instance, run the following commands:
<Step title="Stop the Running Services">
```bash
cd /dify
docker-compose down
docker compose down
```
</Step>
<Step title="Back Up Your Data">
Back up your `.env` file and the `volumes` directory, which contains your database, storage, and other persistent 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:

```bash
cp /dify/.env /dify/.env.bak
tar -cvf envs-$(date +%s).tgz envs
tar -cvf volumes-$(date +%s).tgz volumes
```
</Step>
<Step title="Update Dify">
<Warning>
The upgrade process will overwrite configuration files but will not affect your `.env` file or runtime data (such as databases and uploaded files) in the `volumes/` directory.
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 any configuration files beyond `.env`, back them up before upgrading.
If you have manually modified configuration files beyond `.env` and `/dify/envs/*.env`, back them up before upgrading.
</Warning>

Pull the latest code and sync the configuration files:
Expand All @@ -68,16 +92,21 @@ In the EC2 instance, run the following commands:
```
</Step>
<Step title="Check for New Environment Variables">
New versions may introduce new environment variables in `.env.example`. Compare it with your current `.env` and add any missing 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:

```bash
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](#configuration) for details.
</Step>
<Step title="Start Services">
```bash
docker-compose pull
docker-compose -f docker-compose.yaml -f docker-compose.override.yaml up -d
docker compose pull
docker compose -f docker-compose.yaml -f docker-compose.override.yaml up -d
```
</Step>
</Steps>
</Steps>
81 changes: 49 additions & 32 deletions en/self-host/quick-start/docker-compose.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,11 @@ Make sure your machine meets the following minimum system requirements.

### Software

| Operating System | Required Software | Notes |
| :----------------------------- | :---------------------------------------- | :----- |
| macOS 10.14 or later | Docker Desktop | Configure the Docker virtual machine with at least 2 virtual CPUs and 8 GiB of memory. <br></br><br></br>For installation instructions, see [Install Docker Desktop on Mac](https://docs.docker.com/desktop/mac/install/). |
| Linux distributions | Docker 19.03+<br></br><br></br>Docker Compose 1.28+ | For installation instructions, see [Install Docker Engine](https://docs.docker.com/engine/install/) and [Install Docker Compose](https://docs.docker.com/compose/install/). |
| Windows with WSL 2 enabled | Docker Desktop | Store source code and data bound to Linux containers in the Linux file system rather than Windows. <br></br><br></br>For installation instructions, see [Install Docker Desktop on Windows](https://docs.docker.com/desktop/windows/install/#wsl-2-backend). |

| Operating System | Required Software | Notes |
| :----------------------------- | :---------------------------------------- | :----- |
| macOS 10.14 or later | Docker Desktop with Docker Compose 2.24.0+ | Configure the Docker virtual machine with at least 2 virtual CPUs and 8 GiB of memory. <br></br><br></br>For installation instructions, see [Install Docker Desktop on Mac](https://docs.docker.com/desktop/mac/install/). |
| Linux distributions | Docker 19.03+<br></br><br></br>Docker Compose 2.24.0+ | For installation instructions, see [Install Docker Engine](https://docs.docker.com/engine/install/) and [Install Docker Compose](https://docs.docker.com/compose/install/). |
| Windows with WSL 2 enabled | Docker Desktop with Docker Compose 2.24.0+ | Store source code and data bound to Linux containers in the Linux file system rather than Windows. <br></br><br></br>For installation instructions, see [Install Docker Desktop on Windows](https://docs.docker.com/desktop/windows/install/#wsl-2-backend). |

## Deploy and Start

Expand All @@ -33,6 +32,7 @@ Make sure your machine meets the following minimum system requirements.

```bash
git clone --branch "$(curl -s https://api.github.com/repos/langgenius/dify/releases/latest | jq -r .tag_name)" https://github.com/langgenius/dify.git

```
</Step>
<Step title="Start Dify">
Expand All @@ -43,26 +43,22 @@ Make sure your machine meets the following minimum system requirements.
cd dify/docker
```

2. Copy the example environment configuration file:
2. Copy the essential environment configuration file:

```bash
cp .env.example .env
cp .env.example .env
```

3. Start the containers using the command that matches your Docker Compose version:
To customize your deployment later, see [Customize](#customize).

<CodeGroup>
```bash Docker Compose V2
docker compose up -d
```
```bash Docker Compose V1
docker-compose up -d
```
</CodeGroup>
3. Start the containers:
<Note>
Dify requires Docker Compose 2.24.0 or later. Run `docker compose version` to confirm.
</Note>

<Tip>
Run `docker compose version` to check your Docker Compose version.
</Tip>
```bash
docker compose up -d
```

The following containers will be started:

Expand Down Expand Up @@ -110,6 +106,7 @@ Make sure your machine meets the following minimum system requirements.
docker-worker-1 langgenius/dify-api:1.10.1 "/bin/bash /entrypoi…" worker 26 seconds ago Up 22 seconds 5001/tcp
docker-worker_beat-1 langgenius/dify-api:1.10.1 "/bin/bash /entrypoi…" worker_beat 26 seconds ago Up 22 seconds 5001/tcp
```

</Step>
</Steps>

Expand Down Expand Up @@ -137,23 +134,43 @@ Make sure your machine meets the following minimum system requirements.

## Customize

Modify the environment variable values in your local `.env` file, then restart Dify to apply the changes:
To customize your deployment, edit environment variables in the relevant file, then restart Dify.

```bash
docker compose down
docker compose up -d
```
<Steps>
<Step title="Edit Environment Variables">

<Tip>
For more information, see [environment variables](/en/self-host/configuration/environments).
</Tip>
- **Essential startup values** live in `docker/.env`, which you created from `docker/.env.example` during deployment. Edit them directly.

- **Optional or provider-specific settings** have templates under `docker/envs/`. To override a default value, copy the matching template (drop the `.example` suffix), then edit your copy.

For example:

```bash
cd dify/docker
cp envs/vectorstores/milvus.env.example envs/vectorstores/milvus.env
```

Values in `docker/.env` take precedence over values in any `docker/envs/*.env` files.

<Tip>
For descriptions of every variable, see [Environment Variables](/en/self-host/configuration/environments).
</Tip>

</Step>
<Step title="Restart Dify">

```bash
docker compose down
docker compose up -d
```

</Step>
</Steps>

## Upgrade

Upgrade steps may vary between releases. Refer to the upgrade guide for your target version provided in the [Releases](https://github.com/langgenius/dify/releases) page.

<Note>

After upgrading, check whether the `.env.example` file has changed and update your local `.env` file accordingly.

</Note>
After upgrading, compare each `.env.example` with its matching `.env` for new or changed variables.
</Note>
7 changes: 3 additions & 4 deletions ja/self-host/advanced-deployments/local-source-code.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,10 @@ git clone https://github.com/langgenius/dify.git
```bash
cd docker

cp middleware.env.example middleware.env
cp envs/middleware.env.example middleware.env

# postgresql を使用していない場合は profile を mysql に変更してください
# weaviate を使用していない場合は profile を他のベクターデータベースに変更してください
docker compose -f docker-compose.middleware.yaml --profile postgresql --profile weaviate -p dify up -d
# PostgreSQL と Weaviate を使用しない場合は、middleware.env の DB_TYPE または COMPOSE_PROFILES を変更してください。
docker compose --env-file middleware.env -f docker-compose.middleware.yaml -p dify up -d
```

## バックエンドサービスのセットアップ
Expand Down
15 changes: 13 additions & 2 deletions ja/self-host/configuration/environments.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,21 @@ description: Dify セルフホストデプロイで使用されるすべての

<Note> ⚠️ このドキュメントは AI によって自動翻訳されています。不正確な部分がある場合は、[英語版](/en/self-host/configuration/environments) を参照してください。</Note>

Dify はデフォルト設定でそのまま動作します。`.env` ファイルの環境変数を変更することで、デプロイをカスタマイズできます。
Dify はデフォルト設定でそのまま動作します。デプロイをカスタマイズするには、関連するファイルの環境変数を編集します:

- **必須の起動値** は `docker/.env` にあります(デプロイ時に `docker/.env.example` からコピーして作成したファイル)。直接編集します。

- **オプションまたはプロバイダー固有の設定** は `docker/envs/` にテンプレートとして用意されています。デフォルト値を上書きするには、対応するテンプレートをコピーし(`.example` 拡張子を外す)、コピーを編集します。例:

```bash
cd dify/docker
cp envs/vectorstores/milvus.env.example envs/vectorstores/milvus.env
```

`docker/.env` の値は、`docker/envs/*.env` ファイルの値より優先されます。

<Tip>
Dify をアップグレードした後、`docker`ディレクトリで `diff .env .env.example`を実行して、新しく追加または変更された変数を確認し、`.env` ファイルを適宜更新してください
Dify をアップグレードした後、各 `.env.example` を対応する `.env` と比較し、新規または変更された変数を確認してください
</Tip>

## 共通変数
Expand Down
Loading
Loading