> ## Documentation Index
> Fetch the complete documentation index at: https://enterprise-docs.dify.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Docker Compose

## Requirements

* Release Log: [https://langgenius.github.io/dify-enterprise-docker-compose/](https://langgenius.github.io/dify-enterprise-docker-compose/)
* Docker
* Docker Compose
* Linux Server
  * **Warning**: Don't support Docker Desktop for Windows and Mac.
  * Minimum: 4 CPU cores, 16 GB memory, 100 GB disk space.

## Quick Start

### Download

Download a specific version from Dify Enterprise [repository](https://langgenius.github.io/dify-enterprise-docker-compose/).

Using wget:

```bash theme={null}
wget https://langgenius.github.io/dify-enterprise-docker-compose/dify-docker-compose-<version>.tgz
```

Using curl:

```bash theme={null}
curl -O https://langgenius.github.io/dify-enterprise-docker-compose/dify-docker-compose-<version>.tgz
```

## Installation

1. Extract the contents of the downloaded file to your deployment directory.

   ```bash theme={null}
   mkdir dify-enterprise
   tar -xzf dify-docker-compose-<version>.tgz -C ./dify-enterprise/
   ```

2. Start docker compose.

   ```bash theme={null}
   cd dify-enterprise
   docker compose up -d
   ```

3. How to Access Dify Enterprise.
   * Get the IP address of your server and change the hosts file on your local machine to point the domain to the IP address.
   ```bash theme={null}
   4.152.1.216 console.dify.local
   4.152.1.216 app.dify.local
   4.152.1.216 api.dify.local
   4.152.1.216 upload.dify.local
   4.152.1.216 enterprise.dify.local
   4.152.1.216 trigger.dify.local
   ```

4. [Verify Dify Services Status.](/versions/3-0-x/en-us/deployment/verify-services-status)

5. [License Activation.](/versions/3-0-x/en-us/deployment/license-activation)

## Upgrade From Community Edition

1. Create the enterprise database (make sure your community version is running).

   ```bash theme={null}
   docker exec -it dify-db-1 psql -U postgres -c "CREATE DATABASE enterprise;" -c "CREATE DATABASE audit;"
   ```

   **Tip:** You may need to adjust the container name based on your running containers. Use `docker container ls` to find the name of the `db` service.

2. Shut down the community version.

   ```bash theme={null}
   docker compose down
   ```

3. Backup your data and settings (you may need to use `sudo`).

   ```bash theme={null}
   tar -czf backup.tgz volumes .env # add other customized files and folders if any.
   ```

4. Delete all files and folders from the Community version, except for the `backup.tgz` and `dify-docker-compose-<version>.tgz`.

5. Extract the contents of the downloaded file to your deployment directory.

   ```bash theme={null}
   tar -xzf dify-docker-compose-<version>.tgz -C /path/to/directory
   ```

6. Restore your backup by deleting the `volumes` folder.

   ```bash theme={null}
   rm -rf volumes
   ```

   Then run:

   ```bash theme={null}
   tar -xzf backup.tgz
   ```

7. If you have custom configurations (e.g., `docker-compose.yaml`, `ssrf_proxy/squid.conf`, or `nginx/conf.d/default.conf`), update the corresponding files with your changes.

8. Start docker compose.

   ```bash theme={null}
   docker compose up -d
   ```

9. How to Access Dify Enterprise.
   * Get the IP address of your server and change the hosts file on your local machine to point the domain to the IP address.
   ```bash theme={null}
   4.152.1.216 console.dify.local
   4.152.1.216 app.dify.local
   4.152.1.216 api.dify.local
   4.152.1.216 upload.dify.local
   4.152.1.216 enterprise.dify.local
   4.152.1.216 trigger.dify.local
   ```

10. [Verify Dify Services Status.](/versions/3-0-x/en-us/deployment/verify-services-status)

11. [License Activation.](/versions/3-0-x/en-us/deployment/license-activation)

## Upgrade From Previous Enterprise Edition

1. Backup your data and settings (you may need to use sudo).

   ```bash theme={null}
   tar -czf backup.tgz volumes .env # add other customized files and folders if any
   ```

2. Delete all files and folders from the Community version, except for the `backup.tgz` and `dify-docker-compose-<version>.tgz`.

3. Extract the contents of the downloaded file to your deployment directory.

   ```bash theme={null}
   tar -xzf dify-docker-compose-<version>.tgz -C /path/to/directory
   ```

4. Restore your backup by deleting the `volumes` folder.

   ```bash theme={null}
   rm -rf volumes
   ```

   Then run:

   ```bash theme={null}
   tar -xzf backup.tgz
   ```

5. If you have custom configurations (e.g., `docker-compose.yaml`, `ssrf_proxy/squid.conf`, or `nginx/conf.d/default.conf`), update the corresponding files with your changes.

6. Start docker compose:

   ```bash theme={null}
   docker compose up -d
   ```

## Advanced Configuration

### Domain Requirements

Dify Enterprise requires 6 domains to be set up. The domains are:

* Console: console.dify.local
* Services API: api.dify.local
* APP: app.dify.local
* Files: upload.dify.local
* Enterprise: enterprise.dify.local
* Trigger: trigger.dify.local

To change this, add the relevant configurations to the `.env` file in your deployment directory.

```bash theme={null}
# .env

CONSOLE_API_URL="http://console.dify.local"
CONSOLE_WEB_URL="http://console.dify.local"
SERVICE_API_URL="http://api.dify.local"
APP_API_URL="http://app.dify.local"
APP_WEB_URL="http://app.dify.local"
FILES_URL="http://upload.dify.local"
ENTERPRISE_URL="http://enterprise.dify.local"
TRIGGER_URL="http://trigger.dify.local"
```

​

### Persistence Storage

By defualt, Enterprise Edition uses **local storage**. To change this, add the relevant configurations in the `.env` file in your deployment directory. For example, to use **AWS S3**:

```bash theme={null}
# .env

STORAGE_TYPE=s3

S3_USE_AWS_MANAGED_IAM=
S3_ENDPOINT=
S3_REGION=
S3_BUCKET_NAME=
S3_ACCESS_KEY=
S3_SECRET_KEY=
```

For configurations for other storage options, refer to the [File Storage Configuration](https://docs.dify.ai/getting-started/install-self-hosted/environments#file-storage-configuration).

### Postgres Database

To change this, add the relevant configurations to the `.env` file in your deployment directory.

```bash theme={null}
# .env

DB_USERNAME=postgres
DB_PASSWORD=difyai123456
DB_HOST=db
DB_PORT=5432
DB_DATABASE=dify
```

For configurations for other databases, refer to the [Database Configuration](https://docs.dify.ai/getting-started/install-self-hosted/environments#database-configuration).

### Redis Database

To change this, add the relevant configurations to the `.env` file in your deployment directory.

```bash theme={null}
# .env

REDIS_HOST=redis
REDIS_PORT=6379
REDIS_USERNAME=
REDIS_PASSWORD=difyai123456
REDIS_USE_SSL=false
REDIS_DB=0
```

For configurations for other databases, refer to the [Redis Configuration](https://docs.dify.ai/getting-started/install-self-hosted/environments#redis-configuration).

### Vector Database

By defualt, Enterprise Edition uses **Weaviate** as vector database. To change this, add the relevant configurations to the `.env` file in your deployment directory. For example, to use **Qdrant**:

```bash theme={null}
# .env

VECTOR_STORE=qdrant

QDRANT_URL=http://qdrant:6333
QDRANT_API_KEY=difyai123456
QDRANT_CLIENT_TIMEOUT=20
QDRANT_GRPC_ENABLED=false
QDRANT_GRPC_PORT=6334
```

For configurations for other vector databases, refer to the [Vector Database Configuration](https://docs.dify.ai/getting-started/install-self-hosted/environments#vector-database-configuration).

### Additional Configuration

For additional configuration options, refer to the [Environment Variables Explanation](https://docs.dify.ai/getting-started/install-self-hosted/environments).
