Skip to main content

LiveKit Server Setup

LiveKit is a real-time communication server that powers the Avatar Agent's audio and video capabilities. It provides the infrastructure for WebRTC connections, handling media streaming, and managing real-time sessions between users and AI agents.

Overview

Before setting up the Avatar Agent, you need access to a LiveKit server and create credentials. There are two options:

  • LiveKit Cloud (Recommended for quick start) - Fully managed service with built-in monitoring and global edge network

  • Self-Hosted Server (Recommended privacy) - Complete control over infrastructure and data sovereignty

The Avatar Agent needs the following credentials to authenticate with your LiveKit server:

LIVEKIT_URL=<YOUR_LIVEKIT_URL>
LIVEKIT_API_KEY=<YOUR_LIVEKIT_API_KEY>
LIVEKIT_API_SECRET=<YOUR_LIVEKIT_API_SECRET>
Keep Credentials Safe

Treat these credentials like passwords. Never commit them to version control or share them publicly.

Option 1: LiveKit Cloud

LiveKit Cloud is the fastest way to get started. It's a fully managed service that handles server maintenance and updates.

Free Tier

LiveKit Cloud offers a generous free tier perfect for development and testing.

First Steps

1. Create an Account

Visit https://livekit.io/ and sign up for a free account.

2. Create a Project

After logging in, create a new project and choose a project name.

Obtain LiveKit Credentials

Navigate to Settings → API Keys, click "Create New Key" or use the default key, and copy and save the following credentials:

  • LIVEKIT_URL (e.g., wss://your-project.livekit.cloud)
  • LIVEKIT_API_KEY
  • LIVEKIT_API_SECRET

Option 2: Self-Hosted LiveKit Server

Self-hosting gives you complete control over your infrastructure and data, making it ideal for production environments with strict privacy requirements and no usage limit.

Set Up

1. Install LiveKit Server

Follow the official Self-Hosting Documentation.

Choose your deployment method:

  • Docker/Docker Compose (easiest)
  • Kubernetes (for production)
  • Manual installation

2. Configure the Server

  • Set up your livekit.yaml configuration file
  • Configure networking and domains
  • Set up SSL/TLS certificates

Obtain LiveKit Credentials

After installation, retrieve the credentials from your LiveKit server configuration:

  • LIVEKIT_URL will be your server's WebSocket endpoint (e.g., wss://livekit.your-domain.com)
  • LIVEKIT_API_KEY and LIVEKIT_API_SECRET are defined in your livekit.yaml under the keys section
Configuration File Location

Credentials are typically found in /etc/livekit.yaml or your Docker Compose environment variables.

Example Configuration Snippet

livekit.yaml
keys:
API_KEY_1: YOUR_API_SECRET_1
API_KEY_2: YOUR_API_SECRET_2

In this example:

  • API_KEY_1 is your LIVEKIT_API_KEY
  • YOUR_API_SECRET_1 is your LIVEKIT_API_SECRET

Next Steps

Once you have obtained your LiveKit credentials from either setup method, proceed to configure your Avatar Agent by adding them to your environment configuration file.

Ready to Continue?

Check out the Avatar Agent Configuration guide to learn how to use these credentials.

Additional Resources