The official Fooocus container image is built on NVIDIA CUDA 12.4 and PyTorch 2.1, providing a reproducible, isolated runtime that works on any Linux host with an NVIDIA GPU and the NVIDIA Container Toolkit installed. Models and outputs are stored in a named Docker volume (Documentation Index
Fetch the complete documentation index at: https://mintlify.com/lllyasviel/Fooocus/llms.txt
Use this file to discover all available pages before exploring further.
fooocus-data) so they persist across container restarts and image updates. Podman is also supported for rootless deployments.
Prerequisites
- A host machine with proprietary NVIDIA drivers installed
- Docker and Docker Compose, or Podman
- NVIDIA Container Toolkit (for GPU pass-through with Docker)
Running Fooocus
- Docker Compose
- Docker
- Podman
Docker Compose is the recommended method. It handles GPU reservations, volume creation, and environment variables automatically.1. Clone the repository:2. Start the container:To run detached in the background:Then follow the logs:When you see
Use the app with http://0.0.0.0:7865/ in the console output, open that URL in your browser.Updating the container:When running docker compose up continuously, the container is not updated automatically. To rebuild with the latest Fooocus version:Environment Variables
You can configure Fooocus’s runtime behaviour and model paths through environment variables. The values set here take higher priority than anything written inconfig.txt, and they are saved to config_modification_tutorial.txt inside the container.
Container-specific variables
| Variable | Description |
|---|---|
DATADIR | Path to the persistent data directory (default: /content/data) |
CMDARGS | Arguments passed to the Fooocus launcher (e.g. --listen, --preset anime) |
HF_MIRROR | Hugging Face mirror domain for model downloads (useful in regions with restricted access) |
Config path variables
| Variable | Description |
|---|---|
config_path | Location of config.txt |
config_example_path | Location of config_modification_tutorial.txt |
Model path variables
| Variable | Default value |
|---|---|
path_checkpoints | /content/data/models/checkpoints/ |
path_loras | /content/data/models/loras/ |
path_embeddings | /content/data/models/embeddings/ |
path_vae_approx | /content/data/models/vae_approx/ |
path_upscale_models | /content/data/models/upscale_models/ |
path_inpaint | /content/data/models/inpaint/ |
path_controlnet | /content/data/models/controlnet/ |
path_clip_vision | /content/data/models/clip_vision/ |
path_fooocus_expansion | /content/data/models/prompt_expansion/fooocus_expansion/ |
path_outputs | /content/app/outputs/ |
Container Path Reference
| Path | Details |
|---|---|
/content/app | Application directory — Fooocus source code lives here |
/content/app/models.org | Original bundled model stubs. On each boot, files are copied to /content/app/models (which is symlinked to /content/data/models). Existing files are not overwritten. |
/content/data | Persistent volume mount point |
/content/data/models | Symlinked to /content/app/models — all model files live here |
/content/data/outputs | Symlinked to /content/app/outputs — all generated images live here |
Importing Models and Outputs
If you have existing models or output images you want to bring into the container, uncomment the bind-mount lines indocker-compose.yml:
./models and ./outputs on the host will be copied into /content/data/models and /content/data/outputs inside the volume. Because the volume is persistent, you can remove the bind mounts after the first import — your files remain available on every subsequent run.
Building the Image Locally
If you want to build the container image from source rather than pulling fromghcr.io:
- Docker
- Podman
ghcr.io/lllyasviel/fooocus with fooocus in your run command or update the image: line in docker-compose.yml.
Notes
Keep
path_outputs under /content/app — if you move path_outputs outside of /content/app, the in-browser history log will not be able to display your generated images. The default value /content/app/outputs/ is safe to use as-is.Volume performance on Mac and Windows — Docker on Mac and Windows can exhibit slow volume access when using bind mounts. Use named volumes (the default
fooocus-data volume) rather than bind mounts to avoid performance issues. See the Docker volumes documentation for details.