Installation

You can start on Dify Cloud or self-host Community Edition. Official minimum hardware: CPU ≥ 2 cores, RAM ≥ 4 GiB. On a Mac, give the Docker VM at least 2 vCPUs / 8 GiB. You need Docker Compose 2.24.0+ (docker compose version).


Option A: Dify Cloud (fastest)

Sign up at https://cloud.dify.ai. The managed platform includes a free Sandbox—no Docker. Use it to finish Quick Start. Data lives in the cloud; intranet or compliance work belongs in option B.


Option B: Docker Compose self-host

Official advice: clone the latest release tag, not a random main. You need git, curl, and jq (or PowerShell to read the tag).

Linux / macOS:

git clone --branch "$(curl -s https://api.github.com/repos/langgenius/dify/releases/latest | jq -r .tag_name)" https://github.com/langgenius/dify.git
cd dify/docker
cp .env.example .env
docker compose up -d

Windows (PowerShell 7): install Docker Desktop with WSL 2. Keep the repo and Linux-container bind data on the Linux filesystem (under \\wsl$\...), not /mnt/c/...—NTFS mounts are slow and permission-prone.

$tag = (Invoke-RestMethod https://api.github.com/repos/langgenius/dify/releases/latest).tag_name
git clone --branch $tag https://github.com/langgenius/dify.git
Set-Location dify/docker
Copy-Item .env.example .env
docker compose up -d

The first image pull is large. Then:

docker compose ps

Containers should be Up or healthy. The one-shot init_permissions task Exited is expected.


What comes up

The official Compose file starts (names follow the current release and can change):

RoleTypical names
Coreapi, api_websocket, worker, worker_beat, web, plugin_daemon, agent_backend
Depsweaviate (vectors), db_postgres, redis, nginx, sandbox / local_sandbox, SSRF proxies, …
One-shotinit_permissions (fixes storage perms, then exits)

The browser talks to nginx. The console is usually http://localhost. Edit docker/.env (copied from .env.example); extra templates live under docker/envs/. After changes:

docker compose down
docker compose up -d

First admin user

  1. Open http://localhost/install (or http://<server-ip>/install)
  2. Create the admin email and password (first workspace Owner)
  3. Sign in at http://localhost

Only workspace Owner / Admin can add provider keys. Keys apply workspace-wide and bill the provider account (Cloud may also consume platform credits).


Upgrade and backup (self-host)

Data lives in dify/docker/volumes/ (Postgres, uploads, Redis, vectors). Back up that folder and .env before upgrades. Diff the new .env.example for new variables. If you patched docker-compose.yaml, re-apply your edits onto the new file—releases may add required services. Follow the notes on Releases.


Optional: difyctl

Official CLI difyctl lists and runs workspace apps from a terminal, script, or CI (difyctl auth login --host …, difyctl get app, difyctl run app <id> "…"). Cloud host: https://cloud.dify.ai. Self-host must set OPENAPI_ENABLED=true and ENABLE_OAUTH_BEARER=true or login fails. Publishing still centers on the Web App and Service API; the CLI is extra. See docs.dify.ai/en/cli.


Troubleshooting

compose not found? You need the Compose V2 plugin: docker compose (space), version ≥ 2.24.0.

Windows is slow or hits permission errors? Keep the project on the WSL Linux disk, not C:\.

Port 80 busy? Change the nginx mapping or stop whatever owns port 80, then up again.

Just exploring? Use Cloud first; add self-host + Ollama when you need local models.


Next steps

评论