Build Your Own Private AI Image Generator: A Local Setup Guide with Docker and Open WebUI

By ● min read

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.

Build Your Own Private AI Image Generator: A Local Setup Guide with Docker and Open WebUI
Source: www.docker.com

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:

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:

  1. Starts the model inference server for the pulled model.
  2. Downloads and runs the Open WebUI container (if not already present).
  3. Configures the web UI to connect to the local API endpoint (typically http://localhost:8080).

Build Your Own Private AI Image Generator: A Local Setup Guide with Docker and Open WebUI
Source: www.docker.com

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

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.

Tags:

Recommended

Discover More

The AUTEUR: A Distraction-Free E Ink Typewriter with a Mechanical Keyboard10 Key Takeaways from Kubernetes v1.36's Declarative Validation GAMoving to 240Hz OLED Monitors: Why I Can’t Return to LCD for GamingTakeda to Cut 4,500 Jobs as Biogen Alzheimer's Drug Shows Mixed ResultsCoursera Integrates Learning Agent into Microsoft 365 Copilot via OpenAI Apps SDK