Updated on 2026-09-16 GMT+08:00

Deploying Dify

Scenarios

Dify is an open-source platform for developing large language model (LLM) applications. You can use Dify to integrate your enterprise or personal knowledge base into LLM applications and create custom AI Q&A solutions. You can also integrate the solutions into your service environment to improve user experience.

This section describes how to use the Dify application image to quickly set up an LLM-based knowledge base Q&A system.

Step 1: Deploy a FlexusL Instance with the Dify Application Image

You can deploy the Dify application image on a new or an existing FlexusL instance.

  1. Log in to the FlexusL console and click Buy FlexusL.
  1. Specify required parameters for the FlexusL instance.

    Parameter

    Example

    Description

    Region

    CN-Hong Kong

    For low network latency and quick resource access, select the region nearest to your target users. After a FlexusL instance is created, its region cannot be changed. Exercise caution when selecting a region.

    Application Images

    Dify

    It is an agent development platform based on the open-source Dify community edition.

    Password

    -

    Set the password for logging in to Dify.

    The default account for logging in to Dify is super@dify.com. It is not a real email address and cannot be used to send or receive emails.

    Instance Specifications

    4 vCPUs | 16 GiB, system disk 180 GiB

    It is recommended that you select 4 vCPUs | 8 GiB or higher for the Dify application image. Select appropriate instance specifications based on your service requirements.

    Instance Name

    Dify-Example

    Enter a custom instance name that is easy to identify, for example, Dify-Example.

    (Optional) Associated Services

    • Data Disk: 10 GiB
    • Host Security
    • Cloud Backup Vault: 70 GB

    You can associate EVS data disks, HSS (basic edition), and cloud backup vaults with your FlexusL instances as needed and set specifications as needed.

    Required Duration

    1 month

    Set the required duration.

    FlexusL supports auto-renewal. Once enabled, FlexusL instances automatically renew before they expire. If you do not enable auto-renewal during purchase, you can still enable it after your FlexusL instances are created. For more information about auto-renewal rules, see Auto-Renewal Rules.

    Quantity

    1

    Set the number of FlexusL instances to be purchased.

  2. Click Next: Confirm.

    On the displayed page, confirm the order details, read and select the agreement, and click Submit.

  3. Select a payment method and complete the payment.
  4. Go back to the FlexusL console and view the purchased FlexusL instance.
  1. Log in to the FlexusL console and check whether the target FlexusL instance is running the Dify application image.

  2. Choose > Change OS on the target FlexusL instance. Select the Dify application image and complete the OS change as instructed. After the change is complete and the FlexusL instance status is running, go to the next step.

    Changing the OS clears the data in all partitions of the system disk, including the system partition. Back up data in advance.

Step 2: Configure Dify

  1. Log in to the FlexusL console.
  2. Click Use Now on the target FlexusL instance. The application details page is displayed.

    Some functions of the Dify application image (such as setting passwords and applying templates) depend on Cloud Operations Center (COC). You need to enable and authorize COC before using these functions. Enable and authorize it as prompted if it is not enabled.

  3. In the Application Management card, view the Dify version and perform related operations.

  4. In the Model Provider card, click Configure API Key.

    You need to subscribe to required Huawei Cloud MaaS models in advance by referring to Subscribing to Built-in Services.

  5. In the displayed dialog box, click Add API Key, enter a name, enter an API key or create a new one, and click OK.

    You can add multiple keys and set different names for them. To switch to a key, select the key and click OK.

  6. Click Access Dify Web UI and then Access Now. If access to the Dify Web UI is not enabled, perform operations in 3 to enable it. Enter the email address (super@dify.com by default) and password to log in to Dify. Then, click Plugins in the upper right corner to view the installed Huawei Cloud MaaS plugin.

    If the plugin version is not the latest, click the version number and then Update. In the displayed dialog box, click Install to upgrade the plugin.

  7. Click Settings under the user avatar in the upper right corner.

  8. In the navigation pane, choose Model Provider to view and manage the used models and API keys.

Step 3: Apply a Dify Agent Template

FlexusL provides multiple Dify agent templates. You can select and apply a template on the application details page of the FlexusL instance. You can also quickly select and apply a template from the shortcut entry on the homepage of the FlexusL instance console.

  1. Go to the application details page of a FlexusL instance. On the Application Templates tab, you can view and search for agent templates provided by FlexusL. Select an appropriate template and click Apply.

  2. In the displayed dialog box, enter the password of Dify. After the password is verified, the system automatically imports the template to Dify.

  3. Click Access Dify Web UI and then Access Now. If access to the Dify Web UI is not enabled, perform operations in 3 to enable it.

    Enter the email address (super@dify.com by default) and password of Dify. After logging in to Dify, you can view the imported template.

  1. Log in to the FlexusL console.
  2. On the Dify Agent Application Templates tab in the lower part of the page, you can view the agent templates provided by FlexusL. Click More to view all templates.

  3. Select an appropriate template and click Apply.
  4. Select the target FlexusL instance (FlexusL instances with the Dify application image are used as an example) and enter the password of Dify. After the password is verified, the system automatically imports the template to Dify.

  5. Click the target FlexusL instance to go to the application details page. Click Access Dify Web UI and then Access Now. If access to the Dify Web UI is not enabled, perform operations in 3 to enable it.

    Enter the email address (super@dify.com by default) and password of Dify. After logging in to Dify, you can view the imported template.

Example of Using a Dify Agent Template

The following uses the intelligent marketing agent template as an example to describe related configuration operations after the template is applied.
  1. On the Dify homepage, click Plugins in the upper right corner to check whether the plugin of the target platform has been installed. The following uses the Huawei Cloud MaaS platform as an example.
    • If the plugin has been installed, go to the next step.

      If the plugin version is not the latest, click the version number and then Update. In the displayed dialog box, click Install to upgrade the plugin.

    • If the plugin is not installed, click Explore Marketplace, search for Huawei Cloud MaaS, and install the plugin.

  2. Click Settings under the user avatar in the upper right corner.

  3. In the navigation pane, choose Model Provider and click Setup for the Huawei Cloud MaaS platform to be configured.

  4. In the API Key Authorization Configuration area, enter the authorization information and click Save. You can also configure the API key of Huawei Cloud MaaS on the FlexusL instance console by referring to 4.
    • Authorization Name: Enter a custom name.
    • API Key: Enter the API key of Huawei Cloud MaaS. You can use an existing API key or go to the Huawei Cloud MaaS console to create a new one.
  5. View and manage the used models and API keys.

  6. On the Studio tab, click the added agent template, for example, the intelligent marketing agent, to access the application workflow.

  7. In the workflow, click the node where you want to configure a model, for example, the node for document editing, and select the corresponding LLM built into Huawei Cloud MaaS.

  8. Modify the prompt as needed.

  9. Click Preview in the upper right corner of the workflow. Enter your requirements in the dialog box and check whether the response is normal.

  10. After verifying that the application is correct, click Publish and then Publish Update in the upper right corner of the workflow. After the application is published, you can share it. For details, see the Dify official documentation.

Helpful Links

  • A FlexusL instance does not have an initial password. After creating a FlexusL instance, you need to set a password before logging in to it. For details, see Resetting the Password for a FlexusL Instance.
  • For details about how to log in to a FlexusL instance, see Login Modes.
  • When you create a FlexusL instance, the system automatically creates a default security group (sg-default-smb) and associates it with the instance. The default security group only allows instances in the security group to communicate with each other but denies all external requests by default. For details about how to add more rules, see Configuring Security Group Rules for a FlexusL Instance.

Troubleshooting

Symptom

Cause

Solution

The password verification fails when the agent template is applied, and a message is displayed indicating that the login fails.

The email address or password is incorrect.

Check whether the email address and password are correct. If you forget the password, reset the Dify password.

The Dify platform page cannot be opened.

Access to the Dify Web UI is disabled, or the Dify service port 80 is not allowed in the security group.

Enable access to the Dify Web UI and ensure that port 80 is allowed in the security group rules. For details, see Access Dify Web UI.