📡 Infrastructure

LiveKit Setup

YOffice AI uses LiveKit for real-time video, audio, and voice-assistant sessions. You can run LiveKit locally with Docker (recommended for development) or connect to LiveKit Cloud for a fully managed setup.

💡
You do not need LiveKit Cloud

The full YOffice feature set — including voice assistant, video calls, and screen sharing — works with a local LiveKit instance running in Docker. LiveKit Cloud is an optional convenience, not a requirement.

Which option is right for you?

OptionBest forCostSetup time
Local DockerDevelopment, self-hosted production, air-gapped environmentsFree (you host it)~5 minutes
LiveKit CloudTeams that want managed infrastructure and global media routing without running their own serversPay-as-you-go (free tier available)~10 minutes

Option A — Local LiveKit (Docker)

  1. Start LiveKit with Docker

    From command_center_tenant_server, run: docker compose up -d livekit. This uses livekit/livekit-server:latest with the config in livekit.yaml. Default ports: 7880 (WebSocket), 7881 (TCP), plus UDP for RTC. Default key: devkey / devkey-secret-32-chars-minimum!!

  2. Configure the tenant server

    In command_center_tenant_server/config/passwords.yaml (development section), set: livekitUrl: ws://localhost:7880, livekitKey: devkey, livekitSecret: devkey-secret-32-chars-minimum!! If the tenant server runs inside Docker on the same compose, use ws://livekit:7880.

  3. Start the rest of the stack

    Run Postgres, Redis, and both the Auth and Tenant servers as described in the Quick Start guide. The Flutter app receives the LiveKit URL automatically from the tenant server when it requests a room token — no LiveKit URL needs to be configured in the Flutter app itself.

Configuration reference

The tenant server needs three values in :config/passwords.yaml:

KeyDescriptionDefault (local)
livekitUrlWebSocket URL clients use to connect to LiveKitws://localhost:7880
livekitKeyAPI key (must match livekit.yaml)devkey
livekitSecretAPI secret (must match livekit.yaml)devkey-secret-32-chars-minimum!!
⚠️
Docker networking

If both the tenant server and LiveKit run inside the same Docker Compose network, use ws://livekit:7880 (service name) instead of ws://localhost:7880. The Flutter app receives the URL from the tenant server at token-issue time, so clients outside Docker still get the correct public URL.

Option B — LiveKit Cloud

  1. Create a LiveKit Cloud account

    Go to cloud.livekit.io and sign up or sign in. LiveKit Cloud offers a generous free tier suitable for development and small production workloads.

  2. Create a project

    In the LiveKit Cloud dashboard, create a new project. Note down three values: WebSocket URL (e.g. wss://your-project.livekit.cloud), API Key, and API Secret (shown once — copy it immediately and store it securely).

  3. Configure the tenant server

    In config/passwords.yaml (or environment variables for production), set: livekitUrl, livekitKey, and livekitSecret to the values from step 2.

  4. Configure via the YOffice admin UI (optional)

    Open Organization Settings → LiveKit Server. Toggle "Use LiveKit Cloud", paste the WebSocket URL, API key, and API secret, then press Save. This stores the credentials in Postgres and is the recommended approach for per-org overrides in multi-tenant deployments.

  5. Start the app — no local LiveKit needed

    With LiveKit Cloud configured, you do not need to run a local LiveKit container. Start the Auth and Tenant servers and the Flutter app as usual. The tenant server will issue tokens pointing at LiveKit Cloud.

Configuring LiveKit via the admin UI

Organization admins can configure LiveKit Cloud credentials directly from the YOffice settings screen without touching server config files. This is the recommended approach for per-org overrides in multi-tenant deployments.

LiveKit Server
Use LiveKit Cloud
wss://your-project.livekit.cloud
API Key: ••••••••••••
API Secret: ••••••••••••
Organization Settings → LiveKit Server
  1. Open Organization Settings

    Navigate to Settings → Organization → LiveKit Server section.

  2. Enable LiveKit Cloud

    Toggle "Use LiveKit Cloud" to on. Three input fields appear: WebSocket URL, API Key, and API Secret.

  3. Paste your credentials

    Enter the WebSocket URL (wss://…), API Key, and API Secret from your LiveKit Cloud project. API keys and secrets are stored encrypted — they are never returned in plain text after the initial save.

  4. Save

    Tap Save. All members of this organization will use the configured LiveKit project for video calls and voice sessions.

Multi-instance deployment with LiveKit Cloud

When running multiple tenant-server replicas behind a load balancer, LiveKit Cloud requires no special configuration. JWTs are signed with credentials stored in Postgres — every replica reads from the same source, so any pod can mint a token for any user.

The customization-agent (voice/avatar worker) connects to LiveKit Cloud and calls back to your tenant server via TENANT_BASE_URL. Point this at your load balancer; any replica can handle the callbacks.

ℹ️

Sticky sessions are not required for voice. LiveKit Cloud connects clients directly to its own media plane after JWT minting. See the Multi-instance Deployment guide for the full checklist.

Troubleshooting

SymptomLikely causeFix
Video call connects but no audioUDP ports blocked by firewallOpen UDP 50000–60000 (local) or check LiveKit Cloud region firewall rules
Token request returns 401Mismatched API key or secretDouble-check livekitKey / livekitSecret in passwords.yaml match the LiveKit project
Voice assistant connects but never speaksWorker cannot reach tenant serverSet TENANT_BASE_URL to the public load-balancer URL, not a pod IP
Flutter app cannot reach LiveKit (local)livekitUrl set to Docker-internal hostnameUse a hostname reachable from the Flutter device (e.g. your machine's LAN IP)