entrypoint.sh).
- Simple to install and update.
Quick Start
1. Prerequisites
- Docker Desktop for Windows or regular Docker for Linux.
- On Windows: Enable WSL2 and GPU support if you want to use your NVIDIA GPU.
- It also works through Portainer-CE, which is the way I use this setup.
- Git (to clone this repo)
2. Clone this repository
git clone https://github.com/Kaouthia/ComfyUI-Docker.git
cd ComfyUI-Docker
3. Prepare persistent folders
On Windows, create these folders (change yourname to your Windows username):
C:\Users\yourname\comfyui\models
C:\Users\yourname\comfyui\output
C:\Users\yourname\comfyui\settings
C:\Users\yourname\comfyui\flows
On Linux, create these folders (change username to your Linux username):
/home/username/comfyui/models
/home/username/comfyui/output
/home/username/comfyui/settings
/home/username/comfyui/flows
And update the paths in docker-compose.yml to match your actual folder locations.
4. Build and run the stack
From the project directory, run:
docker compose up --build
The first run may take several minutes as it downloads the latest version of ComfyUI and its dependencies as well as the latest versions of the custom nodes listed below, along with their dependencies.
- On completion, ComfyUI will be available at: http://localhost:8188
Notes & Troubleshooting
-
Line endings: If you edit
entrypoint.shon Windows, ensure it uses LF (Unix) line endings to avoid container errors. -
Custom nodes: On first running the container, the entrypoint will automatically download several custom nodes including:
- ComfyUI-Manager
- ComfyUI_essentials
- ComfyUI-Crystools
- rgthree-comfy
- ComfyUI-KJNodes
- ComfyUI_UltimateSDUpscale
-
GPU Support: This stack is set up for NVIDIA GPUs. You may need to install NVIDIA Container Toolkit for GPU passthrough to work.
-
Volumes: By default, your models, outputs, and other data persist in the folders you mapped on your host system. Whether you're on Windows or Linux, you'll want to modify these paths to something more suitable for your needs and folder structure.
Updating
The cleanest way to update ComfyUI is to rebuild the image and container. This will force it to pull down the latest version of ComfyUI, along with the latest versions of the included custom nodes defined in entrypoint.sh and any dependencies.
That being said, you can also update and install custom nodes via the ComfyUI-Manager addon. Do note, however, that any custom nodes installed via ComfyUI-Manager will disappear on recreation of the container.
If you want custom nodes to persist through container recreations, add them to entrypoint.sh so that they're downloaded automatically upon rebuilding and running the container.
declare -A REPOS=(
["ComfyUI-Manager"]="https://github.com/ltdrdata/ComfyUI-Manager.git"
["ComfyUI_essentials"]="https://github.com/cubiq/ComfyUI_essentials.git"
["ComfyUI-Crystools"]="https://github.com/crystian/ComfyUI-Crystools.git"
["rgthree-comfy"]="https://github.com/rgthree/rgthree-comfy.git"
["ComfyUI-KJNodes"]="https://github.com/kijai/ComfyUI-KJNodes.git"
["ComfyUI_UltimateSDUpscale"]="https://github.com/ssitu/ComfyUI_UltimateSDUpscale.git"
)
License
See ComfyUI’s license for upstream project licensing. This repository is provided as-is for self-hosting ComfyUI in Docker.
Happy prompting!