How to use egress recording to record session and ...
# ask-ai
c
How to use egress recording to record session and save it locally? I dont want to use azure, aws or other providers. Save it to local disk
t
Thanks for reaching out, ZaidKaraymeh. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I'm happy to help you get started with using LiveKit Egress to record your sessions and save them right onto your local machine, without needing to rely on cloud providers. Here's a friendly step-by-step guide to set it up: 1. Set Up the Egress Configuration File: Begin by creating a
config.yaml
file with the necessary settings to connect to your LiveKit server and Redis. Just a quick tip: make sure the
ws_url
uses your machine's IP address as Docker recognizes it (for example,
192.168.65.2
on macOS/Windows or
172.17.0.1
on Linux). 2. Prepare a Local Directory: Next, create a folder on your host machine where the recordings will be saved, like this:
mkdir -p ~/livekit-egress
. This keeps everything organized and easy to find. 3. Run the Egress Docker Container: Now, use Docker to run the LiveKit Egress service, making sure to mount the local directory you just created:
Copy code
docker run --rm \
    -e EGRESS_CONFIG_FILE=/out/config.yaml \
    -v ~/livekit-egress:/out \
    livekit/egress
4. Specify Filepath in Egress Request: When you start an egress request, be sure to specify a
filepath
inside the mounted volume, like
/out/my-recording.mp4
. This way, your recording will be saved directly into your local directory. Just a couple of things to keep in mind: make sure the directory you mount has write permissions for all users, and that Redis is accessible from Docker. If you run into any questions or need a hand with any step, please don’t hesitate to reach out—I’m here to help! Sources: pkg/config/storage.go | Egress & Media Processing | livekit/livekit_composite | DeepWiki