2026-03-21
ComfyUI Docker: Containerized Setup for Seamless Deployment

Running ComfyUI in Docker keeps it in its own box. Python, PyTorch and every custom node's dependencies live inside a container instead of on your system. You can wipe and rebuild it in minutes, and an update can never break your desktop Python.
There is one catch most guides skip. ComfyUI has no official Docker image. Several popular tutorials tell you to pull comfyui/comfyui, which does not exist on Docker Hub. This guide uses a real, actively maintained image instead, with commands taken from its own documentation.
Most Valuable Takeaways
- There is no official ComfyUI image. This guide uses
yanwk/comfyui-boot, a community image with over 1.7 million pulls that is rebuilt every few days. - Docker works best on Linux and Windows with an Nvidia GPU. On a Mac, the container cannot use the Apple GPU, so use the ComfyUI Desktop app instead.
- GPU access needs one extra piece. Linux needs the NVIDIA Container Toolkit. Windows needs Docker Desktop with WSL2.
- Pick the tag by GPU.
cu130-slim-v2suits RTX 20 series and newer.cu126-slimcovers GTX 10 series. There are also AMD, Intel and CPU tags. - Your files live outside the container. Models, outputs, custom nodes and settings sit in folders on your disk, so updating the image never deletes them.
Is Docker the Right Way to Run ComfyUI?
Docker suits you if you run Linux, run a home server or cloud GPU box, or want several isolated ComfyUI setups. It also suits anyone who has had a custom node break their Python install.
It is not the easiest route for everyone. On Windows, the ComfyUI Portable guide gets you running with less setup. On a Mac, the Desktop app is the only option with GPU acceleration. Our ComfyUI installation guide compares all the options.
If you have used Docker for other tools, such as in our n8n Docker guide, this will feel familiar.
What You Need Before You Start
- An Nvidia GPU with a current driver installed on the host. You do not install a driver inside the container.
- Docker. On Linux, Docker Engine. On Windows, Docker Desktop with the WSL2 backend.
- Disk space. The slim image is about 5.5 GB. Models need far more: plan on 20–50 GB for a few modern models.
- Basic terminal comfort. You will paste a handful of commands.
AMD and Intel GPUs are supported through separate image tags, covered below. A CPU-only tag exists too, but generation on a CPU is very slow.
Step 1: Give Docker Access to Your GPU
On Linux
Install the NVIDIA Container Toolkit using the instructions for your distribution. Then register it with Docker and restart the Docker service:
sudo nvidia-ctk runtime configure --runtime=dockersudo systemctl restart docker
Now test that a container can see your GPU:
docker run --rm --runtime=nvidia --gpus all ubuntu nvidia-smi
If you see the same GPU table that nvidia-smi shows on your host, GPU access works. If you get an error instead, fix it now. ComfyUI will not find the GPU either.
On Windows
Install Docker Desktop and leave the WSL2 backend switched on. Docker Desktop passes your Nvidia GPU through to containers by itself, so there is no toolkit to install. Confirm it works in PowerShell with docker run --rm --gpus all ubuntu nvidia-smi. Docker Desktop does not need the --runtime=nvidia part, so leave it out of any command on Windows.
One performance tip from the image's documentation: reading files from your Windows drives inside WSL2 is slow. Keep your ComfyUI folders inside the WSL2 filesystem, for example in your Ubuntu home folder, rather than on C:\. Large models load much faster that way.
Step 2: Pick the Right Image Tag
The yanwk/comfyui-boot image comes in several tags. The image's README lists them all. These are the ones most people need:
| Tag | Use it for |
|---|---|
cu130-slim-v2 | Nvidia RTX 20 series and newer. CUDA 13.0, Python 3.13. Recommended starting point. |
cu126-slim | Nvidia GTX 10 series and older cards (it also runs on RTX 20 to 40 series). CUDA 12.6, Python 3.12. |
cu130-megapak-pt211 | The same as slim, plus dozens of custom nodes and build tools preinstalled. Much bigger download. |
rocm / rocm7 | AMD GPUs with ROCm 7. |
xpu | Intel GPUs. |
cpu | No GPU. For testing only. |
Start with a slim tag. It includes ComfyUI and ComfyUI Manager, plus the common libraries custom nodes need. You add only the nodes you actually use.
Step 3: Create Your Storage Folders
The container keeps nothing important inside itself. Everything you care about lives in folders you create on your disk, mapped into the container. Make a project folder, move into it, and create the layout the image expects:
mkdir -p ~/comfyui-docker && cd ~/comfyui-docker
mkdir -p \
storage-cache/dot-cache \
storage-cache/dot-config \
storage-nodes/dot-local \
storage-nodes/custom_nodes \
storage-models/models \
storage-models/hf-hub \
storage-models/torch-hub \
storage-user/input \
storage-user/output \
storage-user/user-profile \
storage-user/user-scripts
Here is what the important ones hold:
storage-models/models: all your model files, in the usual ComfyUI subfolders such ascheckpoints,diffusion_models,text_encoders,vaeandloras.storage-nodes/custom_nodes: custom nodes you install, with their Python packages instorage-nodes/dot-local.storage-user/output: your generated images and videos.storage-user/user-profile: your saved workflows and ComfyUI settings.
Step 4: Start ComfyUI With Docker Compose
A compose file saves you from retyping a long docker run command. Create docker-compose.yml in your project folder. This version is adapted from the compose file in the image's own repository:
services:
comfyui:
image: yanwk/comfyui-boot:cu130-slim-v2
container_name: comfyui
init: true
ports:
- "8188:8188"
volumes:
- ./storage-cache/dot-cache:/root/.cache
- ./storage-cache/dot-config:/root/.config
- ./storage-nodes/dot-local:/root/.local
- ./storage-nodes/custom_nodes:/root/ComfyUI/custom_nodes
- ./storage-models/models:/root/ComfyUI/models
- ./storage-models/hf-hub:/root/.cache/huggingface/hub
- ./storage-models/torch-hub:/root/.cache/torch/hub
- ./storage-user/input:/root/ComfyUI/input
- ./storage-user/output:/root/ComfyUI/output
- ./storage-user/user-profile:/root/ComfyUI/user
- ./storage-user/user-scripts:/root/user-scripts
environment:
- CLI_ARGS=
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities: [gpu]
Then start it:
docker compose up -d
Follow the startup log with docker compose logs -f. The first start takes a few minutes, because it copies ComfyUI into place and downloads the image. When the log shows ComfyUI listening on port 8188, open http://localhost:8188 in your browser. Press Ctrl+C to stop following the log. ComfyUI keeps running in the background.
Prefer a Single Command?
The same setup works as one docker run command from the project folder. It matches the image's quick-start example. On Windows, drop --runtime=nvidia and keep --gpus all:
docker run -it --rm \
--name comfyui \
--runtime=nvidia --gpus all \
-p 8188:8188 \
-v "$(pwd)"/storage-cache/dot-cache:/root/.cache \
-v "$(pwd)"/storage-cache/dot-config:/root/.config \
-v "$(pwd)"/storage-nodes/dot-local:/root/.local \
-v "$(pwd)"/storage-nodes/custom_nodes:/root/ComfyUI/custom_nodes \
-v "$(pwd)"/storage-models/models:/root/ComfyUI/models \
-v "$(pwd)"/storage-models/hf-hub:/root/.cache/huggingface/hub \
-v "$(pwd)"/storage-models/torch-hub:/root/.cache/torch/hub \
-v "$(pwd)"/storage-user/input:/root/ComfyUI/input \
-v "$(pwd)"/storage-user/output:/root/ComfyUI/output \
-v "$(pwd)"/storage-user/user-profile:/root/ComfyUI/user \
-v "$(pwd)"/storage-user/user-scripts:/root/user-scripts \
-e CLI_ARGS="" \
yanwk/comfyui-boot:cu130-slim-v2

Step 5: Add Models and Run Your First Image
The models folder starts empty. You can fill it in two ways.
From the interface. Open the workflow menu and choose Browse Templates. Pick a template, and ComfyUI lists the model files it needs. Download each one into the folder it names under storage-models/models.
From your host. Download model files on your computer and drop them straight into storage-models/models/<subfolder>. The container sees them immediately. Press R in the ComfyUI canvas to refresh the model lists.
Then load a workflow and click Run, or press Ctrl+Enter. Finished images land in storage-user/output on your disk.
Not sure which models to start with? Our guide to the best ComfyUI models covers the current options. On an 8 GB card, the quantised models in our ComfyUI GGUF guide are the safest bet.
ComfyUI Manager Is Already Switched On
Since the December 2025 Manager rewrite, ComfyUI only loads Manager when it starts with the --enable-manager flag. Many native installs now show a popup asking you to add it.
This image's start script already passes --enable-manager, so the Manager button is there from the first launch. Use it to install missing custom nodes the usual way. They are saved to storage-nodes/custom_nodes, so they survive image updates. For which node packs are worth installing, see essential ComfyUI custom nodes. For Manager's other errors, see our ComfyUI Manager guide.
Extra Launch Options With CLI_ARGS
Anything you put in CLI_ARGS is passed to ComfyUI at startup. Edit the CLI_ARGS= line in your compose file, then run docker compose up -d again. Useful options from the image's documentation:
--lowvram: splits the model into parts so it fits in less VRAM. Slower, but stops many out-of-memory errors.--fast: enables experimental speed-ups on recent GPUs. It can slightly lower image quality.--disable-smart-memory: offloads models from VRAM more often. It runs slower but uses less memory.--cpu: runs on the CPU only. Useful for testing, far too slow for real work.
Updating ComfyUI in Docker
With the slim-v2 image, you update by pulling a new image, not from inside ComfyUI:
docker compose pulldocker compose up -d
Your models, custom nodes, outputs and workflows stay in their folders, untouched. If a new version breaks something, every build also has a dated tag, such as cu130-slim-v2-20261104. Put that tag in your compose file to go back to a known-good version.
Fix the Most Common ComfyUI Docker Errors
"pull access denied" or "repository does not exist"
You are pulling an image name that does not exist, usually comfyui/comfyui from an outdated tutorial. Use yanwk/comfyui-boot with one of the tags listed above.
"could not select device driver" or "unknown runtime: nvidia"
Docker cannot reach your GPU. On Linux, the NVIDIA Container Toolkit is missing or not registered. Install it, run sudo nvidia-ctk runtime configure --runtime=docker, and restart Docker. On Windows, make sure Docker Desktop is using the WSL2 backend and your Nvidia driver is current.
ComfyUI Starts but Uses the CPU
Check the startup log for the device ComfyUI found. If it shows the CPU, the container was started without GPU access. Run the nvidia-smi test from Step 1 to find out why. Also check you did not leave --cpu in CLI_ARGS.
It Fails on an Older GTX Card
The cu130 images support RTX 20 series and newer, plus GTX 16 series. A GTX 10-series card such as the 1080 needs the cu126-slim tag instead.
"Permission denied" Writing to a Folder
The container runs as root, so files it creates may be owned by root on your host. To edit or delete them, use sudo, or run sudo chown -R $USER:$USER storage-* from the project folder.
"Port is already allocated"
Something else is using port 8188, often another ComfyUI. Stop it, or change the port mapping to "8189:8188" and open http://localhost:8189 instead.
Models Load Very Slowly on Windows
Your folders are probably on a Windows drive and being read through WSL2. Move the project folder into the WSL2 filesystem, as described in Step 1.

Running ComfyUI Docker on a Server or Cloud GPU
The same compose file works on a home server or a rented GPU machine. Two things change.
Access from other devices. The image already starts ComfyUI with --listen, so it accepts connections from other machines. Port 8188 is open to anything that can reach the server. Do not expose it to the public internet directly. ComfyUI has no login, so put it behind a VPN or an authenticated reverse proxy. Our ComfyUI remote access guide covers the safe ways to do this.
Choosing a cloud GPU. If you do not own a suitable card, renting one by the hour is often cheaper than buying. Our RunPod vs AWS for ComfyUI comparison breaks down the costs.
Frequently Asked Questions
Is there an official ComfyUI Docker image?
No. ComfyUI does not publish an official Docker image, and comfyui/comfyui does not exist on Docker Hub. Community images fill the gap. yanwk/comfyui-boot is one of the most widely used and is rebuilt every few days.
Do I need a GPU to run ComfyUI in Docker?
Not strictly, because the image has a CPU-only tag. But generating images on a CPU is very slow, so treat it as a test mode. For real work, use an Nvidia GPU, or an AMD or Intel GPU with the matching tag.
Can I run ComfyUI in Docker on a Mac?
You can start it, but it will not use the Apple GPU. Docker containers on macOS have no access to Metal, and these images are built for x86 machines. On a Mac, use the ComfyUI Desktop app for GPU acceleration.
Where are my models and images stored?
Outside the container, in the folders you created. Models go in storage-models/models, and generated images appear in storage-user/output. Deleting or updating the container does not touch them.
How do I update ComfyUI running in Docker?
Run docker compose pull, then docker compose up -d. This downloads the newest image and restarts ComfyUI with it. Your models, custom nodes and workflows stay in place.
Next Steps
Once ComfyUI runs in Docker, the next step is choosing models that fit your graphics card. Start with our guide to the best ComfyUI models. To version-control your workflows alongside the container setup, see our ComfyUI Git guide.
Enjoyed this one?
Get The Streamlined CEO — one email a week on what’s actually worth automating.