Self-hosting
xixo ships as a container image. Point it at Postgres and OpenSearch, and it migrates itself on
boot. Sign-in is built in: xixo serves its own masks at /id.
What it runs
Section titled “What it runs”| Web | The image’s default command, ./bin/thrust ./bin/rails server, on port 80 |
| Worker | ./bin/jobs, from the same image |
| xixo link beside the server | ghcr.io/xixo/xixo-link, which reads and writes the server’s files |
| Postgres | xixo_production, xixo_production_cache, xixo_production_queue, xixo_production_cable, and xixo_production_masks for the built-in masks |
| OpenSearch | The search index |
When the container runs the web command, bin/docker-entrypoint runs these before the server
starts:
bin/rails db:preparecreates or migrates the databases.bin/rails xixo:tenantscreates the catalog named inXIXO_TENANT, in xixo and in the built-in masks.bin/rails xixo:resourcesdeclares the resources inconfig/resources.yml.
Any other command starts without them.
Image tags
Section titled “Image tags”| Tag | Pushed on |
|---|---|
:<version>, such as :0.2.0, and :<major>.<minor>, such as :0.2 |
each server release |
:main, :sha-<full commit sha>, and :latest |
every push to main |
ghcr.io/xixo/xixo is built for amd64. ghcr.io/xixo/xixo-link and ghcr.io/xixo/xixo-updater are built
for amd64 and arm64. Each image carries a build attestation, which gh attestation verify oci://ghcr.io/xixo/xixo:main --repo xixo/xixo checks.
A server release has a server-v<version> tag and its changes in CHANGELOG.md. An image built
from main holds the same xixo link builds and mac reader as a release, and names its commit after
the release it follows, such as 0.2.0+1a2b3c4. A machine on 0.2.0 takes that build, and takes
0.2.1 after it. Pin a version in production and read the changelog before you change it, or
follow :main to run every push. :latest follows main.
The database role
Section titled “The database role”In production xixo always connects as the role xixo, with the password in
XIXO_DATABASE_PASSWORD. POSTGRES_USER is not read there. The official Postgres image makes
POSTGRES_USER a superuser, so xixo cannot use it.
-
Connect to Postgres as an administrator and create the role:
CREATE ROLE xixo WITH LOGIN PASSWORD 'change-me' CREATEDB;CREATEDBletsdb:preparecreate the databases on first boot. To create them yourself, create each one withOWNER xixoand leaveCREATEDBoff. -
Check that the role holds neither
SUPERUSERnorBYPASSRLS:SELECT rolsuper, rolbypassrls FROM pg_roles WHERE rolname = 'xixo';Both must be
f. Every table in the catalog is behind a row-level security policy, and a role with either attribute skips it. xixo and the built-in masks refuse to serve requests as such a role.
Encryption and secrets
Section titled “Encryption and secrets”The database holds every resource’s credentials and the masks client secret. xixo
encrypts those columns with Active Record Encryption. The built-in masks derives its own keys from
SECRET_KEY_BASE.
| Secret | Protects |
|---|---|
SECRET_KEY_BASE |
Session cookies, and every key the built-in masks uses. Anyone who holds it can forge a session. Changing it signs everyone out of masks and makes its encrypted columns unreadable. |
ENCRYPTION_PRIMARY_KEY, ENCRYPTION_DETERMINISTIC_KEY, ENCRYPTION_KEY_DERIVATION_SALT |
xixo’s encrypted columns. |
-
Generate
SECRET_KEY_BASEin a xixo checkout:Terminal window bin/rails secret -
Generate the encryption keys in the same checkout:
Terminal window bin/rails db:encryption:init -
Set the three values it prints as variables:
Printed as Variable primary_keyENCRYPTION_PRIMARY_KEYdeterministic_keyENCRYPTION_DETERMINISTIC_KEYkey_derivation_saltENCRYPTION_KEY_DERIVATION_SALT
Production refuses to boot when any of the four is unset or starts with dev_only_, the prefix of
the development values in .env.example and compose.yml.
Name, host, and origin
Section titled “Name, host, and origin”- Set
XIXO_TENANTto a name for the catalog, such asxixo. The built-in masks names its tenant the same, and the folders xixo link beside the server uses are named after it. Without it, every page answers404 Unknown tenant. - Set
XIXO_HOST_SUFFIXto the domain xixo answers under, such asxixo.example.com. Rails then answers403to any otherHost, except at/up. Unset, Rails accepts every host. - Set
XIXO_PUBLIC_ORIGINto the origin browsers use, such ashttps://xixo.example.com. Production refuses to boot without it. - Point DNS for the host at your reverse proxy.
The proxy must terminate TLS and pass the original Host header. RAILS_ASSUME_SSL and
RAILS_FORCE_SSL default to true.
One xixo can also serve several separate catalogs, each at its own host. See multiple tenants.
Example compose.yml
Section titled “Example compose.yml”x-xixo: &xixo image: ghcr.io/xixo/xixo:0.2 restart: unless-stopped environment: POSTGRES_HOST: postgres XIXO_DATABASE_PASSWORD: ... OPENSEARCH_URL: http://opensearch:9200 OPENSEARCH_USERNAME: admin OPENSEARCH_PASSWORD: ... SECRET_KEY_BASE: ... ENCRYPTION_PRIMARY_KEY: ... ENCRYPTION_DETERMINISTIC_KEY: ... ENCRYPTION_KEY_DERIVATION_SALT: ... XIXO_TENANT: xixo XIXO_HOST_SUFFIX: xixo.example.com XIXO_PUBLIC_ORIGIN: https://xixo.example.com MASKS_MAIL_FROM: xixo@example.com MASKS_SMTP_ADDRESS: smtp.example.com MASKS_SMTP_USERNAME: ... MASKS_SMTP_PASSWORD: ... XIXO_LOCAL_LINK: /handoff volumes: - storage:/rails/storage - link-handoff:/handoff
services: xixo: <<: *xixo healthcheck: test: ["CMD", "curl", "-fsS", "http://localhost/up"] interval: 30s timeout: 5s retries: 3 start_period: 180s deploy: resources: limits: memory: 1g depends_on: postgres: condition: service_healthy opensearch: condition: service_healthy
worker: <<: *xixo command: ["./bin/jobs"] healthcheck: test: ["CMD", "bin/jobs-healthy"] interval: 30s timeout: 10s retries: 3 start_period: 120s deploy: resources: limits: memory: 2g depends_on: xixo: condition: service_healthy
link: image: ghcr.io/xixo/xixo-link:0.2 restart: unless-stopped environment: XIXO_LINK_XIXO: https://xixo.example.com XIXO_LINK_ISSUER: https://xixo.example.com/id XIXO_LINK_HANDOFF: /handoff/xixo XIXO_LINK_WRITABLE: /data/files/xixo volumes: - link-state:/var/lib/xixo-link - link-handoff:/handoff - files:/data/files deploy: resources: limits: memory: 6g depends_on: xixo: condition: service_healthy
postgres: image: postgres:17-alpine restart: unless-stopped environment: POSTGRES_PASSWORD: ... healthcheck: test: ["CMD-SHELL", "pg_isready -U postgres"] interval: 10s timeout: 5s retries: 10 deploy: resources: limits: memory: 1g volumes: - postgres:/var/lib/postgresql/data - ./initdb:/docker-entrypoint-initdb.d:ro
opensearch: image: opensearchproject/opensearch:2.19.1 restart: unless-stopped environment: discovery.type: single-node OPENSEARCH_INITIAL_ADMIN_PASSWORD: ... plugins.security.ssl.http.enabled: "false" OPENSEARCH_JAVA_OPTS: -Xms512m -Xmx512m healthcheck: test: ["CMD-SHELL", "curl -fsS -u \"admin:$${OPENSEARCH_INITIAL_ADMIN_PASSWORD}\" http://localhost:9200/_cluster/health"] interval: 10s timeout: 5s retries: 30 deploy: resources: limits: memory: 1536m volumes: - opensearch:/usr/share/opensearch/data
caddy: image: caddy:2-alpine restart: unless-stopped ports: - "443:443" - "80:80" volumes: - ./Caddyfile:/etc/caddy/Caddyfile:ro - caddy-data:/data depends_on: - xixo
volumes: storage: files: link-state: link-handoff: postgres: opensearch: caddy-data:initdb/01-xixo.sql holds the CREATE ROLE statement from the database role,
with the password in XIXO_DATABASE_PASSWORD. Postgres runs it when its volume is first created.
The Caddyfile sends the host to xixo:
xixo.example.com { reverse_proxy xixo:80}Notes on the file:
OPENSEARCH_INITIAL_ADMIN_PASSWORDsets theadminpassword when the volume is first created. OpenSearch refuses to start when it is weak.- Traffic between the containers is plain HTTP. Keep Postgres and OpenSearch on a network that only xixo reaches, and publish no port for either.
- masks sends invitations, password resets, and sign-in codes from
MASKS_MAIL_FROMthrough theMASKS_SMTP_server. Without them, masks sends no mail. - The worker waits for the web container to report healthy, so it never runs before the migrations.
- OpenSearch gets three times its heap. xixo link gets 6 GB, because a program it runs on one file may use up to 4 GB, and exiftool up to 6 GB.
- Chromium in the worker keeps its sandbox. Leave
XIXO_CHROME_NO_SANDBOXunset, and never run the worker privileged.
Sign in for the first time
Section titled “Sign in for the first time”xixo signs people in through masks, and by default it serves that masks itself at /id, such as
https://xixo.example.com/id. See signing in.
-
Start the stack:
Terminal window docker compose up -d -
Find the setup token that
xixo:tenantsprints while masks has no account yet:Terminal window docker compose logs xixo | grep "masks:"To choose the token yourself, set
MASKS_SETUP_TOKENto at least 24 characters before you start. -
Open xixo in a browser and click Get started….
-
Enter the setup token when masks asks for it.
-
Create the first account. That account owns the masks tenant.
-
Approve xixo when masks asks. You are signed in.
The account that owns the masks tenant becomes xixo’s administrator on its first sign-in. Invite
everyone else from masks at /id/manage.
The built-in masks reads the other variables a masks server reads, such as MASKS_SMTP_PORT. See
the masks ENV vars. It ignores MASKS_TENANT,
MASKS_TENANTS, and MASKS_PUBLIC_ORIGIN_TEMPLATE, because xixo sets them from its own variables.
To sign in through a masks server that runs apart from xixo, see a masks server of your own.
xixo link beside the server
Section titled “xixo link beside the server”xixo opens no file itself. The link container runs xixo link, which reads every file for the
server, writes uploads into the files volume, and runs the programs that read documents, images,
and recordings. See machines.
It takes these settings:
XIXO_LINK_XIXO |
xixo’s origin. |
XIXO_LINK_ISSUER |
xixo’s masks issuer: the origin followed by /id with the built-in masks. |
XIXO_LINK_HANDOFF |
/handoff/xixo, the folder named after XIXO_TENANT in the volume the web and worker containers mount at XIXO_LOCAL_LINK. |
XIXO_LINK_WRITABLE |
Folders it may read and write, separated by colons. Each one is created on boot when it is missing. |
XIXO_LINK_FOLDERS |
Folders it may only read, separated by colons. Mount each one read-only. |
It enrolls itself after the first sign-in connects xixo to masks:
- xixo link leaves a request in
/handoff/xixo. - The worker answers with a single-use enrollment token.
- xixo link registers its own key with masks, and keeps it in its state volume.
Deleting the state volume makes it enroll again. It shows on the Resources page as
This server. Each folder it shares joins the catalog by itself. A folder the deployment declares,
such as files, is everyone’s, and any other is held for the administrator who signs in first. xixo
may do everything with the folders it shares, and writes into the ones named in
XIXO_LINK_WRITABLE.
Storage
Section titled “Storage”xixo uses storage in two places.
- Staging. Uploads wait in Active Storage until a job places them. The default,
XIXO_STAGING_SERVICE=local, writes to/rails/storage, so the web and worker containers must share it. To stage in S3-compatible storage, setXIXO_STAGING_SERVICE=s3and the otherXIXO_STAGING_variables on the ENV vars page. - Catalog storage.
config/resources.ymldeclares afilesystemresource named Files as the default storage, at/data/files/xixoon xixo link beside the server, the folder named afterXIXO_TENANT. That folder must be inXIXO_LINK_WRITABLE, on a volume mounted into thelinkcontainer. Until xixo link connects, a placed upload waits. To keep files somewhere else, see attaching a resource.
Private networks
Section titled “Private networks”xixo refuses to reach a private, loopback, or link-local address for a resource. List the origins of services on your own network, separated by commas:
| Variable | Lets through |
|---|---|
XIXO_S3_ORIGINS |
An s3 endpoint, such as a MinIO container at http://minio:9000 |
XIXO_MCP_ORIGINS |
An MCP server attached as a resource |
XIXO_SEARCH_ORIGINS |
A self-hosted web search backend |
XIXO_INFERENCE_ORIGINS |
Every model server, public or private, such as https://api.openai.com,http://ollama:11434 |
A model server whose origin is not in XIXO_INFERENCE_ORIGINS is unusable, unless xixo reaches it
through a machine running xixo link. See security.
Transcription
Section titled “Transcription”Audio and video are transcribed by a resource that serves the transcription role. Without one,
each recording is analyzed without a transcript. Any server that answers OpenAI’s
/audio/transcriptions works, such as whisper.cpp’s whisper-server:
-
Download a model on the machine with the best GPU.
ggml-base.en.bintranscribes English, and the models without.entranscribe other languages.Terminal window curl -fL -o ggml-base.en.bin \https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-base.en.bin -
Start the server:
Terminal window whisper-server -m ggml-base.en.bin --host 0.0.0.0 --port 11435 \--inference-path /v1/audio/transcriptions -
Attach an
openai-compatibleresource with the base URLhttp://<host>:11435/v1. Give it any name as its Transcription model, because whisper.cpp answers with the model it started with. -
Add the origin to
XIXO_INFERENCE_ORIGINS, or reach the server through a machine running xixo link.
The worker
Section titled “The worker”./bin/jobs starts Solid Queue, which runs every job and the schedule in config/recurring.yml.
BULK_CONCURRENCY, ANALYSIS_CONCURRENCY, and ANALYSIS_THREADS size its pools. See
jobs.
- Raise
ANALYSIS_CONCURRENCYwhen analyses wait in the queue. Chromium holds a core while it renders a snapshot. - On a small host, set
SOLID_QUEUE_IN_PUMA=trueon the web container and run no worker. - Syncs and exports save their place as they go, so a restarted worker carries on from there.
XIXO_ITERATORS_DISABLED=truestops every sync, analysis, export, and reindex.
Follow job progress in the worker’s log:
docker compose logs -f workerMission Control at /jobs
Section titled “Mission Control at /jobs”Mission Control is mounted at /jobs. Its HTTP basic authentication is on, and xixo sets no user
or password for it, so it answers 401 to every request. Leave it closed, or block /jobs at the
proxy.
Health check
Section titled “Health check”GET /up checks the database, the search index, the queue, and the workers. It skips the host
check and is not logged.
docker compose exec -T xixo curl -fsS http://localhost/up{"status":"ok","checks":{"database":"ok","search":"ok","queue":"ok","worker":"ok"}}| Check | Fails when |
|---|---|
database |
The primary database does not answer. |
search |
OpenSearch does not answer within two seconds, or its cluster is red. |
queue |
A job has waited more than ten minutes for a worker. |
worker |
No worker has sent a heartbeat in XIXO_WORKER_QUIET_SECONDS, 300 by default. It always passes with SOLID_QUEUE_IN_PUMA set. |
/up answers 503 when database or search fails, and 200 otherwise. A late queue or a quiet
worker shows in the body without failing, so a slow worker does not restart the web container.
bin/jobs-healthy checks the worker. It exits 0 when a worker on the same host sent a heartbeat
within the same window, and 1 with the reason when none did.
Upgrade
Section titled “Upgrade”-
Read
CHANGELOG.mdfor every release between the one you run and the one you move to. -
Back up the catalog. Starting the old image again does not undo a migration. See back up.
-
Change the image tags in
compose.ymlto the new version. -
Pull the images and recreate the containers:
Terminal window docker compose pulldocker compose up -d
The web container applies new migrations on start, and the worker starts after it reports healthy. To go back, restore the backup and start the old version.
Keep xixo up to date
Section titled “Keep xixo up to date”xixo-updater keeps the server on builds that xixo’s CI built and signed. It runs as two containers
from ghcr.io/xixo/xixo-updater:
updater |
Checks the registry every 15 minutes. It has network access and no Docker socket. |
updater-gate |
Pulls images and replaces containers. It has the Docker socket and no network. |
Each image CI pushes carries a build attestation, signed through Sigstore, that names the repository, workflow, and commit that built it. The updater checks it before asking for an update, and the gate checks it again offline before it pulls or replaces anything. An image without one is refused, and the refusal is logged.
Set it up
Section titled “Set it up”-
In
x-xixo, change the image to a local tag that only the gate moves:x-xixo: &xixoimage: xixo-updates/xixo:currentpull_policy: never -
Do the same for
link:link:image: xixo-updates/xixo-link:currentpull_policy: neverlabels:network.xixo.updates: xixo-link -
Label
xixoandworker, and makexixowait for the gate:xixo:labels:network.xixo.updates: xixonetwork.xixo.updates.order: "1"depends_on:updater-gate:condition: service_healthyworker:labels:network.xixo.updates: xixonetwork.xixo.updates.order: "2" -
Add the two updater services and their volumes:
services:updater-gate:image: ghcr.io/xixo/xixo-updater:0.6command: ["gate"]user: rootnetwork_mode: nonerestart: unless-stoppedvolumes:- /var/run/docker.sock:/var/run/docker.sock- updater-gate:/run/xixo-updates/gate- updater-tuf:/run/xixo-updates/tuf:ro- updater-gate-cache:/var/lib/xixo-updates/cachehealthcheck:test: ["CMD", "/usr/local/bin/xixo-updater", "ready"]interval: 30sstart_period: 30mstart_interval: 5supdater:image: ghcr.io/xixo/xixo-updater:0.6command: ["watch"]restart: unless-stoppedenvironment:XIXO_UPDATES_CHANNEL: releasesvolumes:- updater-gate:/run/xixo-updates/gate- updater-tuf:/run/xixo-updates/tuf- updater-state:/var/lib/xixo-updates/state- updater-cache:/var/lib/xixo-updates/cache- updater-requests:/run/xixo-updates/requests:rovolumes:updater-gate:updater-tuf:updater-gate-cache:updater-state:updater-cache:updater-requests: -
Give
xixothe updater’s state to read and a folder to leave requests in, so Settings > Updates works:xixo:volumes:- updater-state:/var/lib/xixo-updates/state:ro- updater-requests:/run/xixo-updates/requests -
Start the stack:
Terminal window docker compose up -d
On the first start, the updater fetches the newest signed build and the gate tags it as
xixo-updates/xixo:current and xixo-updates/xixo-link:current. The other containers wait until
the gate reports healthy, which it does once it holds a build of each. After that,
docker compose up -d keeps the build the gate pinned, because the tag never changes.
What an update does
Section titled “What an update does”- The gate pulls every new image by digest.
- It replaces each labeled container, lowest
network.xixo.updates.orderfirst. It keeps the container’s own settings, volumes, and networks, changes only the image, and waits until Docker reports the container healthy. The web container runs the migrations, so it goes first. - The updater watches the containers for five minutes.
When a container does not come up, or turns unhealthy while it is watched, every container goes back
to the build before it, tagged xixo-updates/xixo:previous. That build is marked bad and is not
tried again. A newer build is. The gate refuses a build older than the one running.
A rollback starts the build before on the database the newer build migrated. A release adds tables and columns and removes them one release later, and CI rehearses the rollback of every build: it starts the last release, migrates with the new build, and starts the last release again. Settings > Updates says what a rollback keeps, and after one, what the database holds from the newer build. Back up before you follow a channel, and see restore when a rollback does not come up.
Settings
Section titled “Settings”| Variable | Default | Purpose |
|---|---|---|
XIXO_UPDATES_CHANNEL |
releases |
releases follows the highest x.y.z tag, signed by release.yml. main follows :main, signed by ci.yml after the tests pass. Set on updater. |
XIXO_UPDATES_KINDS |
xixo,xixo-link |
What the gate keeps up to date. Add masks when a masks server of your own runs on the same host, and label its container network.xixo.updates: masks. Set on updater-gate. |
Settings > Updates shows what each image runs, the last ten events, and Update now, Pause
updates, Roll back, and the channel. Administrators see it. A request goes to the updater through request.json, which the
updater reads and never writes back to, and each one is in the audit log.
The updater does not update itself. Each check also looks up the newest signed xixo-updater
build on the channel, and Settings > Updates says when it is newer than the one running. To
take it, change the image tag of updater and updater-gate in the compose file and run
docker compose up -d updater updater-gate. The build the gate pinned stays where it is.
/var/lib/xixo-updates/state in the updater container holds status.json, with each image’s
digest, commit, and containers, the updater’s own version and the newest signed one, and
events.jsonl, with the last 1,000 checks, pulls, swaps, rollbacks, and refusals.
docker compose logs updater updater-gate shows the same events.
Every administrator sees the Machines section of Settings > Updates, which shows the rollout of xixo link to the linked machines and lets them steer it, as add a machine describes.
Upgrading from 0.1
Section titled “Upgrading from 0.1”From 0.2, xixo link beside the server reads and writes the files resource. A migration moves every
filesystem resource to a folder on xixo link beside the server, at the path the server used, so
files becomes /data/files/xixo, named after XIXO_TENANT. Before you upgrade:
-
Mount the volume that held
/data/filesinto thelinkcontainer at/data/files, read-write. -
Set
XIXO_LINK_WRITABLEto/data/files/xixoon xixo link beside the server. -
Give xixo link, which runs as uid 1000, ownership of the files:
Terminal window docker compose run --rm --user root --entrypoint chown link -R 1000:1000 /data/files -
Remove the
/data/filesmount from the web and worker containers. -
Remove
XIXO_FILESYSTEM_ROOTSfrom the web and worker containers after the migration ran. The migration reads it to find where the files were.
A filesystem resource with a root in another directory moves to that path. Mount the directory
into the link container at the same path, and name it in XIXO_LINK_FOLDERS or
XIXO_LINK_WRITABLE. Until you do, the resource is unusable.
If it doesn’t work
Section titled “If it doesn’t work”-
Every page answers
404 Unknown tenant:XIXO_TENANTis not set. -
Requests answer
403: the request’s host is outsideXIXO_HOST_SUFFIX. -
Tenant::Exposed, naming the role: the database role holdsSUPERUSERorBYPASSRLS. Remove them withALTER ROLE xixo NOSUPERUSER NOBYPASSRLS;. -
The container exits with
XIXO_PUBLIC_ORIGIN is not set: set it to the origin browsers use. -
The container exits with
Switch::Invalid: a switch holds a value other thantrueorfalse. The error names it. -
No setup token in the logs: the masks tenant already has an account. Sign in with it, or set
MASKS_RECOVERas the masks docs describe. -
Uploads stage but never land: the worker is not running, or it cannot read the web container’s
/rails/storage. Checkdocker compose psanddocker compose logs worker. -
“shares /data/files/xixo read-only” or “no longer shares”: xixo link beside the server does not list the folder in
XIXO_LINK_WRITABLE, or its volume is not mounted into thelinkcontainer. -
An
s3resource on your network fails its check: add its origin toXIXO_S3_ORIGINS. -
Many files failed while a model server was away: once it answers again, start them over. Each file whose last analysis failed or ran out of time waits for the model server again, and xixo starts them 50 at a time. Pass
since:to go back only so far.xixois the name inXIXO_TENANT.Terminal window docker compose exec xixo bin/rails runner 'Tenant.switch(Tenant.find_by!(subdomain: "xixo")) { puts Analysis.retry_failed!(since: 2.days.ago) }'
Next steps
Section titled “Next steps”- Attach a resource to catalog files from another place.
- Add a machine to read the files on a computer.
- Connect an agent to search the catalog from an MCP client.