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

# Dify Premium on AWS

> Access, customize, and upgrade an existing Dify Premium instance on AWS

> [!NOTE]
>
> Dify Premium is no longer sold to new customers.

Dify Premium is an AWS Marketplace AMI for running Dify on EC2.

## 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. Run `docker compose version` to check.

**1. Edit Environment Variables**

Put each setting where [Set a Variable](https://docs.dify.ai/en/self-host/deploy/configuration/environments.md#set-a-variable) says it goes:

* Settings Compose reads first, such as `COMPOSE_PROFILES` and `VECTOR_STORE`, and the shared credentials go in `/dify/.env`.
* Settings your AWS deployment already sets in `docker-compose.override.yaml` stay there.
* Every other setting goes in a local `.env` file under `/dify/envs/`, never in a `.defaults` file.

For example, to change an OpenSearch setting, copy its defaults file once, then edit the copy:

```bash theme={null}
cd /dify
cp -n envs/vectorstores/opensearch.defaults envs/vectorstores/opensearch.env
```

**2. Apply Changes**

From `/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`.

```bash theme={null}
cd /dify
docker compose -f docker-compose.yaml -f docker-compose.override.yaml config --quiet
docker compose -f docker-compose.yaml -f docker-compose.override.yaml up -d
```

If a change doesn't take effect, check whether `/dify/.env` or `docker-compose.override.yaml` also sets it: both win over a local file (see [Precedence](https://docs.dify.ai/en/self-host/deploy/configuration/environments.md#precedence)).

### Web App Logo & Branding

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

## Upgrade

> [!WARNING]
>
> Choose a release from the [Release Notes](https://github.com/langgenius/dify/releases) and read its upgrade guide before updating.

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**

1. From `/dify`, stop the deployment so the databases aren't writing while you copy their files:

   ```bash theme={null}
   docker compose -f docker-compose.yaml -f docker-compose.override.yaml stop
   ```

   If you can't stop it, back up the databases with their own dump tools instead.

2. Back up `/dify/.env`, every local `.env` file 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.

3. If your deployment includes `local_sandbox`, also back up its named volumes, mounted at `/home/dify` and `/workspace`. List them with:

   ```bash theme={null}
   docker inspect --format '{{range .Mounts}}{{if eq .Type "volume"}}{{println .Name .Destination}}{{end}}{{end}}' "$(docker compose -f docker-compose.yaml -f docker-compose.override.yaml ps --all --quiet local_sandbox)"
   ```

**2. Update to the Selected Release**

Replace `<version>` with the release tag you chose. Copy its Docker files and templates together:

```bash theme={null}
release_tag="<version>"
upgrade_dir="$(mktemp -d)"
git clone --depth 1 --branch "$release_tag" https://github.com/langgenius/dify.git "$upgrade_dir/dify"
rsync -av --exclude='.env' --exclude='*.env' \
  --exclude='docker-compose.override.yaml' --exclude='volumes/' \
  "$upgrade_dir/dify/docker/" /dify/
```

The exclusions preserve your local environment files, AWS override file, and runtime data. Reapply changes to any other custom deployment files from your backup.

**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.

Don't copy a template over your file: that discards your overrides.

> [!NOTE]
>
> If `/dify/.env` doesn't set [`DIFY_AGENT_LOCAL_SANDBOX_AUTH_TOKEN`](https://docs.dify.ai/en/self-host/deploy/configuration/environments#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**

```bash theme={null}
cd /dify
docker compose -f docker-compose.yaml -f docker-compose.override.yaml config --quiet
docker compose -f docker-compose.yaml -f docker-compose.override.yaml pull
docker compose -f docker-compose.yaml -f docker-compose.override.yaml up -d
docker compose -f docker-compose.yaml -f docker-compose.override.yaml ps --all
```

Check that long-running services are `Up` or `healthy` and that `init_permissions` finishes with `Exited (0)`. Then open Dify and check the features that use your custom settings.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.