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
-
Navigate to the
dockerdirectory in the Dify source code: -
Copy the example environment configuration file:
When the frontend and backend run on different subdomains, set
COOKIE_DOMAINto the site’s top-level domain (e.g.,example.com) and setNEXT_PUBLIC_COOKIE_DOMAINto1in the.envfile.The frontend and backend must be under the same top-level domain to share authentication cookies. -
Start the containers using the command that matches 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
- 5 core services:
-
Verify that all containers are running successfully:
You should see output similar to the following, with each container in the
Uporhealthystatus:
Access
-
Open the administrator initialization page to set up the admin account:
-
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:
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.