Skip to main content
For common deployment questions, see FAQs.

Before Deployment

Make sure your machine meets the following minimum system requirements.

Hardware

  • CPU >= 2 Core
  • RAM >= 4 GiB

Software

Deploy and Start

1

Clone Dify

Clone the Dify source code to your local machine.
2

Start Dify

  1. Navigate to the docker directory in the Dify source code:
  2. Copy the example environment configuration file:
    When the frontend and backend run on different subdomains, set COOKIE_DOMAIN to the site’s top-level domain (e.g., example.com) and set NEXT_PUBLIC_COOKIE_DOMAIN to 1 in the .env file.The frontend and backend must be under the same top-level domain to share authentication cookies.
  3. Start the containers using the command that matches your Docker Compose version:
    Run docker compose version to check your Docker Compose version.
    The following containers will be started:
    • 5 core services: api, worker, worker_beat, web, plugin_daemon
    • 6 dependent components: weaviate, db_postgres, redis, nginx, ssrf_proxy, sandbox
    You should see output similar to the following, showing the status and start time of each container:
  4. Verify that all containers are running successfully:
    You should see output similar to the following, with each container in the Up or healthy status:

Access

  1. Open the administrator initialization page to set up the admin account:
  2. After completing the admin account setup, log in to Dify at:

Customize

Modify the environment variable values in your local .env file, then restart Dify to apply the changes:
For more information, see environment variables.

Upgrade

Upgrade steps may vary between releases. Refer to the upgrade guide for your target version provided in the Releases page.
After upgrading, check whether the .env.example file has changed and update your local .env file accordingly.