// SHARE COMFYUI OR A DASHBOARD FROM YOUR GPU

Share ComfyUI or a dashboard from your GPU

Coming soon: app links aren't switched on for MatMul accounts yet. This guide describes how they will work. Until then, reach an app on your instance over SSH port forwarding (ssh -L 8188:localhost:8188 …, using the SSH command from the console).

Running ComfyUI, Jupyter or a training dashboard on a MatMul instance? Expose its port and you get a public HTTPS link you can open in a browser or send to a teammate. No SSH tunnels, no firewall rules.

How it works

Each instance runs a small Cloudflare Tunnel connector that dials out from the machine. When you expose a port, MatMul gives it an unguessable hostname like 8188-k3j9x2m1qa on a separate apps domain (never matmul.cloud, so an app can't touch your console session) and routes that hostname through the tunnel to localhost:<port> on the machine. The port itself isn't opened on the machine's public IP.

Your app must be listening on that port on the machine. Binding to 0.0.0.0 or to localhost both work. If you launched an image, it runs with host networking, so a port the container listens on is the same port on the machine.

A public link means public

Anyone with the link can reach the app. The hostname is random and hard to guess, but it isn't a password. ComfyUI and many dashboards have no login of their own, so treat the link like a shared secret: send it only to people you trust, and remove it when you're done. Links behind your MatMul sign-in are planned but not built yet.

Expose a port at launch

Pass --expose once per port. It works with an image or with the plain VM:

matmul instance create --name dev --gpu L40S --image <your-image> --expose 8188 --wait

In the console, fill in Expose ports (public links) in the launch dialog. The links appear under Apps on the instance page.

Expose, list and remove later

You can add links to a running instance at any time, by name or id:

matmul expose dev 8188      # prints the URL
matmul ports dev            # every link on the instance
matmul unexpose dev 8188    # the app keeps running; only the link goes away

matmul instance get dev also lists the links. In the console, use the Apps card on the instance page to open, copy or remove a link, or to expose another port. Terminating the instance removes all of its links.

From Python: client.expose_port("dev", 8188), client.unexpose_port("dev", 8188) and client.ports("dev"); pass expose=[8188] to create_instance.

Walkthrough: ComfyUI

ComfyUI serves its UI on port 8188. Launch any ComfyUI image (a community image or your own build) and expose that port:

matmul instance create --name comfy --gpu L40S \
  --image <a-comfyui-image> --expose 8188 --wait

Or on a machine that's already running, start ComfyUI yourself and expose it afterwards. On the plain VM:

matmul ssh comfy
git clone https://github.com/comfyanonymous/ComfyUI && cd ComfyUI
pip install -r requirements.txt
python main.py --port 8188          # listens on localhost, which is fine

Then, from your laptop:

matmul expose comfy 8188

Open the URL it prints. ComfyUI has no login, so anyone you share that URL with can queue work on your GPU; remove the link with matmul unexpose comfy 8188 when you're finished.

Any other app: a quick test

To check the path end to end, serve a folder with Python's built-in web server:

matmul ssh dev -- python3 -m http.server 3000   # leave this running
matmul expose dev 3000                           # in another terminal

The URL shows the directory listing. The same works for Jupyter (8888), TensorBoard (6006), Gradio (7860) or your own service.

Limits and errors

Setting up the CLI? Create a key on the CLI & API page of the console. Stuck? See Troubleshooting.

← All docs