send me the egress.yaml configuration for self hos...
# ask-ai
s
send me the egress.yaml configuration for self hosting
✅ 1
t
Thanks for reaching out, Youssef. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — I can help with an egress.yaml for self-hosting. To make sure I give you the correct configuration, could you tell me a couple quick details? • Which egress targets do you need? (e.g., recording to local filesystem, S3, RTMP, HLS, or third-party storage) • Are you deploying with Kubernetes (Helm) or a plain Docker Compose / static YAML setup? • Any specific auth/credentials you’ll use (S3 bucket, RTMP URL, etc.) — you can redact secrets; I just need to know the provider types. If you’re not sure, tell me your deployment platform (Kubernetes or Docker) and the egress type you expect most commonly (recordings to S3 or local disk, live RTMP streaming, or HLS). I’ll then provide a ready-to-use
egress.yaml
example you can adapt. , with interactive elements
s
S3 , plain Docker Compose,
t
Thanks — I can create the egress.yaml for S3 + plain Docker Compose. I just need a few small details so the config matches your environment. Could you confirm the following? • LiveKit version you’re running (or say “latest” if unsure). • Is the S3 provider AWS S3 or an S3-compatible service (e.g., MinIO)? If compatible, what's the endpoint URL? • S3 region and bucket name (you can redact actual names if you prefer). • Do you need path-style addressing (
forcePathStyle: true
) or virtual-hosted–style? • How will you provide credentials: environment variables (access key / secret) or an IAM role? (You can redact the secret values.) • Which output formats do you want saved to S3 (e.g.,
mp4
,
webm
,
hls
)? Any preferred filename or prefix pattern (for example:
recordings/{room}/{time}.mp4
)? • Should uploaded objects be public-read or private? • Where will this
egress.yaml
be mounted/loaded from in your Docker Compose setup? (path in the host/container) • Any TLS/custom CA required for the S3 endpoint? If you prefer, give me the common defaults and I’ll produce a complete example (Docker Compose +
egress.yaml
) using: • AWS S3 • region
us-east-1
• bucket
my-livekit-recordings
•
forcePathStyle: false
• credentials via environment variables • output
mp4
files saved under
recordings/{room}/{start_time}.mp4
• private ACL Tell me which of the defaults to use or send the values above, and I’ll generate the ready-to-use files. , with interactive elements
s
latest, AWS S3, .ogg, access key, secret, private,
t
Thanks — I’ve prepared a ready-to-use example for a self-hosted LiveKit egress configuration that writes .ogg recordings to AWS S3, plus a minimal Docker Compose snippet that mounts the config and supplies credentials via environment variables. Notes: • This uses LiveKit “latest” image per your request. • Files are uploaded with private ACL. • Credentials are passed via environment variables (redact real secrets in examples). • Adjust bucket/region/prefix values to match your environment. 1) egress.yaml
Copy code
# egress.yaml - S3 output, .ogg recordings
egress:
  outputs:
    - name: s3-ogg
      type: s3
      s3:
        bucket: my-livekit-recordings       # replace with your bucket name
        region: us-east-1                   # replace if different
        prefix: recordings/{room}/{start_time}  # path/prefix pattern
        acl: private
        force_path_style: false             # set true for MinIO or path-style endpoints
        content_type: audio/ogg
        # Optional: set server_side_encryption: AES256
  recording:
    # default recording options
    audio:
      enabled: true
      format: ogg
    video:
      enabled: false
    # If you want combined audio+video later, enable video and change format accordingly
  filename:
    # fallback filename template for outputs that use it
    template: "{room}-{start_time}.ogg"
2) Docker Compose snippet
Copy code
version: "3.8"
services:
  livekit:
    image: livekit/livekit-server:latest
    container_name: livekit
    restart: unless-stopped
    ports:
      - "7880:7880"   # API/HTTP if used
      - "7881:7881"   # optional admin / metrics (adjust as needed)
      - "7882:7882/udp" # (example) media ports - ensure your networking matches LiveKit requirements
    environment:
      - LIVEKIT_KEY=your_api_key_here
      - LIVEKIT_SECRET=your_api_secret_here
      - S3_ACCESS_KEY_ID=${S3_ACCESS_KEY_ID}     # set in host env or replace inline
      - S3_SECRET_ACCESS_KEY=${S3_SECRET_ACCESS_KEY}
      - AWS_REGION=us-east-1
      # any other LiveKit environment variables you need
    volumes:
      - ./egress.yaml:/etc/livekit/egress.yaml:ro
    command:
      - "--egress-config=/etc/livekit/egress.yaml"
3) Environment / secrets • Recommended: set environment variables on the host or in a secure secrets manager and reference them in Compose. Example .env:
Copy code
S3_ACCESS_KEY_ID=AKIA...
S3_SECRET_ACCESS_KEY=abcd...
4) How this works / quick tips • The
egress.yaml
defines an S3 output named
s3-ogg
that saves audio as .ogg. Change
bucket
,
region
, or
prefix
to match your needs. • The
prefix
supports simple templates (I used
{room}
and
{start_time}
as examples). If you want a different pattern, update the
prefix
and
filename.template
. • If you use a custom S3 endpoint (MinIO or other), set
force_path_style: true
and provide an
endpoint
field under
s3:
and ensure TLS/CA settings if needed. • Keep your AWS keys private. Using IAM role or instance profile is more secure if you later move to EC2/ECS. If you want, I can: • Replace the placeholder values with your actual bucket name and region (you can redact secrets). • Add an example of how to trigger an egress (API snippet) to generate .ogg recordings. • Convert this to a more complete Docker Compose that includes recommended LiveKit ports and TURN configuration. Which of those would you like next? , with interactive elements