Teichat Community Edition is a self-hostable AI chat application built with Next.js. It uses Postgres for durable data, supports S3-compatible uploads, can use Redis for caching and transient state, and stores its runtime configuration in Postgres alongside environment variables for secrets and service credentials. For deeper reference material, start in docs/.
Teichat gives you a configurable AI chat workspace that can expose one or more model providers managed from the built-in admin panel. It supports guest usage, user accounts, and a first-run super user onboarding flow, while letting you control features such as search, uploads, and code execution. Chat history, uploads, account data, and admin-managed app settings stay in infrastructure you manage.
Teichat separates configuration by responsibility so secrets do not end up in the admin UI and runtime settings do not have to live in environment variables.
.envstores secrets, provider API keys, database and storage URLs, and external service credentials.- The admin panel at
/adminstores runtime settings in Postgres, including registration, guest mode, feature flags, endpoints, models, title generation, and company order. teichat.ymlis now a legacy path. It is still supported for migration, and it can still be used as the live source of truth whenUSE_LEGACY_CONFIGis enabled.
Most new installs only need .env plus the admin panel. If a legacy teichat.yml is present and no database-backed runtime config exists yet, Teichat imports it automatically on first boot.
-
Copy the example env file and set the required secrets.
cp .env.example .env openssl rand -base64 32
-
Put the generated value into both
AUTH_SECRETandAPP_SECRET, setAPP_URL, and add at least one provider key you plan to reference from the admin panel, such asOPENROUTER_API_KEY. -
Start the stack with Docker Compose, or run the app directly in local development.
-
Open the app, finish
/setup/onboarding, then configure endpoints and models from the Admin panel.
If you want to import a legacy config file manually instead of relying on first-boot import, run:
npm run migrateConfigThe included docker-compose.yml is the recommended self-hosted setup. It pulls the published image from ghcr.io/teichai/teichat-ce:stable, starts Postgres, Redis, and MinIO, and loads .env automatically when it exists.
Fill in .env before starting the stack. Set the public APP_URL, provide AUTH_SECRET and APP_SECRET, and add the model provider keys you want to reference from the admin panel. If needed, you can also change the POSTGRES_*, MINIO_ROOT_*, bucket, and exposed port values. The compose stack derives its internal DATABASE_URL, REDIS_URL, and S3_ENDPOINT values automatically, so the host-style defaults in .env.example still make sense for non-Docker local development.
On container startup, Teichat syncs the Prisma schema with prisma db push --skip-generate. The Prisma client is generated during image build, and the container health check only gates on the app process and Postgres readiness. Redis is still reported by /api/health, but a Redis outage no longer marks the app container unhealthy by itself.
cp .env.example .env
docker compose pull
docker compose up -dOnce the services are up, open http://localhost:3000 or your configured APP_URL. The app health endpoint is available at /api/health. If you need to inspect the stack, these are the main Docker commands:
docker compose logs -f app
docker compose ps
docker compose downMinIO is exposed by default at http://localhost:9000 for the API and http://localhost:9001 for the console.
On a fresh instance, Teichat redirects to /setup/onboarding. Create the first account there and it will become the super user for the instance. After onboarding, sign in at /login, open the chat UI, and use the Admin button in the sidebar to configure registration, endpoints, models, title generation, and company ordering.
If you started from a legacy teichat.yml, the imported endpoints and models will already be present. If you set USE_LEGACY_CONFIG=true, those runtime settings stay tied to the file instead, and the related admin sections become read-only.
Guests can browse the interface and start temporary chats when guest mode is enabled in the admin panel. Signed-in users can persist history and use account-bound features. Search, uploads, and code execution are also controlled in the admin panel, while upload storage still uses the configured S3-compatible backend and provider authentication still comes from environment variables.
If you want to run Teichat without Docker, install dependencies, start your backing services, and run the Next.js app directly:
npm install
npm run devFor a non-Docker local setup, make sure your .env points at reachable local services for DATABASE_URL, REDIS_URL, and S3_ENDPOINT.
The docs under docs/ go deeper on the current configuration model, environment variables, and the legacy teichat.yml format.
Contributions are welcome. Keep changes focused, update docs and example files when behavior changes, and run the relevant checks before opening a pull request, including npm run lint, npm run typecheck, and npm test. If you are fixing a bug, include clear reproduction steps. If you are opening a GitHub issue, use the matching bug, feature, or support template so the report includes the needed context. If you are adding or changing setup, deployment, or Docker behavior, update the README and configuration examples in the same pull request.