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.
This command requires
git, curl, and jq. If you see a command not found error, install the missing tool and run the command again.2
Start Dify
-
Navigate to the
dockerdirectory in the Dify source code: -
Copy the essential environment configuration file:
To customize your deployment later, see Customize.
-
Start the containers:
Dify requires Docker Compose 2.24.0 or later. Run
docker compose versionto confirm.The following containers will be started:- 6 core services:
api,api_websocket,worker,worker_beat,web,plugin_daemon - 6 dependent components:
weaviate,db_postgres,redis,nginx,ssrf_proxy,sandbox - 1 one-time task:
init_permissions, which sets storage file permissions and exits when done (anExitedstatus is expected)
- 6 core services:
-
Verify that all containers are running successfully:
Each container should be 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
To customize your deployment, edit environment variables in the relevant file, then restart Dify.1
Edit Environment Variables
-
Essential startup values live in
docker/.env, which you created fromdocker/.env.exampleduring deployment. Edit them directly. -
Optional or provider-specific settings have templates under
docker/envs/. To override a default value, copy the matching template (drop the.examplesuffix), then edit your copy. For example:
docker/.env take precedence over values in any docker/envs/*.env files.2
Restart Dify
Upgrade
Upgrade steps may vary between releases. Refer to the upgrade guide for your target version provided in the Releases page.After upgrading, compare each
.env.example with its matching .env for new or changed variables.