Tutorial

Artificial Intelligence

How to host OpenUI on a VPS

OpenUI is an open-source tool developed by Wandb that generates web interface components from a simple text description, then renders them live in the browser. Not to be confused with Open WebUI (a chat interface for Ollama/LLM): OpenUI is a UI code generator. Self-hosted on a VPS, it becomes a private UI prototyping workshop that your whole team can use without depending on a third-party service. Here is how to deploy it with Docker, connect it to a model, secure it behind a reverse proxy and keep it ready for production use.

8 min read6 steps
Contents· Why self-host OpenUI on a VPS1/10
  1. 01Why self-host OpenUI on a VPS
  2. 02The concrete benefits of self-hosting
  3. 03Hardware and software prerequisites
  4. 04Step-by-step deployment
  5. 05Nginx configuration and TLS
  6. 06OpenUI vs Open WebUI: two tools not to confuse
  7. 07OpenUI vs Open WebUI: which tool for which use case?
  8. 08Advanced configuration with docker-compose
  9. 09Environment variables and authentication in production
  10. 10Troubleshooting: common errors

Why self-host OpenUI on a VPS

OpenUI is aimed at front-end developers and designers who want to turn an idea ("a login form with a blue button and a forgotten-password option") into functional HTML/Tailwind/React code, rendered instantly in the browser. Rather than depending on an online service with generation limits and privacy risks, hosting it on your VPS gives you a permanent endpoint, shareable via an internal link, where anyone can prototype without a local installation. Key point: OpenUI needs an LLM to generate the code — you point it either to an external model via API key (OpenAI, Anthropic, Mistral…), or to a local Ollama running on the same VPS, which keeps the entire chain in-house. The real-time rendering of components hugely accelerates mock-up iterations: describe, see, copy the code into your project.

The concrete benefits of self-hosting

  • UI prototyping workshop shared via a simple internal URL, no client-side installation.
  • Live rendering of the generated components (HTML, Tailwind, React, Svelte).
  • Choice of model backend: external API key or 100% local Ollama.
  • No generation limit imposed by a third-party service.
  • Clean code export, ready to copy into your project codebase.
  • Confidentiality of client briefs and mock-ups kept on your VPS.

Hardware and software prerequisites

OpenUI itself is lightweight: the application (Python backend + front) fits on a 2 vCPU / 2 to 4 GB RAM VPS if you use an external API key for the model. If you want to keep everything local with Ollama on the same machine, size it according to the target model: count on 8 to 16 GB of additional RAM for a quantized 7B model (e.g. Qwen2.5-Coder-7B-Q4), and up to 32 GB for a 13B. Plan for a few GB of disk for Docker images and more if you store Ollama models (each model weighs 4 to 8 GB). On the software side: Ubuntu 22.04, Docker and Docker Compose, a model API key (or Ollama installed), git, and a configured subdomain like ui.mydomain.com pointing to your VPS.

Step-by-step deployment

  1. Grab the project

    Via SSH, clone the repository: git clone https://github.com/wandb/openui then move into the backend folder. OpenUI provides a Dockerfile and ready-to-use build instructions. Check the current branch: git log --oneline -3 to make sure you are starting from a stable commit.

  2. Choose the model backend

    For an external model, fill in your key in an environment variable (OPENAI_API_KEY or equivalent depending on the provider). To stay local, install Ollama (curl -fsSL https://ollama.com/install.sh | sh), pull a code-oriented model with ollama pull qwen2.5-coder:7b and point OpenUI to it via OLLAMA_HOST=http://localhost:11434.

  3. Build and run the container

    Build the image then start: docker compose up -d. OpenUI exposes port 7878 by default. Follow the startup with docker compose logs -f until you see the server ready message. If the build fails on Python dependencies, make sure you are using the Dockerfile provided in backend/.

  4. Check the rendering

    Open http://VPS_IP:7878, type a component description (e.g. "a primary button with icon and disabled state") and confirm that the code is generated AND rendered live in the preview. If generation fails with a model connection error, check the logs and ensure the API key environment variable is properly injected.

  5. Secure behind a reverse proxy

    OpenUI has no strong authentication by default: place Caddy or Nginx in front of port 7878 with Basic Auth, and enable automatic SSL for ui.mydomain.com. Restrict access to the raw port via the firewall (ufw deny 7878). See the dedicated section below for the full Nginx configuration.

  6. Share with the team

    Communicate the URL https://ui.mydomain.com to your developers and designers. Everyone can prototype from their browser without installing anything, and copy the generated code directly into the project.

Nginx configuration and TLS

Here is a minimal nginx configuration to expose OpenUI with Basic Auth and HTTPS. Create /etc/nginx/sites-available/openui with: an upstream openui_backend pointing to 127.0.0.1:7878, then a server block listening on 443 with your certificate (Let's Encrypt via Certbot or DNS-01). In the location / block, add proxy_pass http://openui_backend, proxy_http_version 1.1, the Upgrade and Connection headers for WebSocket (OpenUI uses persistent connections for real-time rendering), and auth_basic with a .htpasswd file generated by htpasswd -c /etc/nginx/.htpasswd user. Add a second server block on port 80 that 301-redirects to HTTPS. Enable the site with ln -s in sites-enabled and reload nginx. Remember to block port 7878 directly: ufw deny 7878 so that no unauthenticated access is possible by bypassing the proxy.

OpenUI vs Open WebUI: two tools not to confuse

The confusion is frequent in searches and discussions: OpenUI (by Wandb/W&B) and Open WebUI are two distinct projects with very different uses. OpenUI generates user interface component code from a text description — it is a prototyping and front-end code generation tool. Open WebUI is a web chat interface for interacting with LLMs (Ollama, OpenAI…), similar to what ChatGPT offers but self-hosted. To summarize: if you want to create UI components by description, use OpenUI. If you want a chat interface for your local models, use Open WebUI. Both can coexist on the same VPS and share the same Ollama backend — they complement each other without competing.

OpenUI vs Open WebUI: which tool for which use case?

Scroll the table

OpenUI (Wandb)Open WebUI
Generates HTML/Tailwind/React/Svelte componentsWeb chat interface for LLMs (self-hosted ChatGPT-style)
Live visual rendering in the browserMulti-model management, RAG, conversation history
Ready-to-integrate source code exportIdeal for assistance, research, general tasks
Ideal for UI prototyping and front-end code generationRequires Ollama or an OpenAI-compatible API
Requires an LLM (external API or local Ollama)Built-in user and role management
Default port: 7878Default port: 3000

Advanced configuration with docker-compose

For a fully sovereign chain, have OpenUI and Ollama coexist in the same docker-compose.yml on an internal Docker network. Define two services: ollama (image ollama/ollama) and openui (image built from ./backend). Add a custom ai_net network and attach both services to it. In OpenUI's environment variables, point the backend to http://ollama:11434 — Docker DNS resolves the service name automatically, without ever exposing Ollama to the Internet. For generation quality, a code-oriented model (Qwen2.5-Coder, CodeLlama) gives far better Tailwind/React components than a generalist model of the same size. Test several and keep the one whose rendering is most faithful to your prompts. To enable session and user preference persistence, mount a Docker volume on OpenUI's data directory (/app/.openui) to preserve configuration between restarts.

Environment variables and authentication in production

OpenUI recognizes several environment variables useful for a secure deployment. OPENAI_API_KEY: key for OpenAI-compatible models (OpenAI, Mistral, Groq…). ANTHROPIC_API_KEY: for Anthropic's Claude models. OLLAMA_HOST: Ollama backend URL (e.g. http://ollama:11434 in Docker Compose). HOST and PORT: internal listening address (leave 0.0.0.0:7878 behind the proxy). Never store your API keys in plain text in docker-compose.yml: use a .env file (added to .gitignore) or a secrets manager. Since OpenUI's native authentication is limited, prefer nginx Basic Auth for restricted team access, or an identity proxy (Authelia, Authentik) if you need SSO and per-user access logs.

Troubleshooting: common errors

Here are the most common issues encountered when deploying OpenUI on a VPS. Port 7878 unreachable: check that the firewall temporarily allows the port for testing (ufw allow 7878) or test from the VPS itself with curl http://localhost:7878. Model connection error: verify that the API key environment variable is properly injected (docker compose exec openui env | grep API). If using local Ollama, check that it is running and accessible (curl http://localhost:11434/api/tags). Docker build fails: make sure you build from the backend/ folder, not from the repository root. Empty preview after generation: OpenUI uses WebSocket for real-time rendering — verify that your nginx configuration passes the Upgrade: websocket and Connection: Upgrade headers. Insufficient memory with Ollama: if the container is killed (OOMKilled), reduce the model size (switch to a 3B or Q4-quantized 7B) or increase your VPS RAM.

For a fully sovereign chain, have OpenUI and Ollama coexist in the same docker-compose.yml on an internal Docker network: OpenUI calls Ollama via http://ollama:11434 without ever exposing the LLM to the Internet. On the generation-quality side, a code-oriented model (CodeLlama, Qwen2.5-Coder) produces far better Tailwind/React components than a generalist model of the same size — test several and keep the one whose rendering is most faithful to your prompts.

Prototype your interfaces on a ServOrbit Cloud VPS

Deploy OpenUI (and Ollama if you wish) on a Cloud VPS with preconfigured Docker. A private, shareable UI-generation workshop, continuously available.