npmgit clone https://github.com/openchatui/openchat.git
cd openchat
npm install
Create your environment file and set provider keys:
cp .env.example .env
Minimal variables to start:
# App
AUTH_URL="http://localhost:3000"
AUTH_SECRET="$(openssl rand -base64 32)"
AUTH=true
# Database (SQLite by default)
DB=sqlite
# Providers (set what you need)
OPENAI_API_KEY=
OPENROUTER_API_KEY=
# Ollama: leave empty unless running locally
# OLLAMA_HOST=http://localhost:11434
# Optional: browser automation via Browserless
# BROWSERLESS_URL=https://www.browserless.io/
# or BROWSERLESS_TOKEN=xxx
# Apply schema
npm run db:push
# Start dev
npm run dev
Local app: http://localhost:3000
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
-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-stopped
https://github.com/openchatui/openchatAUTH_URL (Vercel URL), AUTH_SECRETOPENAI_API_KEY, OPENROUTER_API_KEY)DB=postgres and DATABASE_URL (e.g., Neon or Vercel Postgres)AUTH_URL / AUTH_SECRET: Auth base URL and secret.AUTH (true|false): Disable to show a public landing page; admin stays protected.DB (sqlite|postgres) and DATABASE_URL: Database selection and connection string.OPENAI_API_KEY: Key for OpenAI.OPENROUTER_API_KEY: Key for OpenRouter.OLLAMA_HOST: Base URL for Ollama if running locally.BROWSERLESS_URL or BROWSERLESS_TOKEN: Configure Browserless for headless browsing tools.AUTH_SECRET./prisma volume in Docker to persist SQLite and migrations.https://github.com/openchatui/openchat.