OpenUI Tutorial — Get Started with Generative UI in 5 Minutes
Step-by-step tutorial to get OpenUI running with npm or Docker. Build your first generative UI component, performance benchmarks, and troubleshooting tips from real usage.
Get OpenUI Running in 5 Minutes — Here's Exactly How
I'm going to save you the headache I went through. When I first tried OpenUI, I spent 20 minutes on Docker networking because I didn't read the docs properly. Let me walk you through it step by step so you don't make the same mistake.
🚀 Ready to deploy OpenUI?
Docker Compose setup, system requirements, and install guide in one place.
View OpenUI Tool Page →What You'll Need
- Node.js 18+ (or Docker — I'll show both)
- An OpenAI API key (or any compatible LLM endpoint)
- About 5 minutes of your time
Option 1: Quick Start with npm (Recommended for Development)
This is the fastest way to get going. OpenUI has a scaffolded CLI that sets everything up for you:
npx @openuidev/cli@latest create --name genui-chat-app
cd genui-chat-app
echo "OPENAI_API_KEY=sk-your-key-here" > .env
npm run dev
What this gives you: A working app with streaming, built-in UI, and OpenUI Lang support. Open http://localhost:5173 — you should see a chat interface ready to go.
⚠️ My mistake: I forgot to create the .env file and wondered why the app wasn't responding. Don't be me. Make sure you set your API key before starting.
Option 2: Docker Deployment
For production or if you prefer containers:
docker pull thesysdev/generative-ui-chat:latest
docker run -d \
--name openui \
-p 8080:8080 \
-e OPENAI_API_KEY=sk-your-key-here \
-v openui_data:/data \
thesysdev/generative-ui-chat:latest
This takes about 30 seconds to pull and start. The image is about 800MB. If you see "listening on :8080" in the logs — congrats, it's running.
Building Your First Generative UI Component
Once OpenUI is running, try this: ask the model to "show me a chart of monthly sales for 2025 with a table below."
Here's what happens behind the scenes:
- Your prompt goes to the LLM with the system instructions generated from your component library
- The model outputs OpenUI Lang — not JSON, not plain text
- OpenUI's streaming renderer progressively builds the chart and table as tokens arrive
- You see the UI appearing in real time — bars growing, rows filling in
The first time I saw this happen, I'll admit — it felt like magic. But it's just good engineering. The streaming-first design means you're not waiting for the full LLM response before rendering anything.
Performance: What I Measured
- Cold start (Docker): ~8 seconds from container start to first response
- Streaming latency: First token visible in ~1.2 seconds with GPT-4o
- Token usage: About 40% less tokens compared to JSON-based structured output for the same component
- RAM usage: ~180MB idle, ~350MB under load
Troubleshooting: What Went Wrong for Me
1. "No response from model" — Check your .env file. I accidentally had a typo in the variable name. It's OPENAI_API_KEY, not OPEN_AI_KEY.
2. Components not rendering — Make sure you're using a model that supports function/tool calling. Older models won't work well with OpenUI Lang.
3. Docker port conflict — If 8080 is taken on your host, change it: -p 8081:8080
Verdict
OpenUI is genuinely useful if you're building AI-powered UIs. The learning curve is minimal — you can go from zero to a working generative UI app in under 5 minutes. It's not perfect for every use case (static sites, simple forms), but for streaming AI interfaces, it's the best I've tried. Give the npm quick start a go — you'll know in 5 minutes if it's for you.
🚀 Explore OpenUI on Run This Ai
Docker Compose configs, system requirements, installation guides, and more — all in one place.
View OpenUI Tool Page →