Navigate to the docker directory in the Dify source code:
Copy
cd dify/docker
Copy the example environment configuration file:
Copy
cp .env.example .env
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.
Start the containers using the command that matches your Docker Compose version:
Copy
docker compose up -d
Run docker compose version to check your Docker Compose version.
You should see output similar to the following, showing the status and start time of each container:
Copy
[+] Running 13/13✔ Network docker_ssrf_proxy_network Created 10.0s✔ Network docker_default Created 0.1s✔ Container docker-sandbox-1 Started 0.3s✔ Container docker-db_postgres-1 Healthy 2.8s✔ Container docker-web-1 Started 0.3s✔ Container docker-redis-1 Started 0.3s✔ Container docker-ssrf_proxy-1 Started 0.4s✔ Container docker-weaviate-1 Started 0.3s✔ Container docker-worker_beat-1 Started 3.2s✔ Container docker-api-1 Started 3.2s✔ Container docker-worker-1 Started 3.2s✔ Container docker-plugin_daemon-1 Started 3.2s✔ Container docker-nginx-1 Started 3.4s
Verify that all containers are running successfully:
Copy
docker compose ps
You should see output similar to the following, with each container in the Up or healthy status:
Copy
NAME IMAGE COMMAND SERVICE CREATED STATUS PORTSdocker-api-1 langgenius/dify-api:1.10.1 "/bin/bash /entrypoi…" api 26 seconds ago Up 22 seconds 5001/tcpdocker-db_postgres-1 postgres:15-alpine "docker-entrypoint.s…" db_postgres 26 seconds ago Up 25 seconds (healthy) 5432/tcpdocker-nginx-1 nginx:latest "sh -c 'cp /docker-e…" nginx 26 seconds ago Up 22 seconds 0.0.0.0:80->80/tcp, :::80->80/tcp, 0.0.0.0:443->443/tcp, :::443->443/tcpdocker-plugin_daemon-1 langgenius/dify-plugin-daemon:0.4.1-local "/bin/bash -c /app/e…" plugin_daemon 26 seconds ago Up 22 seconds 0.0.0.0:5003->5003/tcp, :::5003->5003/tcpdocker-redis-1 redis:6-alpine "docker-entrypoint.s…" redis 26 seconds ago Up 25 seconds (health: starting) 6379/tcpdocker-sandbox-1 langgenius/dify-sandbox:0.2.12 "/main" sandbox 26 seconds ago Up 25 seconds (health: starting) docker-ssrf_proxy-1 ubuntu/squid:latest "sh -c 'cp /docker-e…" ssrf_proxy 26 seconds ago Up 25 seconds 3128/tcpdocker-weaviate-1 semitechnologies/weaviate:1.27.0 "/bin/weaviate --hos…" weaviate 26 seconds ago Up 25 secondsdocker-web-1 langgenius/dify-web:1.10.1 "/bin/sh ./entrypoin…" web 26 seconds ago Up 25 seconds 3000/tcpdocker-worker-1 langgenius/dify-api:1.10.1 "/bin/bash /entrypoi…" worker 26 seconds ago Up 22 seconds 5001/tcpdocker-worker_beat-1 langgenius/dify-api:1.10.1 "/bin/bash /entrypoi…" worker_beat 26 seconds ago Up 22 seconds 5001/tcp