Skip to content

Livekit local installation guide

This guide provides step-by-step instructions for installing and configuring the LiveKit server on a Linux environment, specifically within Windows Subsystem for Linux (WSL). It covers setting up dependencies such as Redis, running the LiveKit server, configuring the Egress service, and integrating with both backend and frontend components. For the official LiveKit documentation on local installation, visit: LiveKit Self-Hosting Guide.

Prerequisites

  • A Linux environment. The WSL is a viable option if your laptop is running on Windows. you can find the installation guide on the official Microsoft WSL documentation.

  • Install Docker on your linux environment (WSL). Since the default one is Ubuntu, you can find the installation guide on the official Docker documetation

  • Install the LiveKit server on you local Linux environment (not on Docker). You can run it with:

livekit-server --dev

Step 1: Install Redis

LiveKit requires a separate Redis instance to allow concurrent communication between LiveKit and the Egress service.

Install Redis:

sudo apt-get install redis-server

Modify the Redis configuration file:

Edit /etc/redis/redis.conf:

  • Comment out the line starting with bind 127.0.0.1
  • Change protected-mode yes to protected-mode no

Restart the Redis server:

sudo systemctl restart redis-server

Step 2: Run the LiveKit Server

To enable webhook, create a new file named livekit.yaml:

webhook:
  # The API key to use in order to sign the message
  # This must match one of the keys LiveKit is configured with
  api_key: 'devkey'
  urls:
    - 'http://localhost:3001/webhook'

Start the LiveKit server with the correct parameters:

livekit-server --dev --bind 0.0.0.0 --redis-host YOUR_WSL_IP:6379 --node-ip YOUR_WSL_IP --config <path_to_file>/livekit.yaml

You can find your WSL IP using:

ip addr show eth0

Step 3: Set Up Egress

Create a directory for the Egress service (e.g., ~/egress-service) and add a config.yaml file:

log_level: debug
api_key: devkey
api_secret: secret
ws_url: ws://YOUR_WSL_IP:7880
insecure: true
redis:
  address: YOUR_WSL_IP:6379

Run the Egress service with:

sudo docker run --rm \
  -e EGRESS_CONFIG_FILE=/etc/egress.yaml \
  -v ~/livekit-backend/recordings:/out \
  -v ~/egress-service/config.yaml:/etc/egress.yaml \
  livekit/egress

~/livekit-backend/recordings is the directory where recordings will be saved. Ensure it has the correct permissions:

sudo chmod 777 ~/livekit-backend/recordings

Step 4: Configure the Backend

Set the correct LiveKit credentials and host in your backend:

  • LiveKit Key: devkey
  • LiveKit Secret: secret
  • LiveKit Host: http://YOUR_WSL_IP:7880

Step 5: Configure the Frontend

Update src/main/apiClient:

AUTH_SERVER_URL = http://localhost:3001

(or the port you are using).

Update src/renderer/app/views/LiveKitView.tsx:

const serverUrl = 'ws://YOUR_WSL_IP:7880';

Update src/main/app.ts:

In the Content-Security-Policy, edit the line with // TODO: Only used in local development:

'ws://YOUR_WSL_IP:* http://YOUR_WSL_IP:* ' // TODO: Only used in local development