OpenChat is an open source, self-hosted, AI User Interface with the goal of developing the most feature rich, free, AI User Interface.
-
Clone and install dependencies
git clone https://github.com/openchatui/openchat.git cd openchat npm install -
Create your environment file
cp .env.example .env
-
Initialize database and run
npm run db:push npm run dev
npm run serve # runs migrations, builds, and starts Next.js
Now open http://localhost:3000.
Note
- DB selection is controlled by
DB(sqliteorpostgres). - For PostgreSQL set
DB=postgresandDATABASE_URL(orPOSTGRES_URL/POSTGRES_DIRECT_URL) in.env.
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:latestTip
- Change the host port by editing the
-pflag (e.g.,-p 3001:3001together 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/dataand setSQLITE_URL=file:/app/data/openchat.db(DB defaults to sqlite in the image). Avoid mounting/prismato prevent overriding bundled migrations. - The container will generate an
AUTH_SECRETif not provided; set it for persistence across restarts.
Set AUTH=false to allow unauthenticated users to access the public landing page while keeping the /admin area protected and requiring admin login.
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-stoppedStart in the background:
docker compose up -dStop and remove the container:
docker compose downTip
- Change the external port by editing
portsand the internal app port byenvironment: PORTandAUTH_URL. - Optional (persist SQLite outside the image): mount
./data:/app/dataand setSQLITE_URL=file:/app/data/openchat.db(DB defaults to sqlite in the image). Avoid mounting/prismato prevent overriding bundled migrations. - Switch to PostgreSQL: set
DB=postgresand provideDATABASE_URLinenvironment. You can add a separate Postgres service if needed.
- ๐ค 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
- 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.



