PotionUI Docs v0.3.0

Install profiles and Docker

PotionUI installs in one of four shapes: everything on one GPU machine, a GPU machine that can add workers later, a machine without a GPU that sends work to a worker, or a worker that only serves another instance. This guide picks the shape for your setup, then covers ports, access from other devices, Docker, updating and stopping.

GuideWritten for v0.3.0
On this page

Which profile for which setup#

A profile decides what the ./potionui command installs and what it starts. Pick the row that matches the machine you are installing on.

You haveProfileWhat gets installedCommand
A GPU in this machinelocalThe full CUDA stack, backend and frontend../potionui start
A GPU here, and room to add remote workers laterhybridThe same packages as local. After start it prints where to add a worker../potionui start --profile hybrid
No GPU here (a VPS or a laptop) that sends work to a workerremoteCPU-only PyTorch with no CUDA libraries. This is not a mode that generates on the CPU../potionui start --profile remote
A GPU machine that only serves another PotionUI instanceworkerThe full CUDA stack, no frontend, no database../potionui worker start

The profile you choose is saved in .runtime/install_profile, so a later plain ./potionui start or ./potionui doctor reuses it instead of falling back to local. --no-gpu still works as another name for --profile remote.

A studio usually runs one of two layouts. Everything on one machine is local. A browser-facing server without a GPU plus one or more GPU machines is remote on the server and worker on each GPU machine; Backends, remote workers and routing connects them.

Platforms

PotionUI runs on Linux and Windows (x86_64) with an NVIDIA graphics card. On native Windows every command reads .\potionui.cmd … instead of ./potionui …, with the same profiles. WSL2 and Docker work too. macOS and AMD GPUs cannot generate locally, because the native engine needs CUDA. The hardware requirements list what each model family needs.

Install and start#

You need Python 3.12 and, for every profile except worker, Node.js 22 or newer (24 LTS recommended). The Install and first run guide has the full prerequisites.

  1. Get the code

    Shellclone
    git clone https://github.com/PotionUI/PotionUI.git potionui && cd potionui
  2. Check the machine

    ./potionui doctor runs every check (Python, Node.js, ffmpeg, the GPU, free disk space, both ports, the storage folder) and prints a repair command for anything missing. Add --profile remote on a machine without a GPU, so the GPU check is informational only.

    Shelldoctor
    ./potionui doctor
  3. Start with your profile

    ./potionui start repeats the blocking checks, creates ./venv, installs the Python and frontend packages if they are missing, then starts the backend and the frontend and waits until both answer.

    Shellstart
    ./potionui start                    # local
    ./potionui start --profile hybrid   # or hybrid
    ./potionui start --profile remote   # or remote
    What you will see

    The profile in use, then PotionUI is up. and an address such as Open: http://localhost:26731. While nobody has claimed the instance, a second line gives the claim code: First-time setup: open http://localhost:26731 and use this claim code if asked: …. With hybrid, a last line points to Admin, Backends, Add backend, Native (Remote Worker).

  4. Create the owner account

    Open the address. The first account created becomes the owner, an administrator. The Install and first run guide walks through it; Claiming from another device below explains when the claim code is asked for.

One process or two

By default ./potionui start runs two processes: the backend and a frontend development server. Run ./potionui build once and later starts serve the built frontend from the backend, as one process on one port. start falls back to two processes on its own when a file under frontend/src is newer than the build, and ./potionui start --dev forces two processes. One port is simpler to put behind a reverse proxy.

Ports and how to change them#

WhatDefaultChange it with
Backend (and the whole app in single-process mode)26730--backend-port or BACKEND_PORT
Frontend development server26731--frontend-port or FRONTEND_PORT
Remote worker7690./potionui worker start --port, or POTIONUI_WORKER_PORT when you run worker.py yourself
Docker image26730The host side of -p

The port options belong to ./potionui itself, so they come before the command:

Shellother ports
./potionui --backend-port 27730 --frontend-port 27731 start

When the default backend port is taken by another program, start picks the next free port and says which one. A port you set yourself is never changed: if it is taken, start stops with an error. python api.py, used by the Docker image, always listens on 26730.

Reaching the app from other devices#

Out of the box PotionUI listens only on 127.0.0.1, so only the machine it runs on can open it. ./potionui start always binds there. To let phones, laptops or other people on your network in, use one of these:

  • Docker. The container listens on all interfaces inside, and the -p flag decides who can reach it. See Docker.
  • ./run.sh --lan (Linux and WSL). Starts the backend on 0.0.0.0 and the frontend development server on all interfaces, and allows requests from any origin. It needs the virtual environment and frontend packages, so run ./potionui start once first, then ./potionui stop.
  • POTIONUI_HOST=0.0.0.0 with python api.py. Binds the backend to every interface on port 26730. After ./potionui build the backend also serves the app itself, so this is one process on one port. You can set the variable in .env.
Shelllocal network
./run.sh 26730 26731 --lan        # then open http://<this-machine>:26731
Security

Anyone who can reach the port can reach the PotionUI login page and its API. PotionUI is designed for hardware you control, on a workstation or a trusted local network. It is not hardened as an internet-facing service, and its own login is not designed to be your only line of defence on an open network. If you expose it beyond a trusted network, put an authenticating reverse proxy in front of it. Open the port only on networks where you trust every device.

Claiming from another device

The first account ever created becomes the owner. A browser on the server itself can create it directly. A browser on any other device must also enter a Claim code, a one-time code that only someone with access to the server's files or console can read. This stops a stranger on your network from claiming a fresh instance before you do.

  • ./potionui start prints the code once the server is up.
  • It is stored in storage/setup_claim_token, readable only by the account that runs PotionUI. In Docker it is /app/storage/setup_claim_token inside the container: docker exec <container> cat /app/storage/setup_claim_token.
  • The file is deleted once the owner account exists, and the claim cannot be repeated. Everyone after that signs in with an account an administrator creates, or registers if the owner turned on open registration.
Tip

Create the owner account before you open the port to the network or put a proxy in front of it. Inside Docker even a browser on the same machine may count as remote, so have the claim code ready there.

Running behind a reverse proxy#

Put an authenticating reverse proxy in front of PotionUI whenever it is reachable beyond a trusted network. PotionUI does not ship a proxy configuration. When you write one:

  • Use single-process mode (./potionui build) or the Docker image, so there is one upstream port: 26730.
  • Forward WebSocket upgrades. Live progress and admin updates use WebSocket connections under /ws/.
  • Set Public address in Administration, System Settings, Access to the address people use, for example https://potion.example.com. PotionUI builds links for external clients such as MCP from it. Left empty, it uses the address the client connected to.

The worker profile#

A worker runs generations for another PotionUI instance. It has no frontend, no database and no accounts. Every request to it must carry a shared secret, the worker token.

  1. Set a token

    Generate a long random value and put it in .env on the GPU machine as POTIONUI_WORKER_TOKEN. The worker refuses to start without it.

    Shelltoken
    python3 -c "import secrets; print(secrets.token_urlsafe(32))"
  2. Check and start

    ./potionui worker doctor checks Python, the GPU, disk space, the port, the worker folder and the token. ./potionui worker start installs the CUDA stack if needed and runs the worker in the foreground.

    Shellworker
    ./potionui worker doctor
    ./potionui worker start --host 0.0.0.0 --port 7690
    Note

    The worker binds 127.0.0.1 unless you pass --host. The instance that sends it work must be able to reach it, so a worker on another machine needs --host 0.0.0.0 or the address of a specific interface.

  3. Connect it

    On the instance that dispatches work, add a backend of the engine Native (Remote Worker) with the worker's address and the same token. Add a remote native worker covers this and the model files a worker needs.

Security

The token is the only thing that protects a worker. Anyone who has it can send the worker work and read what it produces. Keep it out of shared files, and keep the worker on a network you trust.

Worker settings are environment variables only:

VariableDefaultMeaning
POTIONUI_WORKER_TOKENnone, requiredThe shared secret every request must carry.
POTIONUI_WORKER_HOST127.0.0.1Bind address. It never defaults to 0.0.0.0.
POTIONUI_WORKER_PORT7690Bind port.
POTIONUI_WORKER_DIR./worker_dataThe worker's journal, results and uploaded inputs.
POTIONUI_WORKER_MODEL_DIR/modelsWhere the worker keeps model files, one folder per model type, the same layout as the main models folder.

Docker#

The published image runs one process on one port: the backend, serving the built app. It needs an NVIDIA GPU and the NVIDIA Container Toolkit. Everything the app keeps (database, settings, generations, uploads, logs) lives in two volumes, and the image contains none of it.

Shelldocker run
docker run --gpus all -p 26730:26730 \
  -v potionui-models:/app/models \
  -v potionui-storage:/app/storage \
  ghcr.io/potionui/potionui:latest

# open http://localhost:26730
  • Who can reach it. -p 26730:26730 publishes the port on every interface of the host. Use -p 127.0.0.1:26730:26730 to keep it on the host only, for example behind a proxy on the same machine.
  • Versions. Each release is tagged :0.3.0, :v0.3.0 and :0.3 (newest patch of that line), as well as :latest. Pin a version tag so an update happens when you choose.
  • Logs. The server log is also written to /app/storage/logs/potionui.log in the storage volume. Set POTIONUI_LOG_FILE=off for a read-only filesystem.
  • Windows. Docker Desktop runs the image through WSL2.

To run ComfyUI beside it, add ComfyUI as a second service in your own compose file, started with --listen 0.0.0.0, and use the service name as the host of the ComfyUI backend:

YAMLdocker-compose.yml
services:
  potionui:
    image: ghcr.io/potionui/potionui:latest
    depends_on:
      - comfyui
    # ...

  comfyui:
    image: your-comfyui-image
    command: ["--listen", "0.0.0.0"]
    # ...

A worker image, ghcr.io/potionui/potionui-worker, carries the same tags. It is the image the RunPod Provider plugin starts on a rented GPU. It never contains a token: the token is passed as an environment variable when the container starts.

Note

./potionui start-docker is a different thing: a contributor harness that simulates smaller machines with resource caps. It is not the way to run a studio.

Updating to a new version#

  1. Back up first

    A new version can bring database migrations that run on first start and cannot be undone. Take a backup with the config tier at least; see Backup and restore. A backup restores onto the same or a newer version only.

  2. Read the release notes

    Each release's changelog has an Upgrading entry that lists migrations, changed packages and anything you have to do by hand.

  3. Replace the code

    Docker: stop and remove the container, then start one from the new version tag with the same two volumes. All state is in the volumes, so nothing else moves. A checkout: stop PotionUI with ./potionui stop and check out the new release.

  4. Refresh the packages of a checkout

    ./potionui start installs Python packages only when the virtual environment cannot load them at all, so it does not pick up a changed package list on its own. Install the requirements again with the virtual environment active: pip install -r requirements.txt -c constraints.txt, or for the remote profile pip install -r requirements-cpu.txt --extra-index-url https://download.pytorch.org/whl/cpu. If you use single-process mode, run ./potionui build again.

  5. Start

    Start as before. Migrations run on the first start.

    What you will see

    Right after a start the server answers that it is warming up while it loads presets and backends. ./potionui start keeps waiting through that, and the Docker health check gives the first start a grace period.

Status and stopping#

CommandWhat it does
./potionui statusSays whether an instance started with ./potionui start is running, with each process, its port and its log file.
./potionui stopStops the backend and the frontend together. Safe to run when nothing is running.
Ctrl-CIn the terminal that ran ./potionui start, ./potionui worker start or ./run.sh, stops what it started.
docker stop <container>Stops the Docker image. The volumes keep everything.

If start reports a stale or partly running instance, run ./potionui stop, then ./potionui start again. When the backend or frontend does not come up in time, start prints the last lines of its log and stops whatever it started.

Logs

The server writes everything it logs to the console into storage/logs/potionui.log as well, rotated by size. POTIONUI_LOG_LEVEL, POTIONUI_LOG_DIR, POTIONUI_LOG_MAX_BYTES, POTIONUI_LOG_BACKUP_COUNT and POTIONUI_LOG_FILE=off tune it. Administrators can read the latest lines in Administration, System Settings, Logs. For a Windows issue report, attach potionui.cmd doctor --json, the files under logs/ and the output of nvidia-smi.

Install ↗Docker ↗Remote Native ↗Security policy ↗