Self-host Stable Diffusion WebUI with Levelrail

A browser interface for generating and editing images with Stable Diffusion checkpoints.

How to self-host Stable Diffusion WebUI

  1. Pull the images

    One image is pulled on your server.

    Show images
    • ghcr.io/ai-dock/stable-diffusion-webui:latest-cuda
  2. Create the app

    One service starts in a single Compose app, with 1 named volume mount for your data, on port 7860.

  3. Fill in the secrets

    1 secret is generated and stored encrypted, 2 settings are preset, you do not have to fill in anything.

  4. Open it

    Without a domain the app gets an sslip.io address; add --domain SERVICE=HOST to use your own.

Stable Diffusion WebUI requirements

Memory
About 8 GiB
Architectures
amd64 image published, arm64 not available
Ports
7860
Domain
Optional, an sslip.io address is used without one
Settings
none to fill in
License
AGPL-3.0, network copyleft (agpl) license
  • Listed. It is in the catalog but not verified. Back up the data volume before changing an image tag.
  • GPU. It needs an NVIDIA GPU on the node to be practical.
  • Host ports. It publishes port 7860 on the host, so open them in the VPS firewall only if you want that.

Install Levelrail first

On a server with Levelrail running, run the command above, or open the dashboard: Apps, New app, Browse templates, then Stable Diffusion WebUI. New to Levelrail? Install it on a fresh VPS first.

docker pull ghcr.io/glincker/levelrail:latest

Then levelrail-cli login --device. See Getting started and the Stable Diffusion WebUI docs page.

Deploy Stable Diffusion WebUI your way

Every format below deploys the same pinned images. Pick the one that fits how you work.

Deploy Stable Diffusion WebUI from the CLI

levelrail-cli templates deploy stable-diffusion-webui --name my-stable-diffusion-webui

Deploy Stable Diffusion WebUI with the API

Create a token in the dashboard first. This one-click route deploys it as a trial app you can keep or remove.

curl -X POST -H "Authorization: Bearer $TOKEN" \
  https://levelrail.example.com/api/v1/service-templates/stable-diffusion-webui/deploy

Stable Diffusion WebUI configuration

Stable Diffusion WebUI services

ServiceImagePortsVolumes
sd-webui ghcr.io/ai-dock/stable-diffusion-webui:latest-cuda 7860 sd_webui_workspace -> /workspace

Stable Diffusion WebUI environment variables

VariableServiceValue
WEB_ENABLE_AUTH sd-webui Preset by the template
WEB_PASSWORD sd-webui Generated at deploy
WEB_USER sd-webui Preset by the template

Ports and volumes

Ports
7860
Volumes
1 named mount: sd_webui_workspace -> /workspace

Stable Diffusion WebUI FAQ

How much memory does Stable Diffusion WebUI need?

The catalog lists about 8 GiB of memory for Stable Diffusion WebUI.

Does Stable Diffusion WebUI run on arm64?

For Stable Diffusion WebUI, amd64 only, no arm64 image; amd64 is image published.

What licence is Stable Diffusion WebUI under?

Stable Diffusion WebUI is licensed under AGPL-3.0, which is network copyleft, so source sharing also applies when it is offered as a hosted service.

Does Stable Diffusion WebUI need configuration before it starts?

No. The template fills in its own defaults and generates secrets at deploy time.

Which ports does Stable Diffusion WebUI use?

Stable Diffusion WebUI listens on port 7860 inside the stack.

Where does Stable Diffusion WebUI keep its data?

In a named volume: sd_webui_workspace mounted at /workspace.

Can I deploy Stable Diffusion WebUI on Dokploy or Dokku?

The services and pinned images on this page can be run on any Docker host. The public Dokploy templates list we compared does not have an entry with the same id for Stable Diffusion WebUI, so on Dokploy you would use a Docker Compose application with the file from this page. Dokku deploys container images with its own commands, so the pinned image ghcr.io/ai-dock/stable-diffusion-webui:latest-cuda is what you deploy there.

levelrail-cli templates deploy stable-diffusion-webui --name my-stable-diffusion-webui