# Self-host Open WebUI. Your team's own ChatGPT.

> Self-host Open WebUI without a VPS: one sentence in Claude Code, Codex or Cursor runs it on Agent Lab with PostgreSQL and your own OpenAI or Anthropic keys.

Web page: https://agentlab.cresclab.com/en/deploy/open-webui  
繁體中文 (Markdown): https://agentlab.cresclab.com/deploy/open-webui.md

Self-host Open WebUI · Agent Lab Deploy

An open-source ChatGPT: say one sentence to your AI tool, Agent Lab runs Open WebUI on PostgreSQL, add your model key, and the team is in.

[Set up Open WebUI](https://app.agentlab.cresclab.com/?lang=en&intent=deploy) [Jump to the Dockerfile](https://agentlab.cresclab.com/en/deploy/open-webui#recipe)

A Claude Code conversation: the user asks for Open WebUI from this page; the agent creates the app, creates and connects PostgreSQL, generates the secret and returns the URL.

Why self-host

## ChatGPT Team bills per seat. Self-hosted bills per use.

### Every model in one interface

OpenAI, Anthropic and Gemini, switched in one screen.

### Knowledge in PostgreSQL

Vectors in pgvector, in the same database as accounts and chats.

### Team accounts you control

Public sign-up off; admins invite colleagues and set model access.

Choosing

## ChatGPT Team vs a VPS vs Agent Lab

Three ways for a team to use AI chat compared

| What matters to you | Agent Lab + Open WebUI | ChatGPT Team | Your own VPS |
| --- | --- | --- | --- |
| Billing | Hosting plus actual model usage | Fixed per seat per month | Hosting plus model usage |
| Models | OpenAI, Claude, Gemini | OpenAI | Any |
| Where the data lives | Your Agent Lab organization | OpenAI | Your server |
| Who runs it | The platform | OpenAI | You |
| Setup | One sentence to an AI tool | Sign up | Docker, reverse proxy, TLS |

How

## Connect → one sentence → model key → invite the team

Needs size M or larger, so it starts on Pro.

1. ### Connect Agent Lab
   One MCP line in your AI tool, one browser sign-in.
2. ### Say one sentence
   The agent creates the app, connects PostgreSQL with pgvector and generates WEBUI_SECRET_KEY.
3. ### Add a model key
   Enter OPENAI_API_KEY as a console project secret.
4. ### Invite the team
   The first sign-up is the admin; invite colleagues from the admin panel.

Copy and go

## The Dockerfile and the sentence

Everything lives in PostgreSQL and embeddings go through an API, so a rebuild loses nothing.

Dockerfile

### Dockerfile

```
FROM ghcr.io/open-webui/open-webui:main
ENV DATA_DIR=/tmp/open-webui \
    STATIC_DIR=/tmp/open-webui/static \
    VECTOR_DB=pgvector \
    RAG_EMBEDDING_ENGINE=openai \
    RAG_EMBEDDING_MODEL=text-embedding-3-small \
    ENABLE_SIGNUP=false \
    SCARF_NO_ANALYTICS=true \
    DO_NOT_TRACK=true
EXPOSE 8080
# Open WebUI reads $PORT; DATABASE_URL and PGVECTOR_DB_URL come from the platform
```

- `DATABASE_URL` written by databases_connect_app
- `PGVECTOR_DB_URL` same database, holds vectors; needs pgvector
- `WEBUI_SECRET_KEY` generated by sites_secrets_generate; changing it signs everyone out
- `OPENAI_API_KEY` your model key, a console project secret

PROMPT

### Say this to your AI tool

```
Read https://app.agentlab.cresclab.com/agent/deploy.md and deploy Open WebUI to Agent Lab with the Dockerfile at agentlab.cresclab.com/en/deploy/open-webui: create and connect a PostgreSQL with pgvector, point DATABASE_URL and PGVECTOR_DB_URL at it, generate WEBUI_SECRET_KEY on the platform, and tell me where in the console to enter OPENAI_API_KEY. Use size M. Give me the URL when it's up.
```

FAQ

## Before you self-host Open WebUI

**How much does it cost to self-host Open WebUI?**

It starts on Pro: US$29 a month before tax with US$14 of monthly usage credit, which the app draws on. Model usage is paid to OpenAI, Anthropic or Google as you use it.

**Can Open WebUI use Claude and Gemini?**

Yes. Add Anthropic and Gemini as admin-panel connections or through an OpenAI-compatible gateway, and switch in one interface.

**Do I need Ollama for Open WebUI?**

No. Ollama needs a lot of memory or a GPU; connect OpenAI, Anthropic or Gemini APIs directly and medium is enough.

**Where does Open WebUI store its data?**

Accounts, chats, settings and vectors are in PostgreSQL with pgvector. The container only writes to /tmp, which clears on rebuild.

**Can my whole team use it?**

Yes. The first sign-up is the admin; set ENABLE_SIGNUP to false, invite colleagues and set which groups use which models.
