Skip to content

openchatui/openchat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

GitHub stars GitHub forks GitHub watchers Repo Size GitHub last commit Discord Language

OpenChat OpenChat

OpenChat is an open source, self-hosted, AI User Interface with the goal of developing the most feature rich, free, AI User Interface.

Text generation demo

Get Started

Local

  1. Clone and install dependencies

    git clone https://github.com/openchatui/openchat.git
    cd openchat
    npm install
  2. Create your environment file

    cp .env.example .env
  3. Initialize database and run

    Dev mode (hot reload):

    npm run db:push
    npm run dev

    Production-like run:

    npm run serve   # runs migrations, builds, and starts Next.js

Now open http://localhost:3000.

Note

  • DB selection is controlled by DB (sqlite or postgres).
  • For PostgreSQL set DB=postgres and DATABASE_URL (or POSTGRES_URL / POSTGRES_DIRECT_URL) in .env.

Docker (single container)

Pull and run with defaults (port 3000 inside the container):

docker pull ghcr.io/openchatui/openchatui:latest
docker run --name openchat \
  -p 3000:3000 \
  -e PORT=3000 \
  -e AUTH_URL="http://localhost:3000" \
  -e AUTH_SECRET="$(openssl rand -base64 32)" \
  -v "$(pwd)/data:/app/data" \
  --restart unless-stopped \
  ghcr.io/openchatui/openchatui:latest

Tip

  • Change the host port by editing the -p flag (e.g., -p 3001:3001 together with -e PORT=3001).
  • If you prefer PostgreSQL, add -e DB=postgres -e DATABASE_URL=postgresql://user:pass@host:5432/dbname.
  • Optional (persist SQLite outside the image): mount a host folder at /app/data and set SQLITE_URL=file:/app/data/openchat.db (DB defaults to sqlite in the image). Avoid mounting /prisma to prevent overriding bundled migrations.
  • The container will generate an AUTH_SECRET if not provided; set it for persistence across restarts.
Optional: Public landing (disable auth)

Set AUTH=false to allow unauthenticated users to access the public landing page while keeping the /admin area protected and requiring admin login.

Docker Compose

A ready-to-use docker-compose.yml is included. It maps port 3000 and persists SQLite data to ./data mounted at /app/data.

Minimal compose file:

services:
  openchat:
    image: ghcr.io/openchatui/openchatui:latest
    ports:
      - "3000:3000"
    environment:
      PORT: "3000"
      AUTH_URL: "http://localhost:3000"
      AUTH_SECRET: "<generate-a-secret>"
    volumes:
      - ./data:/app/data
    restart: unless-stopped

Start in the background:

docker compose up -d

Stop and remove the container:

docker compose down

Tip

  • Change the external port by editing ports and the internal app port by environment: PORT and AUTH_URL.
  • Optional (persist SQLite outside the image): mount ./data:/app/data and set SQLITE_URL=file:/app/data/openchat.db (DB defaults to sqlite in the image). Avoid mounting /prisma to prevent overriding bundled migrations.
  • Switch to PostgreSQL: set DB=postgres and provide DATABASE_URL in environment. You can add a separate Postgres service if needed.

Features

  • ๐Ÿค– Multiโ€‘provider AI: OpenAI, OpenRouter, Ollama (via AI SDK)
  • ๐Ÿ–ผ๏ธ Image generation (OpenAI)
  • ๐ŸŽฌ Video generation (Sora 2)
  • ๐ŸŽ™๏ธ Voice chat and TTS (e.g., ElevenLabs)
  • ๐ŸŒ Browserless/headless web tools (automation via Browserbase)
  • ๐Ÿ“ Drive and Docs: Google Drive/Google Docs integration or local documents
  • ๐Ÿ’ฌ Rich chat management: folders, tags, pinning, sharing
  • ๐Ÿ“ Markdown with math (KaTeX) and code highlighting (Shiki)
  • ๐Ÿ“„ File and PDF reading
  • ๐Ÿ“˜ Builtโ€‘in REST API docs (Swagger UI)
  • ๐Ÿ” Authentication with sessions and roles
  • ๐Ÿ—„๏ธ SQLite or PostgreSQL via Prisma
  • ๐Ÿณ Docker and Docker Compose support

Wishlist

  • Documents: Tika, Docling, OCR (for drive)
  • Image Gen: Midjourney, Auto1111, ComfyUI, Gemini, other providers
  • Vision models and UI
  • TTS/Voice: Deepgram
  • AWS Bedrock, Azure OpenAI, Google Cloud integrations
  • Code: Jupyeter, Pyodide
  • Web: Playwright/Puppeteer, Google PSE, serpapi, firecrawl, bing, searchapi, etc.

Browser demo

Image generation demo

Video generation demo