Portainer Templates logo

Portainer Templates

LiveKit

Stack

Voice Realtime

LiveKit - the Apache-2.0 WebRTC server powering modern voice agents and video apps: rooms, tracks, selective forwarding, and the Agents framework ecosystem. Single Go binary.

Image details

Pulls: 6.6M
Architecture: amd64, arm64, arm64/v8
Image size: 40 MB
Latest: v1.13
User: thedavidzhao
Created: Jan 25, 2021
Updated: 1 day ago
Status: active

Source details

Stars: 21.1k
Forks: 2k
Language: Go
License: Apache-2.0
Updated: 3 hours ago

Configuration

Type
Compose
Platform
linux
Image
livekit/livekit-server:v1.13.4
Ports
5000:50007881:78817882:7882/udp
Env vars
LIVEKIT_CONFIG=port: 5000 rtc: tcp_port: 7881 udp_port: 7882 use_external_ip: true keys: ${LIVEKIT_API_KEY}: ${LIVEKIT_API_SECRET} LIVEKIT_API_KEY=''LIVEKIT_API_SECRET=''
Restart
unless-stopped
Source

Standalone Install

Select an install method, to see config/commands for deploying LiveKit

Installation method

Install on Portainer

Import all app templates into your Portainer instance, for easy 1-click deploys

  1. Ensure both Docker and Portainer are installed, and up-to-date
  2. Log into your Portainer web UI
  3. Under Settings → App Templates, paste the below URL
  4. Head to Home → App Templates, and the list of apps will show up
  5. Select LiveKit, fill in any config options, and hit Deploy

Template Import URL

https://raw.githubusercontent.com/Lissy93/portainer-templates/main/templates.json
Show Me demo
Original stackfile

The compose file this template deploys, straight from its repo:

name: livekit

services:
  livekit:
    image: livekit/livekit-server:v1.13.4
    restart: unless-stopped
    environment:
      LIVEKIT_CONFIG: |
        port: 5000
        rtc:
          tcp_port: 7881
          udp_port: 7882
          use_external_ip: true
        keys:
          ${LIVEKIT_API_KEY}: ${LIVEKIT_API_SECRET}
    ports:
      - "5000:5000"
      - "7881:7881"
      - "7882:7882/udp"

Or deploy it directly from the source:

git clone https://github.com/deployable-sh/stacks
cd stacks
docker compose -f livekit/compose.yaml up -d

More install options in our documentation, or see livekit/livekit-server for app-specific guidance.


The LiveKit icon, the name of the repository and some sample code in the background.

LiveKit: Realtime infrastructure for voice, video, and AI agents

LiveKit is an open source platform for building voice, video, and physical AI agents. This repository is the LiveKit server: a scalable, distributed WebRTC SFU that moves realtime audio, video, and data between people, devices, and AI models. The SDKs, agents frameworks, and companion services are linked in the table at the bottom of this page.
LiveKit's server is written in Go, using the awesome Pion WebRTC implementation.
GitHub stars Slack community Twitter Follow Ask DeepWiki GitHub release (latest SemVer) GitHub Workflow Status License
!IMPORTANT If you're building Voice AI, LiveKit Agents is the SDK for code-first realtime voice agents. STT, LLM, TTS, turn detection, expressive speech, keyterm accuracy, tool usage, and telephony all come bundled in the framework. It's available in both Python and Node.js.
# agent.py
from livekit import agents
from livekit.agents import Agent, AgentServer, AgentSession, STTContextOptions, TurnHandlingOptions, inference

server = AgentServer()


@server.rtc_session(agent_name="my-agent")
async def my_agent(ctx: agents.JobContext):
    session = AgentSession(
        stt=inference.STT(model="deepgram/nova-3", language="multi"),
        llm=inference.LLM(model="google/gemma-4-31b-it"),
        tts=inference.TTS(model="inworld/inworld-tts-2", voice="Ashley"),
        turn_handling=TurnHandlingOptions(turn_detection=inference.TurnDetector()),
        stt_context_options=STTContextOptions(keyterms=["LiveKit", "Acme Corp"]),
        expressive=True,
    )
    await session.start(room=ctx.room, agent=Agent(instructions="You are a helpful voice AI assistant."))
    await session.generate_reply(instructions="Greet the user and offer your assistance.")


if __name__ == "__main__":
    agents.cli.run_app(server)

Models come from LiveKit Inference with no per-provider API keys, and LiveKit Cloud handles deployment and observability. Visit the docs for more info at docs.livekit.io/agents.

Used in production by

LiveKit carries billions of calls a year for companies including Salesforce, Nvidia, Oracle, SAP, Deutsche Telekom, Spotify, Tinder, Coursera, Headspace, Skydio, Retell, Decagon, Cresta, and HeyGen. Read how Assort Health, Playback, and Polymath Robotics use it, or see more customers.

Features

  • Scalable, distributed WebRTC SFU (Selective Forwarding Unit)
  • People, devices, and AI agents join the same room as participants, with
[agent dispatch](https://docs.livekit.io/agents/server/agent-dispatch/) to route agents in automatically or on demand
  • Modern, full-featured SDKs for web, mobile, desktop, embedded, and server
  • Built for production, supports JWT authentication
  • Robust networking and connectivity, UDP/TCP/TURN
  • Easy to deploy: single binary, Docker or Kubernetes
  • Advanced features including:
-   [speaker detection](https://docs.livekit.io/transport/media/subscribe/)
-   [simulcast](https://docs.livekit.io/transport/media/publish/)
-   [selective subscription](https://docs.livekit.io/transport/media/subscribe/)
-   [moderation APIs](https://docs.livekit.io/intro/basics/rooms-participants-tracks/participants/)
-   [end-to-end encryption](https://docs.livekit.io/transport/media/encryption/)
-   SVC codecs (VP9, AV1)
-   [data tracks](https://docs.livekit.io/transport/data/data-tracks/) for low-latency telemetry and teleoperation
-   [telephony](https://docs.livekit.io/telephony/) over SIP
-   [webhooks](https://docs.livekit.io/intro/basics/rooms-participants-tracks/webhooks-events/)
-   [distributed and multi-region](https://docs.livekit.io/transport/self-hosting/distributed/)

Documentation & Guides

https://docs.livekit.io
Working with a coding agent? Give it the LiveKit Docs MCP server, or start with the coding agents guide.

Live Demos

Install

!TIP We recommend installing LiveKit CLI along with the server. It lets you access server APIs, create tokens, generate test traffic, and scaffold and deploy agents.

The following will install LiveKit's media server:

MacOS

brew install livekit

Linux

curl -sSL https://get.livekit.io | bash

Windows

Download the latest release here

Getting Started

Starting LiveKit

Start LiveKit in development mode by running livekit-server --dev. It'll use a placeholder API key/secret pair.
API Key: devkey
API Secret: secret

To customize your setup for production, refer to our deployment docs

Creating access token

A user connecting to a LiveKit room requires an access token. Access tokens (JWT) encode the user's identity and the room permissions they've been granted. You can generate a token with our CLI:
lk token create \
    --api-key devkey --api-secret secret \
    --join --room my-first-room --identity user1 \
    --valid-for 24h

Test with example app

Head over to our example app and enter a generated token to connect to your LiveKit server.
Once connected, your video and audio are now being published to your new LiveKit instance!

Simulating a test publisher

lk room join \
    --url ws://localhost:7880 \
    --api-key devkey --api-secret secret \
    --identity bot-user1 \
    --publish-demo \
    my-first-room

This command publishes a looped demo video to a room. Due to how the video clip was encoded (keyframes every 3s), there's a slight delay before the browser has sufficient data to begin rendering frames. This is an artifact of the simulation.

Adding an agent

Agents join rooms as participants, the same way a browser or a phone does. Follow the Voice AI quickstart to build one. An agent connects to a self-hosted server the same way it connects to LiveKit Cloud; when running without Cloud, use model plugins in place of LiveKit Inference.

Deployment

Use LiveKit Cloud

LiveKit Cloud is the fastest and most reliable way to run LiveKit. It runs in 19+ regions with 99.99% uptime and adds agent hosting, model inference, telephony, and observability on top of the server. The Build plan is free, with no credit card required.
Sign up for LiveKit Cloud.

Self-host

Read our deployment docs for more information. Official Docker images and Helm charts are available.

Building from source

Pre-requisites:
  • Go 1.26+ is installed
  • GOPATH/bin is in your PATH

Then run
git clone https://github.com/livekit/livekit
cd livekit
./bootstrap.sh
mage

Contributing

We welcome your contributions toward improving LiveKit! Please join us on Slack or in the Developer Community to discuss your ideas and/or PRs.

License

LiveKit server is licensed under Apache License v2.0.

LiveKit Ecosystem
Agents SDKsPython · Node.js
LiveKit SDKsBrowser · Swift · Android · Flutter · React Native · Rust · Node.js · Python · Unity · Unity (WebGL) · ESP32 · C++
Starter AppsPython Agent · TypeScript Agent · React App · SwiftUI App · Android App · Flutter App · React Native App · Web Embed
UI ComponentsReact · Android Compose · SwiftUI · Flutter
Server APIsNode.js · Golang · Ruby · Java/Kotlin · Python · Rust · PHP (community) · .NET (community)
ResourcesDocs · Docs MCP Server · CLI · LiveKit Cloud
LiveKit Server OSSLiveKit server · Egress · Ingress · SIP
CommunityDeveloper Community · Slack · X · YouTube

Serve LiveKit on your own domain behind Caddy, Nginx or Traefik. Fill in your domain and copy the result. It's a starting point, some apps need their own base URL or extra headers set too.

Proxying livekit.example.com to http://livekit:5000

Add this to your Caddyfile

livekit.example.com {
	reverse_proxy http://livekit:5000
}

Check the logs first

Nine times out of ten the logs tell you exactly what went wrong.

  • In Portainer, go to Containers, click the container, then Logs. Or run docker logs <container>
  • Exit codes help too: 137 means killed, usually out of memory. 126 or 127 means the command inside the image is broken.

Port already in use

If deployment fails with "Bind for 0.0.0.0:5000 failed: port is already allocated", something else on your server is using that port.

  • Find what's using it: sudo ss -tlnp | grep :5000
  • Stop the other service, or pick a different host port. In 5000:5000 only the left number is yours to change, the right one belongs to the app.

Running but the page won't load

The container is up but nothing appears in your browser.

  • Use your server's real IP: http://your-server-ip:5000. The 0.0.0.0 link Portainer shows isn't a real address.
  • Give it a minute after first deploy, livekit can take a while to initialise.
  • Make sure your firewall allows the port, e.g. sudo ufw allow 5000

Image won't pull

Test the pull directly on the host: docker pull livekit/livekit-server:v1.13.4

  • "manifest unknown" means the tag no longer exists.
  • "toomanyrequests" is the Docker Hub rate limit. Log in with docker login to raise it.
  • "no space left on device" means a full disk. Reclaim space with docker system prune

"exec format error"

This means the image was built for a different CPU architecture than your server.

  • This image supports: amd64, arm64, arm64/v8
  • Check yours with uname -m: x86_64 is amd64, aarch64 is arm64. Raspberry Pi and other ARM boards are the usual culprits.

Container keeps restarting

The unless-stopped restart policy relaunches the app after every crash, so the real error can scroll past.

  • Check the logs right after a restart, the last few lines before it died are the useful ones.
  • Get the exit code with docker inspect <container> --format '{{.State.ExitCode}}'
  • Still stuck? Redeploy once with the restart policy set to no so the failure stays visible.

Required settings are blank

LIVEKIT_API_KEY, LIVEKIT_API_SECRET have no default value, and livekit may crash or misbehave if left empty.

  • Fill them in on the deploy screen before hitting deploy.

Stack won't deploy

Compose stacks fail fast on small mistakes, and Portainer shows the reason just above the editor.

  • YAML only accepts spaces for indentation, a single tab breaks the whole file.

Raise an issue

Found something which isn't working as it should? Here's how to report it.

A Compose stack

LiveKit is a Compose stack, a set of containers defined in one file and brought up together by Portainer, then started and stopped as a single app.

The app image

An image is the app packed up ready to go, everything LiveKit needs bundled into one download. This template pulls livekit/livekit-server:v1.13.4, which Docker fetches once (about 40 MB) and then starts your own copy from.

Where the image comes from

Docker pulls its images from registries, public libraries of ready-built apps. LiveKit's comes from Docker Hub, published by livekit.

Version tags

The bit after the colon in the image name is the version tag. This one pins v1.13.4, so every redeploy gives you that exact build until you bump it yourself.

Which machines it runs on

Every image is built for particular CPU types. This one ships for amd64, arm64, arm64/v8, so it runs on both regular x86 servers and ARM boards like a Raspberry Pi.

Ports

A port is the door the app answers on. A mapping like 5000:5000 means it's reachable on port 5000 of your server, where the left number is yours to change and the right one belongs to the app. It opens:

  • 5000:5000
  • 7881:7881
  • 7882:7882 over UDP

No stored data

This template doesn't mount any storage, so whatever LiveKit writes stays inside the container and is wiped if it's recreated or updated. That's fine for something stateless, but add a volume before trusting it with anything you want to keep.

Environment variables

Environment variables are the settings you hand over when you deploy, things like a password or a timezone. LiveKit takes 3 of them, and 2 need a value before it'll start properly:

  • LIVEKIT_CONFIG, defaults to port: 5000 rtc: tcp_port: 7881 udp_port: 7882 use_external_ip: true keys: LIVEKIT_API_KEY: LIVEKIT_API_SECRET
  • LIVEKIT_API_KEY, needs a value. API key/secret pair (any opaque strings).
  • LIVEKIT_API_SECRET, needs a value

Restart policy

The restart policy here is unless-stopped, so Docker restarts LiveKit after a crash or reboot, but leaves it off when you stop it on purpose. You can change this on the deploy screen. The choices are no (never restart), on-failure (only after a crash), unless-stopped (restart unless you stop it), and always (bring it back no matter what).

Networking

Nothing custom is set, so LiveKit sits on Docker's default bridge network: its own private space that reaches the outside world only through the ports it publishes.

Container name

Once it's deployed, Portainer names the container livekit. That's what you'll spot in the containers list and use in commands like docker logs livekit.

Platform

The platform is linux, the kind of system the container is built to run on. Docker and Portainer handle this on a normal Linux server.

Open source license

LiveKit is open source, released under the Apache-2.0 license. In plain terms the code is out in the open, so you're free to run it and change it to fit what you need.

Portainer app templates

Zooming out, this whole page comes from a Portainer app template: a short recipe telling Portainer how to set LiveKit up. Add the template list to Portainer once, then deploying LiveKit is a click rather than a wall of config.