Recipes
Self-host ComfyUI with a public URL
Deploy ComfyUI as a Docker Compose app on your own GPU machine and get a public HTTPS endpoint, no port forwarding or static IP required.
This recipe deploys ComfyUI as a Docker Compose app on a machine you control, with Nethera handling the public HTTPS endpoint. See /docs for how Nethera works under the hood.
Why ComfyUI
ComfyUI's checkpoints and LoRAs are large, often several gigabytes each, and workflows are saved as reusable node graphs. Running your own persistent instance means you download a model once and it stays on disk in the comfyui-data volume, rather than re-provisioning storage every time you spin up a session. Your workflow graphs persist the same way.
Requirements
- A target machine with an NVIDIA GPU and the NVIDIA Container Toolkit installed (the
deploy.resources.reservations.devicesblock requires GPU access at the Docker level). - Nethera CLI installed and authenticated.
nethera.yml
appName: comfyuiservices: comfyui: image: mmartial/comfyui-nvidia-docker:ubuntu22_cuda12.4-latest environment: BASE_DIRECTORY: /basedir USE_UV: "true" volumes: - comfyui-run:/comfy/mnt - comfyui-data:/basedir deploy: resources: reservations: devices: - capabilities: [gpu] nethera: public: 8188 # container port exposed publicly over HTTPS auth: login # requires Nethera login before the endpoint is reachablevolumes: comfyui-run: comfyui-data:Deploy
$neth init$neth deployneth init generates the appId and registers the app. neth deploy builds and starts it on the target machine.
Open and verify remotely
After deploy completes, Nethera prints the public HTTPS URL for the app. Open it in a browser. Because auth: login is set, you'll be prompted to authenticate through Nethera before ComfyUI loads, there's no direct anonymous access to port 8188.
Data and config notes
- Model checkpoints, LoRAs, and other assets go under
/basedirinside the container, which is backed by thecomfyui-datavolume, so they survive redeploys. /comfy/mnt(thecomfyui-runvolume) is runtime/working state for ComfyUI itself.USE_UV: "true"tells the image to useuvfor Python dependency management inside the container, this affects first-boot install time, not runtime behavior.- Since there's no bind mount, moving models into the volume means using
docker cp, a container shell, or a download step run from inside the container, not copying files from the host.
Troubleshooting
- Deploy fails or container won't start, GPU not detected: confirm the NVIDIA Container Toolkit is installed and configured on the target machine. The
capabilities: [gpu]reservation will fail the container if the host can't present a GPU to Docker. - First load is slow: with
USE_UV: "true", the image resolves Python dependencies on first boot. Subsequent restarts are faster since the environment is cached in the volume. - Endpoint loads a login screen instead of ComfyUI: expected behavior with
auth: login, authenticate through Nethera first.
FAQ
Can I use ComfyUI remotely, like from my phone or a different network?
Yes. The nethera.yml above exposes it over a public HTTPS URL, so once deployed you reach it the same way from any device or network, no VPN or router configuration needed.
Why not just use a VPN, like Tailscale or WireGuard?
A VPN works well if it's just you, or a small group who already have a client installed. Nethera's endpoint is a normal HTTPS link instead, useful once you want to share access without asking someone to install anything. auth: login still gates who's let through if you want that.
Do I lose my downloaded models if I redeploy?
No, as long as they were saved under /basedir. That path is backed by the comfyui-data named volume, which persists independently of the container lifecycle.
Does this setup work without a GPU?
No. This nethera.yml uses the mmartial/comfyui-nvidia-docker image and reserves GPU resources in the deploy block. Without a compatible NVIDIA GPU and driver stack on the target machine, the container won't start as configured.
Can I redeploy or update this without SSHing into the machine?
Yes, neth deploy from your project directory redeploys in place. If you're managing more than one machine, the same command and nethera.yml work whether you're targeting one or several, see fleet management for pairing multiple machines under one workspace.
Notes
auth: loginis on by default in this config; remove it from the YAML if you want the endpoint open without a Nethera login (not covered here).- No bind mounts are defined, all persistence is through the two named volumes.
appIdand<machine>are placeholders filled in byneth initand your target machine registration, not values to hand-edit.