Install Chat
Set up Chat with Docker or on Kubernetes in about ten minutes. setup.sh makes every password and key and tells you what's left.
5 min readUpdated for Chat 0.5.2Edit on GitHub
Chat is one Rust binary that serves the web app and its API. PostgreSQL with pgvector holds everything: accounts, sessions, conversations, files and Knowledge passages. You can run several replicas against one database; they share sessions, limits and running responses through it.
Accounts and conversations work without a gateway. Models and generation show as unavailable until the gateway trusts Chat.
Set it up
Get the latest release, then run setup.sh for Docker or Kubernetes. It asks for anything it needs, makes the passwords and Chat's signing key, starts Chat and prints the administrator password and what's left to do. Run it again after you pull a new release; it keeps the passwords and keys it made.
git clone --branch v0.5.2 https://github.com/thediymaker/obleth-chat.git
cd obleth-chat
./setup.sh docker
It asks for two things:
- The address people open Chat at.
http://localhost:8085if only you will use it on this machine. - The gateway's URL, as the Chat container reaches it. A gateway on the same host is
http://host.docker.internal:<port>.
It writes .env with generated passwords, puts the signing key in .local/, and starts Chat and PostgreSQL 17 with pgvector through Docker Compose or Podman Compose. Chat listens on 127.0.0.1:8085, and PostgreSQL publishes no port. For any address other than this machine, put your HTTPS reverse proxy in front of Chat, with response buffering off and long read timeouts: replies stream.
| Option | Meaning |
|---|---|
--url URL | The address people open Chat at |
--gateway URL | The gateway, as Chat reaches it |
--namespace NAME | Kubernetes: the namespace (default obleth-chat) |
--database URL | Kubernetes: an existing PostgreSQL 17 with pgvector, instead of running one |
--storage-class NAME | Kubernetes: the StorageClass for PostgreSQL's and workspaces' volumes |
--yes | Use the defaults instead of asking |
Trust Chat in the gateway
setup.sh prints an entry for the gateway's issuers. Add it to OBLETH_JWT_ISSUERS (Helm: obleth.jwtIssuers), keeping any other issuers, and restart the gateway. The model picker then lists the gateway's models. Connect the gateway explains each field and how to choose the tenant.
Limits
- Workspaces and the browser run only on Kubernetes. Chat starts them as pods; with Docker, Chat runs without them.
- Previews need a wildcard DNS name and certificate. A preview is an app the model wrote. Served from Chat's own address, it could call Chat as the person signed in, so each app gets an address of its own, such as
a1b2c3.sbx.example.edu. That takes a wildcard DNS record and a wildcard certificate for the preview domain. Without them, workspaces, the terminal, files, code and the browser all work; only the Preview tab is missing. See Add previews.
Sign in the first time
- 1
Sign in as the administrator
Open your address and sign in as
adminwith the passwordsetup.shprinted. It's also in.envor in Secretobleth-chat-env, asOBLETH_CHAT_BOOTSTRAP_PASSWORD. Chat creates this account only when it has no users. - 2
Change the password
Change it in Settings › Personal › Security.
- 3
Add people
Invite accounts in Settings › Administration › People. See Accounts and sign-in.
Chat needs HTTPS for any address other than this machine. Terminate TLS at your ingress or reverse proxy, and use the exact URL people open as the address. Behind a proxy, also see Reverse proxies.
Check it
/healthzanswers when the process is up./readyzalso checks the database; use it for readiness probes./api/admin/health, signed in as an administrator, returns the replica's version, the database pool, active streams, whether workspaces are on and the address Chat sees for you.
Set it up by hand
setup.sh only fills in files from the repository, so you can do the same steps yourself, for example to keep the manifests in your own GitOps repository.
The database
Give Chat its own database and a role that owns it, separate from the gateway's database. The role doesn't need to be a superuser, but pgvector must be installed on the server and the extension created in Chat's database by a superuser:
CREATE ROLE obleth_chat LOGIN PASSWORD '…' NOSUPERUSER NOCREATEDB NOCREATEROLE;
CREATE DATABASE obleth_chat OWNER obleth_chat;
\connect obleth_chat
CREATE EXTENSION IF NOT EXISTS vector;
Chat runs its migrations at startup.
With CloudNativePG, have the operator create the extension when it creates the database:
bootstrap:
initdb:
database: obleth_chat
owner: obleth_chat
postInitApplicationSQL:
- CREATE EXTENSION IF NOT EXISTS vector
The operator's <cluster>-app Secret has a ready-made connection string under the key uri. Use it as OBLETH_CHAT_DATABASE_URL; the host in it (<cluster>-rw.<namespace>) resolves from Chat's namespace.
Docker Compose
deploy/compose.connected.yaml runs Chat with PostgreSQL 17 and pgvector. Set these in .env:
OBLETH_CHAT_POSTGRES_ADMIN_PASSWORDandOBLETH_CHAT_POSTGRES_PASSWORD, 64 hex characters each.OBLETH_CHAT_BOOTSTRAP_PASSWORD, at least 12 characters.OBLETH_CHAT_ORIGINandOBLETH_CHAT_GATEWAY_URL.OBLETH_CHAT_GATEWAY_SIGNING_KEY_FILE, the absolute path of an RSA key (Connect the gateway shows how to make one). The container runs as UID 10001 and must be able to read it.
docker compose --env-file .env -f deploy/compose.connected.yaml up -d
The database's init script runs only on an empty volume, so changing a password in .env later doesn't change the database role's password.
Kubernetes
Set the origins in deploy/k8s.yaml's ConfigMap, then create the namespace and two Secrets before applying it, because the Deployment needs them to start:
kubectl create namespace obleth-chat
kubectl -n obleth-chat create secret generic obleth-chat-env \
--from-literal=OBLETH_CHAT_DATABASE_URL='postgresql://…' \
--from-literal=OBLETH_CHAT_BOOTSTRAP_PASSWORD='…'
kubectl -n obleth-chat create secret generic obleth-chat-gateway-signing-key \
--from-file=gateway_signing_key=obleth-chat-signing.pem
kubectl apply -f deploy/k8s.yaml
The manifest has the Deployment, Service and PodDisruptionBudget, a ServiceAccount and Role so Chat can start workspace pods in its namespace, and NetworkPolicies that fence those pods in. The namespace enforces Pod Security restricted, so keep the database elsewhere unless it meets that. deploy/k8s-postgres.yaml is the PostgreSQL that setup.sh runs; its header lists what it needs. Pin the images by digest in production.
From source
Requires Rust stable and a database as above. Node.js 20.12 or later is optional, for the startup wrapper that reads .env.
cp .env.example .env
# Set OBLETH_CHAT_DATABASE_URL, OBLETH_CHAT_ORIGIN and
# OBLETH_CHAT_BOOTSTRAP_PASSWORD (at least 12 characters).
npm run start:api
# http://localhost:8085
Without the wrapper, export the same variables and run cargo run --release or target/release/obleth-chat. The binary itself doesn't read .env.
What the image contains
Each release publishes ghcr.io/thediymaker/obleth-chat/chat:vX.Y.Z for amd64 and arm64; see the releases. deploy/Dockerfile.api is a multi-stage build: it compiles the release binary, then copies it with the web app into a slim runtime image that runs unprivileged as UID 10001 with a read-only root filesystem. The image includes poppler-utils and unzip for Knowledge text extraction.
Which certificate authorities Chat trusts
Chat checks the HTTPS servers it calls (the gateway, your OIDC provider, the Knowledge bucket, GitHub) against the public root certificates built into it, not the operating system's store. Adding a certificate to the image or the host doesn't change that, so these servers need certificates from a public certificate authority. Plain HTTP to a gateway inside your network is fine. Kubernetes cluster connections are the exception: each one carries its cluster's own CA.
