Installation guide · Docker Compose
One server, one Compose file.
The Compose bundle runs every component on one Linux server: the four Mislata services, PostgreSQL with pgvector, Redis and SearXNG. Each supporting service can be replaced by one you already run. The steps below install release v0.2.64.
§ 01
Requirements
- A Linux server, x86-64 (amd64), with at least 4 vCPU, 8 GB of memory and 50 GB of SSD disk (8 vCPU and 16 GB recommended).
- Docker Engine 24 or later with the Compose plugin 2.24 or later (
docker compose version),curlandopenssl. - A DNS name pointing at the server, and ports 80 and 443 open to the internet if Caddy obtains the certificate.
- The Microsoft Entra ID app registration described in What you prepare.
- Outbound HTTPS to
ghcr.io, Docker Hub, your model endpoint, Microsoft Entra ID andhttps://api.mislata.eu(see Network access).
§ 02
Download the bundle
Option A: the installer script
The script downloads the bundle into ./mislata, writes .env with new secrets, pulls the images, starts the stack, waits up to 5 minutes for the API to report healthy and prints the setup address and the bootstrap token. Pass the address users will open with --public-url:
curl -fsSL https://mislata.eu/install/files/v0.2.64/infra/selfhosted/install.sh | bash -s -- --public-url https://ai.example.comWhen the script reads from a pipe it cannot ask questions, so without --public-url the address stays http://localhost:8080. To read the script before you run it, download it first:
curl -fsSLO https://mislata.eu/install/files/v0.2.64/infra/selfhosted/install.sh
less install.sh
bash install.sh --public-url https://ai.example.com --no-startWith --no-start the script stops after writing .env, so you can change settings (your own database, storage, email) before the first start. Then start the stack as in Start the stack.
| Option | Effect |
|---|---|
--public-url <url> | Sets MISLATA_PUBLIC_URL in a new .env. |
--dir <path> | Install directory. Default ./mislata. |
--version <tag> | Release to download and run. Default v0.2.64 for this script. |
--no-start | Write the files and .env, do not pull or start. |
--force | Replace an existing .env (the old one is renamed .env.bak.<timestamp>). Without it, an existing .env and its secrets are kept. |
--non-interactive | Never ask for the public URL. |
--base-url <url> | Download the bundle from another address, for example an internal mirror. Default https://mislata.eu/install/files. |
The script generates POSTGRES_PASSWORD, EXTERNAL_AUTH_SIGNING_KEY, SEARXNG_SECRET and Setup__BootstrapToken, and sets MISLATA_VERSION. .env is created with mode 600.
Option B: download the files yourself
Every file of the bundle is published under https://mislata.eu/install/files/v0.2.64/ with the same path it has in the install directory. The environment template is published as env.example because the site does not serve files whose name starts with a dot; save it as .env.example.
B=https://mislata.eu/install/files/v0.2.64
mkdir -p mislata/infra/selfhosted/searxng && cd mislata
for f in docker-compose.selfhosted.yml docker-compose.external-db.yml \
docker-compose.external-redis.yml infra/selfhosted/README.md \
infra/selfhosted/caddy.example.conf infra/selfhosted/install.sh \
infra/selfhosted/searxng/settings.yml infra/selfhosted/searxng/limiter.toml \
SHA256SUMS; do
curl -fsSL "$B/$f" -o "$f"
done
curl -fsSL "$B/infra/selfhosted/env.example" -o infra/selfhosted/.env.example
grep -v '^.* helm/' SHA256SUMS | sha256sum -c -On macOS use shasum -a 256 -c - instead of sha256sum -c -. SHA256SUMS also lists the two Helm example files, which this download skips.
| File | Purpose |
|---|---|
| docker-compose.selfhosted.yml | The stack: frontend, API, document generator, export worker, PostgreSQL, Redis, SearXNG, optional MinIO. |
| docker-compose.external-db.yml | Override: do not start the bundled PostgreSQL. |
| docker-compose.external-redis.yml | Override: do not start the bundled Redis. |
| infra/selfhosted/env.example | Every setting with comments. Save as infra/selfhosted/.env.example. |
| infra/selfhosted/install.sh | The installer script. |
| infra/selfhosted/caddy.example.conf | Caddy reverse proxy with automatic HTTPS. |
| infra/selfhosted/searxng/settings.yml | SearXNG settings: JSON output on, bot limiter off (the API is the only caller). |
| infra/selfhosted/searxng/limiter.toml | SearXNG limiter settings. |
| infra/selfhosted/README.md | Operator reference for the bundle. |
| SHA256SUMS | SHA-256 checksums, listed under the installed file names. |
§ 03
Fill in .env
Skip this step if the installer wrote .env, unless you need to change a setting. By hand, copy the template next to the Compose file and set the required values:
cp infra/selfhosted/.env.example .env
chmod 600 .env
openssl rand -hex 24 # POSTGRES_PASSWORD (no / + : @ characters: it goes into a URL)
openssl rand -base64 48 # EXTERNAL_AUTH_SIGNING_KEY
openssl rand -hex 32 # SEARXNG_SECRET
openssl rand -hex 32 # Setup__BootstrapToken (optional)| Variable | Value |
|---|---|
MISLATA_PUBLIC_URL | The address users open, without a trailing slash, for example https://ai.example.com. It sets the CORS origin, the OAuth callback addresses and the links in emails. Default http://localhost:8080. |
POSTGRES_PASSWORD | Password of the bundled PostgreSQL. Not needed with your own database. |
EXTERNAL_AUTH_SIGNING_KEY | Signs guest sign-in links. At least 32 bytes. |
SEARXNG_SECRET | Secret of the bundled SearXNG. |
| Variable | Default | Purpose |
|---|---|---|
MISLATA_VERSION | v0.2.64 | Image tag, with the leading v. Pin it. |
Setup__BootstrapToken | empty | Setup wizard token. Empty: a new token is printed in the API log at every start until setup is finished. |
FRONTEND_HOST_PORT, FRONTEND_BIND_ADDRESS | 8080, 0.0.0.0 | Published port and address of the frontend. Use 127.0.0.1 when a reverse proxy on the same server handles TLS. |
WEBAPI_HOST_PORT | 9081 | API port, always bound to 127.0.0.1 (diagnostics). |
POSTGRES_USER, POSTGRES_DB | mislata | Bundled PostgreSQL user and database. |
POSTGRES_CONNECTION_STRING, POSTGRES_URL | bundled | Your own PostgreSQL, see Your own PostgreSQL. |
REDIS_CONNECTION_STRING | redis:6379 | Your own Redis, see Your own Redis. |
STORAGE_PROVIDER | Local | Local, MinIO (any S3-compatible store) or azure. See Object storage. |
MINIO_ROOT_USER, MINIO_ROOT_PASSWORD | mislata, empty | Credentials of the bundled MinIO. |
S3_ENDPOINT, S3_ACCESS_KEY, S3_SECRET_KEY, S3_BUCKET_NAME, S3_USE_SSL, S3_PUBLIC_BASE_URL | bundled MinIO | Your own S3-compatible store. |
AZURE_STORAGE_CONNECTION_STRING, AZURE_STORAGE_ACCOUNT_URL, AZURE_STORAGE_CONTAINER, AZURE_STORAGE_EXPORTS_CONTAINER | empty, empty, mislata-documents, mislata-exports | Azure Blob Storage. |
EMAIL_SMTP_HOST, EMAIL_SMTP_PORT, EMAIL_SMTP_USERNAME, EMAIL_SMTP_PASSWORD, EMAIL_FROM_EMAIL, EMAIL_FROM_NAME | empty, 587, empty, empty, empty, Mislata | Outgoing email. Without a host, invitations are logged and not sent. |
GRAPH_API_TENANT_ID, GRAPH_API_CLIENT_ID, GRAPH_API_CLIENT_SECRET | empty | Microsoft Graph app for the Microsoft 365 connectors. See Connectors. |
LICENSE_KEY | empty | A licence key. A key pasted in the app also works; the one that ends later is used. |
LICENSE_RENEWAL_URL, LICENSE_INSTALL_TOKEN | empty | Automatic key renewal. Starting a trial or buying from the app saves these for you. |
LICENSE_VENDOR_URL | empty (https://api.mislata.eu) | Licence service. Leave empty. |
RUN_MIGRATIONS | true | Apply database migrations when the API starts. Only new migrations run. |
WEBAPI_ROLE | all | all, api or worker. See Separate background worker. |
UPLOAD_MAX_BYTES, UPLOAD_ALLOWED_EXTENSIONS | 10485760, .pdf,.doc,.docx,.txt,.jpg,.png | Upload limits. |
DOCUMENT_GENERATOR_LOG_LEVEL | INFO | DEBUG, INFO, WARNING or ERROR. |
BILLING_ENABLED, MOLLIE_API_KEY, MOLLIE_WEBHOOK_BASE_URL | false | In-app billing. Leave it off: the licence is bought separately. |
IMAGE_PREFIX, CONTAINER_PREFIX | ghcr.io/victorzkov, mislata-ai | Registry path of the images (set it when you mirror them) and the container name prefix. |
Any other API setting goes in an optional file webapi.extra.env next to the Compose file, one KEY=value per line, with __ between the levels of the setting name (for example Outlook__Authority=<tenant id>). It is read by the API container only.
§ 04
Start the stack
docker compose -f docker-compose.selfhosted.yml config --quiet # checks .env; names any missing variable
docker compose -f docker-compose.selfhosted.yml pull
docker compose -f docker-compose.selfhosted.yml up -d
docker compose -f docker-compose.selfhosted.yml psThe API applies the database migrations on its first start, which can take a few minutes. Wait until webapi shows healthy in ps. Follow its log with docker compose -f docker-compose.selfhosted.yml logs -f webapi.
§ 05
HTTPS with Caddy
The frontend container is the only entry point: it forwards /api, /hubs, /v1, /mcp and /.well-known/ to the API. A reverse proxy therefore forwards every path to the frontend.
In
.env, setMISLATA_PUBLIC_URL=https://ai.example.comandFRONTEND_BIND_ADDRESS=127.0.0.1, then apply it:bash docker compose -f docker-compose.selfhosted.yml up -dInstall Caddy from your distribution’s packages or from caddyserver.com. Copy the example, replace
ai.example.comwith your address and reload:bash sudo cp infra/selfhosted/caddy.example.conf /etc/caddy/Caddyfile sudo $EDITOR /etc/caddy/Caddyfile sudo systemctl reload caddyCaddy obtains the certificate when the DNS name resolves to the server and ports 80 and 443 are reachable. Open
https://ai.example.com.
ai.example.com {
encode zstd gzip
reverse_proxy 127.0.0.1:8080 {
flush_interval -1
transport http {
read_timeout 5m
write_timeout 5m
}
}
}Another proxy (nginx, Traefik, a load balancer) works the same way: forward every path to the frontend port, allow WebSocket upgrades, turn response buffering off (chat answers stream) and allow long reads (5 minutes in the Caddy example). If Caddy runs in a container on the Compose network, use frontend:8080 as the upstream.
§ 06
Check that it runs
curl -fsS https://ai.example.com/api/health # liveness, always 200 while the API runs
curl -fsS https://ai.example.com/api/health/ready # 200, or 503 when PostgreSQL is down
curl -fsS https://ai.example.com/api/version # {"version":"...","sha":"..."}
curl -fsS https://ai.example.com/api/installation/config/api/health/ready returns {"status":"healthy","checks":[...]}. A Redis outage shows as degraded with status 200, because every use of Redis has a fallback. On the server itself, http://127.0.0.1:8080 (frontend) and http://127.0.0.1:9081 (API) answer the same paths.
§ 07
Get the bootstrap token
The setup wizard at https://ai.example.com/setup asks for this token. If .env sets it (the installer does):
grep '^Setup__BootstrapToken=' .envOtherwise the API prints a new token at every start while setup is pending:
docker compose -f docker-compose.selfhosted.yml logs webapi | grep -A1 "Bootstrap token"Only the last printed token works, and no token works once setup is finished. Continue with the setup wizard.
§ 08
Your own PostgreSQL, Redis or storage
Each bundled service can be replaced. The override files switch the bundled container off; the API and the export worker ignore the missing dependency.
Your own PostgreSQL
- PostgreSQL 16 or later with the
vectorextension (pgvector). - An empty database and a user that can create tables, indexes and sequences in it and owns it: migrations run as this user when the API starts.
- A direct connection or a session-mode pooler. The background workers use advisory locks, which do not work through a transaction-mode pooler.
Azure Database for PostgreSQL Flexible Server: allow-list the extension, create the user and database, then create the extension as the admin user inside the new database.
az postgres flexible-server parameter set --resource-group <rg> --server-name <server> \
--name azure.extensions --value VECTORCREATE ROLE mislata LOGIN PASSWORD '<password>';
GRANT mislata TO CURRENT_USER; -- PostgreSQL 16: needed to create a database owned by mislata
CREATE DATABASE mislata OWNER mislata;
\c mislata
CREATE EXTENSION IF NOT EXISTS vector;
ALTER SCHEMA public OWNER TO mislata; -- managed servers (Azure): public is not owned by the database ownerAs owner of the database, mislata can create the tables in its public schema. If azure.extensions already lists other extensions, keep them in the value (comma separated). Allow the server’s IP in the firewall rules, or use private access in the server’s virtual network. Amazon RDS: run CREATE EXTENSION vector; in the database as a user with the rds_superuser role.
Set both connection settings in .env. They describe the same database in two formats: the API and the export worker read the Npgsql string, the document generator reads the URL (percent-encode special characters of the password in the URL). POSTGRES_PASSWORD is then not needed.
POSTGRES_CONNECTION_STRING=Host=myserver.postgres.database.azure.com;Port=5432;Database=mislata;Username=mislata;Password=<password>;SSL Mode=Require;Maximum Pool Size=50
POSTGRES_URL=postgresql://mislata:<password>@myserver.postgres.database.azure.com:5432/mislata?sslmode=requireAdd Trust Server Certificate=true to the Npgsql string only when the server certificate is not signed by a public certificate authority. Start with the override file:
docker compose -f docker-compose.selfhosted.yml -f docker-compose.external-db.yml up -dYour own Redis
Set REDIS_CONNECTION_STRING in StackExchange.Redis format. Azure Cache for Redis uses TLS on port 6380 and the access key as password (access-key authentication must be on):
REDIS_CONNECTION_STRING=myredis.redis.cache.windows.net:6380,password=<access key>,ssl=True,abortConnect=False
# Plain Redis with a password:
# REDIS_CONNECTION_STRING=redis.internal:6379,password=<password>docker compose -f docker-compose.selfhosted.yml -f docker-compose.external-redis.yml up -d
# both overrides:
docker compose -f docker-compose.selfhosted.yml -f docker-compose.external-db.yml -f docker-compose.external-redis.yml up -dObject storage
| `STORAGE_PROVIDER` | Where files go | Document export |
|---|---|---|
Local (default) | Volume mislata-uploads | Not available: the export worker stays idle |
MinIO | The bundled MinIO, or any S3-compatible store | Available |
azure | Azure Blob Storage | Available |
Bundled MinIO. Set STORAGE_PROVIDER=MinIO and MINIO_ROOT_PASSWORD, then start with the minio profile (or put COMPOSE_PROFILES=minio in .env). The buckets documents and generated-documents are created for you.
docker compose -f docker-compose.selfhosted.yml --profile minio up -dYour own S3 or S3-compatible store. Create two buckets first, <S3_BUCKET_NAME> (default documents) and generated-documents; the application does not create them. Then set:
STORAGE_PROVIDER=MinIO
S3_ENDPOINT=s3.eu-west-1.amazonaws.com # host[:port], no scheme
S3_USE_SSL=true
S3_BUCKET_NAME=documents
S3_ACCESS_KEY=<access key>
S3_SECRET_KEY=<secret key>Azure Blob Storage. Set STORAGE_PROVIDER=azure and either a connection string, or the account URL for an identity with the Storage Blob Data Contributor role on the account. The containers mislata-documents and mislata-exports are created on first use.
STORAGE_PROVIDER=azure
AZURE_STORAGE_CONNECTION_STRING=DefaultEndpointsProtocol=https;AccountName=<account>;AccountKey=<key>;EndpointSuffix=core.windows.net
# or, with a managed identity instead of a key:
# AZURE_STORAGE_ACCOUNT_URL=https://<account>.blob.core.windows.netWith the account URL, the API and the export worker sign in with DefaultAzureCredential, for example the managed identity of an Azure virtual machine. A connection string wins when both are set.
§ 09
Separate background worker
The API container runs the HTTP API and the background workers (document indexing, mail, Teams and Slack sync, schedulers). On one server, keep WEBAPI_ROLE=all. To run the workers in a second container, create docker-compose.worker.yml:
services:
webapi:
environment:
App__Role: api
webapi-worker:
extends:
file: docker-compose.selfhosted.yml
service: webapi
container_name: mislata-ai-webapi-worker
ports: !reset []
environment:
App__Role: workerdocker compose -f docker-compose.selfhosted.yml -f docker-compose.worker.yml up -dA worker answers only /api/health and /api/version. The queue is in PostgreSQL and periodic jobs run on one worker at a time, so several workers are safe.
§ 10
Upgrade
Back up the database (see Backup and restore).
Get the bundle of the new release. The installer keeps
.envand its secrets, replaces the bundle files and setsMISLATA_VERSION:bash curl -fsSL https://mislata.eu/install/files/<new tag>/infra/selfhosted/install.sh \ | bash -s -- --dir /path/to/mislata --no-startOr edit
MISLATA_VERSIONin.envyourself and replace the bundle files you downloaded by hand. Set the version in.env: a version given only on the command line is lost at the nextdocker composecommand.Pull and restart. The API applies the new migrations when it starts and exits with an error, instead of starting half-working, if the database cannot be reached.
bash docker compose -f docker-compose.selfhosted.yml pull docker compose -f docker-compose.selfhosted.yml up -d curl -fsS https://ai.example.com/api/version
§ 11
Backup and restore
| Volume | Contents | Back up |
|---|---|---|
mislata-postgres | All application data, embeddings and the Data Protection keys that encrypt stored secrets | Daily, with pg_dump |
mislata-uploads | Uploaded files (Local storage only) | Daily |
mislata-minio | Bundled MinIO data | Daily |
mislata-redis | Cache and SignalR backplane | Not needed |
Also keep a copy of .env: it holds the signing key and the passwords. docker compose down keeps the volumes; down -v deletes them.
docker compose -f docker-compose.selfhosted.yml exec -T postgres pg_dump -U mislata -d mislata -Fc > mislata-$(date +%F).dump
docker run --rm -v mislata-uploads:/data:ro -v "$PWD":/backup alpine \
tar czf /backup/uploads-$(date +%F).tgz -C /data .Copy the files off the server. With your own database or storage, use the provider’s backups as well.
docker compose -f docker-compose.selfhosted.yml stop webapi document-export document-generator frontend
docker compose -f docker-compose.selfhosted.yml exec -T postgres psql -U mislata -d postgres \
-c 'DROP DATABASE mislata WITH (FORCE)' -c 'CREATE DATABASE mislata OWNER mislata'
docker compose -f docker-compose.selfhosted.yml exec -T postgres psql -U mislata -d mislata -c 'CREATE EXTENSION IF NOT EXISTS vector'
docker compose -f docker-compose.selfhosted.yml exec -T postgres pg_restore -U mislata -d mislata --no-owner --exit-on-error < mislata-2026-10-09.dump
docker compose -f docker-compose.selfhosted.yml up -dRestore the whole dump, including the DataProtectionKeys table: without it, connector sign-ins (Outlook, Gmail, Teams, Slack, OneDrive) cannot be decrypted and users must reconnect. A dump from an older release is migrated when the API starts. Check /api/health/ready, sign in, and press Test on a connector connection.
§ 12
Troubleshooting
| Symptom | Cause and fix |
|---|---|
docker compose config fails | A required variable is empty; the message names it. |
Blank page or 502 on /api | Check docker compose logs frontend webapi. The reverse proxy must forward every path to the frontend. |
| The API exits at start | Wrong POSTGRES_PASSWORD or connection string, or the vector extension is missing. See logs webapi. |
| The wizard rejects the token | The API restarted and printed a new token. Use the last one, or set Setup__BootstrapToken in .env. |
AADSTS50011 or “invalid redirect_uri” at sign-in | MISLATA_PUBLIC_URL must match the browser address exactly (scheme, host, port, no trailing slash), and <that URL>/callback must be a SPA redirect URI of the app registration. |
| Sign-in works but every API call returns 401 | The app registration does not expose access_as_user, or the wizard’s API scope does not match a changed Application ID URI. |
| “Missing licence” or HTTP 402 | Start the trial or paste a key in the wizard or in Administration → Licence. |
| Invitation emails do not arrive | Set EMAIL_SMTP_*; without a host they are only logged. |
| Web search returns nothing | Check docker compose logs searxng and outbound access from the server to search engines. |
| Export of a generated document does nothing | Exports need STORAGE_PROVIDER=MinIO or azure. |