Build Your Own Private AI Image Generator: A Local Setup Guide with Docker and Open WebUI
Overview
You want to create AI images without relying on cloud services, worrying about privacy, or burning through credits. Imagine having a powerful chat interface where you type a prompt and instantly get an image—all running on your own machine. With Docker Model Runner and Open WebUI, that’s not just possible; it’s surprisingly straightforward.

This guide walks you through setting up a fully local image generation pipeline. You’ll learn to pull a state-of-the-art diffusion model, connect it to a user-friendly web interface, and generate images—all from the comfort of your terminal. By the end, you’ll have your own private, no-subscription-needed alternative to services like DALL-E or Midjourney.
Prerequisites
Before we dive in, make sure your system meets these requirements:
- Docker: Docker Desktop (macOS/Windows) or Docker Engine (Linux) installed and running.
- RAM: At least 8 GB free for smaller models; 16 GB recommended for smoother performance.
- GPU (optional but recommended):
- NVIDIA GPU with CUDA support for best speed (on Linux, install nvidia-container-toolkit).
- Apple Silicon (M1/M2/M3) uses MPS backend—works out of the box with Docker Desktop.
- CPU fallback works but will be noticeably slower.
Quick verification: run docker model version in your terminal. If it returns version info without errors, you’re ready.
Understanding the Architecture
Here’s the high-level flow: Docker Model Runner acts as a control plane. It downloads the model, manages inference, and exposes an API that’s 100% compatible with OpenAI’s specification—including the /v1/images/generations endpoint. Open WebUI, a sleek chat interface, talks to that endpoint just as it would to a cloud service. This means you get a familiar chat-based UI running everything locally.
Step-by-Step Instructions
Step 1: Pull an Image Generation Model
Models are distributed via Docker Hub using a compact format called DDUF (Diffusers Unified Format). Think of it as a single-file package containing all the components of a diffusion model: text encoder, VAE, UNet/DiT, and scheduler config.
To pull the default model (Stable Diffusion XL), run:
docker model pull stable-diffusion
This downloads about 6.94 GB. You can inspect the local artifact with:
docker model inspect stable-diffusion
Output will show details like the model ID, tags, size, and the DDUF file structure. For example:
{
"id": "sha256:5f60862074a4c585126288d08555e5ad9ef65044bf490ff3a64855fc84d06823",
"tags": ["docker.io/ai/stable-diffusion:latest"],
"config": {
"format": "diffusers",
"architecture": "diffusers",
"size": "6.94GB",
"diffusers": {
"dduf_file": "stable-diffusion-xl-base-1.0-FP16.dduf",
"layout": "dduf"
}
}
}
If you have limited RAM, you can try smaller models like stable-diffusion-turbo (faster, less quality) by substituting the model name.
Step 2: Launch Open WebUI
Now the magic happens. Docker Model Runner includes a built-in command that knows exactly how to wire up Open WebUI against your local model. Execute this one-liner:
docker model launch openwebui
This command does three things automatically:
- Starts the model inference server for the pulled model.
- Downloads and runs the Open WebUI container (if not already present).
- Configures the web UI to connect to the local API endpoint (typically
http://localhost:8080).

After a few seconds, you’ll see logs indicating the web UI is ready. Open your browser and navigate to http://localhost:3000 (or the port shown in logs).
Step 3: Generate Your First Image
In the Open WebUI interface, you’ll see a familiar chat window. Type a prompt like “a Dragon wearing a business suit, digital art” and hit send. The model processes your request, and within 10–30 seconds (depending on your hardware), the image appears directly in the chat.
You can continue the conversation, refining prompts or requesting variations. All images are stored locally—nothing leaves your machine.
Step 4: Optional Customization
You can adjust model parameters by modifying the inference server’s environment variables. For example, to increase the number of steps for higher quality (at the cost of speed), you can set DOCKER_MODEL_NUM_INFERENCE_STEPS=50 before launching. Or specify a different model with docker model pull your-preferred-model then launch again.
Common Mistakes and Troubleshooting
- Mistake: Not enough RAM. If Open WebUI fails to start or the model returns garbled images, check free memory. Close other applications or use a smaller model.
- Mistake: GPU not detected. On Linux, ensure nvidia-container-toolkit is installed and Docker is configured to use it. On macOS with Apple Silicon, Docker Desktop automatically uses Metal; no extra steps needed.
- Mistake: Port conflicts. If port 3000 or 8080 is already in use, Docker Model Runner logs will show a binding error. Kill the conflicting process or use
docker model launch openwebui --port 3001(if supported) to pick an alternative port. - Mistake: Model pull timeout. Large models can take a while to download. Ensure stable internet and consider using
docker model pull --quietto reduce verbosity. - Mistake: Open WebUI not showing images. Check that the model is running (run
docker psto see containers). If the inference server stopped, re-launch.
Summary
You now have a fully local, private image generation system based on Docker Model Runner and Open WebUI. No cloud subscriptions, no data leaks, no annoying filters. With two commands (docker model pull stable-diffusion and docker model launch openwebui), you set up a powerful AI image generator that responds in a chat interface. Remember to monitor your system’s resources, and feel free to experiment with different models for varied results.
Related Articles
- Grafana Cloud Empowers Teams to Customize Prebuilt Cloud Provider Dashboards on AWS, Azure, and GCP
- Run Your Own AI Image Generator: Local Setup with Docker and Open WebUI
- Behind the Seamless Rewrite: How Kubernetes Image Promoter Got Faster and Smaller
- Grafana Launches AI-Powered Assistant to Diagnose Database Slowdowns in Real-Time
- Microsoft Launches Smart Tier for Azure Storage: Automated Cost Optimization Now Generally Available
- Cloudflare Restructures for the AI Era: Workforce Reduction and Strategic Shift
- Enhancing CPU Priority in Kubernetes: A New cgroup v1 to v2 Conversion Formula
- Mastering Digital Sovereignty: A Step-by-Step Guide to Microsoft's Sovereign Cloud Platform