Deployment steps
Install Toucan AI on your Kubernetes cluster
The examples serve the app on toucan.example.com, these docs on docs.toucan.example.com and the
custom fronts on *.usercontent.example.net, and name the release toucan-ai.
Before you start
These steps assume you know Helm values, ingresses or the Gateway API, TLS secrets and persistent volumes. You need:
kubectlandhelm3.8 or later, with access to a Kubernetes cluster that has an ingress controller or the Gateway API.- PostgreSQL 16 or 17 with the
pgvectorandpgcryptoextensions, Redis, an S3-compatible bucket and an SMTP server. - An LLM endpoint and an embeddings endpoint.
- DNS names and TLS certificates for the app, for these docs unless you use ours, and for the custom fronts on a domain of their own.
- From us, an access to our registry and a license key.
Required components details what each one needs. Without internet access, also follow the air-gapped installation.
For an evaluation, the chart can run PostgreSQL, Redis and the bucket itself: uncheck those it runs, and the steps below change to match.
1. Create the database and its users
CREATE USER toucan_admin WITH SUPERUSER PASSWORD '<admin password>';
CREATE USER toucan_app WITH PASSWORD '<app password>';
CREATE DATABASE toucan OWNER toucan_admin;2. Create the secrets
kubectl create secret generic toucan-ai \
--from-literal=LICENSE_KEY='<license key>' \
--from-literal=BETTER_AUTH_SECRET="$(openssl rand -hex 32)" \
--from-literal=JWE_SECRET="$(openssl rand -hex 32)" \
--from-literal=ENCRYPTION_KEYS="{\"v1\":\"$(openssl rand -hex 32)\"}" \
--from-literal=CURRENT_ENCRYPTION_KEY_ID=v1 \
--from-literal=ADMIN_DATABASE_URL='postgresql://toucan_admin:<admin password>@db.example.com:5432/toucan' \
--from-literal=DATABASE_URL='postgresql://toucan_app:<app password>@db.example.com:5432/toucan' \
--from-literal=REDIS_URL='redis://:<password>@redis.example.com:6379' \
--from-literal=OBJECT_STORAGE_ACCESS_KEY_ID='<access key id>' \
--from-literal=OBJECT_STORAGE_SECRET_ACCESS_KEY='<secret access key>' \
--from-literal=SMTP_PASS='<SMTP password>' \
--from-literal=OPENAI_COMPATIBLE_API_SECRET='<LLM API key>' \
--from-literal=EMBEDDING_API_SECRET='<embeddings API key>'ENCRYPTION_KEYS encrypts the credentials of your data sources: keep a copy of it, and never
recreate this secret, as a new key cannot read them back.
You need to also provide a secret for the data service basic authentication:
kubectl create secret generic toucan-ai-data-service \
--from-literal=data-service-auth-api-key="$(openssl rand -hex 32)"To change a value, update the secret, for example with kubectl patch, then restart the pods: they
read it only when they start.
kubectl patch secret toucan-ai -p '{"stringData":{"SMTP_PASS":"<new password>"}}'
kubectl rollout restart deployment -l app.kubernetes.io/instance=toucan-aiIn production, have your secret manager create this secret, with the External Secrets Operator for instance: the chart only reads it by its name.
The examples use an OpenAI-compatible LLM endpoint. With another provider, replace its key here and its values in step 3, as LLM and embeddings lists.
When the license expires, Toucan AI keeps working for 30 days, then blocks access until you set a new key.
The cluster pulls our images with an access token: create one in the customer portal we invite you to, then:
kubectl create secret docker-registry distr --docker-server=registry.distr.sh \
--docker-username=- --docker-password="$DISTR_TOKEN"The ingress serves TLS from two secrets: one whose certificate covers toucan.example.com and
docs.toucan.example.com, the other with the wildcard certificate of the custom fronts. Run the same
commands to renew them:
kubectl create secret tls toucan-ai-tls --cert=toucan.crt --key=toucan.key \
--dry-run=client -o yaml | kubectl apply -f -
kubectl create secret tls toucan-ai-usercontent-tls --cert=usercontent.crt --key=usercontent.key \
--dry-run=client -o yaml | kubectl apply -f -3. Write your values
Generate the admin organization's ID with uuidgen, then:
global:
imagePullSecrets:
- name: distr # created in step 2
# Accounts are created only from an invitation or an organization's SSO.
inviteOnlySignup: true
# The bundled PostgreSQL, Redis and bucket are for evaluation only: see Required components.
postgresql:
enabled: false
redis:
enabled: false
objectStorage:
enabled: false
ingress:
enabled: true
className: nginx
hosts:
- host: toucan.example.com
paths:
- path: /
pathType: Prefix
docs:
hosts:
- host: docs.toucan.example.com
paths:
- path: /
pathType: Prefix
tls:
- secretName: toucan-ai-tls # created in step 2
hosts:
- toucan.example.com
- docs.toucan.example.com
backend:
envFrom:
- secretRef:
name: toucan-ai
config:
PUBLIC_URL: https://toucan.example.com/api
FRONTEND_URL: https://toucan.example.com
FRONTS_FILE_SERVER_ORIGIN: https://{orgId}.usercontent.example.net
DOC_URL: https://docs.toucan.example.com
ADMIN_ORGANIZATION_ID: <uuid>
SMTP_HOST: smtp.example.com
SMTP_PORT: "465"
SMTP_SECURE: "true"
SMTP_USER: toucan
SMTP_FROM: toucan@example.com
OBJECT_STORAGE_ENDPOINT: https://s3.example.com
OBJECT_STORAGE_BUCKET: toucan-ai
OBJECT_STORAGE_REGION: <region>
AI_DEFAULT_PROVIDER: openai-compatible
OPENAI_COMPATIBLE_API_URL: https://llm.example.com/v1
OPENAI_COMPATIBLE_MODEL: <model>
EMBEDDING_API_URL: https://embeddings.example.com/v1
EMBEDDING_DEFAULT_MODEL: bge-m3
# Serves the custom fronts, each organization on its own subdomain.
frontsFileServer:
enabled: true
ingress:
enabled: true
className: nginx
hosts:
- host: "*.usercontent.example.net"
paths:
- path: /
pathType: Prefix
tls:
- secretName: toucan-ai-usercontent-tls # created in step 2
hosts:
- "*.usercontent.example.net"
dataService:
auth:
existingSecret: toucan-ai-data-service
frontend:
config:
ADMIN_ORGANIZATION_ID: <uuid>
DOC_URL: https://docs.toucan.example.com
DOCS_PRODUCT_URL: https://toucan.example.com
STATUS_PAGE_URL: ""To use our docs instead, set ingress.docs.hosts: [] and leave out docs.toucan.example.com and
both DOC_URL.
With the Gateway API, replace ingress and backend.frontsFileServer.ingress with routes attached
to your Gateway. It then terminates TLS, so skip the TLS secrets of step 2 and give its listeners the
certificates instead, the custom fronts' wildcard included, as the
Gateway API guide shows:
httpRoute:
enabled: true
hostnames: [toucan.example.com]
parentRefs:
- name: my-gateway
namespace: gateway-system
docs:
enabled: true
hostnames: [docs.toucan.example.com]
parentRefs:
- name: my-gateway
namespace: gateway-system
backend:
frontsFileServer:
httpRoute:
enabled: true
hostnames: ["*.usercontent.example.net"]
parentRefs:
- name: my-gateway
namespace: gateway-systemTo let your users try Toucan AI on demo data, add sampleDatabase.enabled: true: the chart then runs
a PostgreSQL filled with HR data, which they can connect when they add a data source.
4. Install the chart
Log in to our registry with the same token, then install a version:
helm registry login registry.distr.sh -u - --password-stdin <<< "$DISTR_TOKEN"
helm upgrade --install toucan-ai oci://registry.distr.sh/toucantoco/toucan-ai-chart --version <version> \
-f values.yamlThe first install runs the database migrations before the app starts.
5. Check the deployment
Wait for every deployment to be ready, then call the health check, which answers OK:
kubectl wait --for=condition=available deployment -l app.kubernetes.io/instance=toucan-ai --timeout=15m
curl https://toucan.example.com/api/healthThe backend pods start only once the migrations are done. If the wait times out, kubectl get pods
shows which pod is stuck, and the migration Job's logs say why:
kubectl logs -l app.kubernetes.io/subcomponent=migrate --tail=100Migrations says how to run the Job again once fixed.
6. Create the first admin
kubectl exec deploy/toucan-ai-backend-web -- bun run --cwd apps/backend bootstrap-admin \
--user-email you@example.com --organization-name "Example"This creates the admin organization and its owner, then prints a link valid 24 hours. Open the link to set the owner's password, then sign in with it. It needs no SMTP, and running the command again prints a new link.
7. Check the instance
Sign in, then open the Instance page: it shows the version, the license, and whether each component answers. Test the LLM and the embeddings from there too.
Roll back
helm uninstall toucan-ai removes the release. The database, the bucket and the secrets you created
stay as they are, so installing again picks up where you left off. To start from scratch, also drop
the database and empty the bucket. The bundled PostgreSQL, Redis and bucket keep their data in
volumes that stay too: delete them with
kubectl delete pvc -l app.kubernetes.io/instance=toucan-ai, then the volumes themselves if your
storage class retains them (reclaimPolicy: Retain).
Once the instance is in use, roll an upgrade back as Upgrade strategy says.
Next steps
- Start using Toucan AI with Getting started with Core: your account already exists, so skip its first step.
- To give a team its own organization, create it from the organization menu and invite its owner.
- Connect organizations to your identity provider: see Identity integration.
- Keep the instance up to date: see Upgrade strategy.