LiveKit 1.13 on Ubuntu 26.04 LTS on Azure User Guide
Overview
This guide covers the deployment and use of LiveKit 1.13 on Ubuntu 26.04 LTS on Azure using the cloudimg Azure Marketplace image. LiveKit is the open source WebRTC infrastructure server, a Selective Forwarding Unit (SFU) that carries real time audio, video and data for video conferencing, live streaming and realtime AI voice and agent applications. Clients join rooms with signed JWT access tokens that your application mints server side from an API key and secret.
The image installs LiveKit server 1.13.11, the official prebuilt livekit-server binary from LiveKit's GitHub release, checked against the release's sha256 checksum, and runs it under systemd. Docker is not required. The LiveKit CLI lk 2.20.1 is included for minting access tokens and calling the server API.
No shipped keys. The API secret signs every access token, so anyone holding it can mint a token for any room. The image therefore ships no usable key: on the first boot of every VM a fresh API key and secret are generated into the key file on the data disk, a fresh self signed TLS certificate is made with the VM's public IP address in it, and the credentials are written to /root/livekit-credentials.txt (root only). No two VMs share key material.
TLS for WebRTC. Browsers need a secure context for WebRTC, so nginx terminates TLS on port 443 and passes the signalling WebSocket and the server API to LiveKit, which listens on loopback only. Port 80 redirects to HTTPS and answers an unauthenticated /healthz probe. Media flows straight to the RTC ports.
What is included:
-
LiveKit server 1.13.11 (
/opt/livekit/livekit-server), run under systemd as the unprivilegedlivekitsystem user -
The LiveKit CLI
lk2.20.1 at/usr/local/bin/lk -
nginx terminating TLS on port
443in front of LiveKit on127.0.0.1:7880, with port80redirecting to HTTPS and a/healthzendpoint for load balancer probes -
An API key and secret generated on each VM's first boot, kept in
/var/lib/livekit/keys.yamlon a dedicated 20 GiB Azure data disk -
WebRTC media on one TCP port (
7881) and one UDP mux port (7882), with the VM's public IP advertised to clients for ICE -
Ubuntu 26.04 LTS with unattended security upgrades left on
-
cloudimg's support team on hand 24 hours a day by email (support@cloudimg.co.uk), with a guaranteed response within 24 hours
Default user: the administrator account you create when you deploy the VM (for example azureuser), with sudo. LiveKit has no login of its own: access is by access tokens signed with the API secret.
Prerequisites
-
An active Azure subscription and an SSH public key
-
A virtual network and subnet in your target region (the Portal creates them for you if needed)
-
Network Security Group rules allowing TCP 443 (signalling), TCP 7881 and UDP 7882 (media) from the clients that will connect, and TCP 22 from your own network
Recommended virtual machine size: Standard_B2s (2 vCPU, 4 GB RAM) for evaluation and small rooms. Production media workloads with many participants should use Standard_D4s_v5 or larger, and scale out with Redis and more nodes.
Step 1: Deploy the virtual machine
Option A: Azure Portal
Search for LiveKit 1.13 on Ubuntu 26.04 LTS in the Azure Marketplace, select the cloudimg offer and click Create. Choose your resource group, region and size, set the administrator username and your SSH public key, and allow inbound SSH (TCP 22). After the VM is created, add inbound rules to its Network Security Group for TCP 443, TCP 7881 and UDP 7882.
Option B: Azure CLI
Accept the Marketplace terms once per subscription, then create the VM and open its ports:
RG="livekit-prod"; LOCATION="eastus"; VM_NAME="livekit1"
IMAGE_URN="cloudimg1647283583153:livekit-ubuntu-26-04:default:latest"
az group create --name "$RG" --location "$LOCATION"
az vm image terms accept --urn "$IMAGE_URN"
az vm create \
--resource-group "$RG" --name "$VM_NAME" \
--image "$IMAGE_URN" \
--size Standard_B2s \
--admin-username azureuser \
--ssh-key-values ~/.ssh/id_rsa.pub \
--public-ip-sku Standard
az vm open-port --resource-group "$RG" --name "$VM_NAME" --port 443 --priority 1001
az vm open-port --resource-group "$RG" --name "$VM_NAME" --port 7881 --priority 1002
az network nsg rule create --resource-group "$RG" --nsg-name "${VM_NAME}NSG" \
--name livekit-media-udp --priority 1003 --protocol Udp --destination-port-ranges 7882 --access Allow
az vm open-port opens a port for every protocol; the last command opens UDP 7882 explicitly, because WebRTC media needs UDP.
Step 2: Connect over SSH
Find the VM's public IP address and connect as the administrator you chose:
PUBLIC_IP=$(az vm show -d --resource-group "$RG" --name "$VM_NAME" --query publicIps -o tsv)
ssh azureuser@"$PUBLIC_IP"
The login message shows the signalling URL, the health check URL, the media ports and where the credentials are.
Step 3: First boot
On first boot the image finds the VM's public IP address from Azure's instance metadata, generates the API key and secret, makes the self signed TLS certificate for that address, starts livekit-server and nginx, checks that a token signed with the new secret is accepted and one signed with another secret is refused, and writes the credentials file. This completes within a minute of the VM starting. Read it:
sudo cat /root/livekit-credentials.txt
The file starts like this (your address, key and secret differ):
# LiveKit 1.13.11 — API key + secret generated on first boot.
# These credentials are unique to this VM. Store them somewhere safe.
# The API SECRET signs the JWT access tokens your app uses to join rooms —
# anyone with it can mint tokens for any room. Treat it like a private key.
#
livekit.host=20.172.181.254
livekit.ws_url=wss://20.172.181.254/
livekit.api_key=API78588083276e41b6
livekit.api_secret=<your per VM secret>
livekit.ws_url is the URL your clients connect to. Treat the secret like a private key.
Step 4: Confirm the LiveKit server is running
The livekit-server and nginx services are active. LiveKit's signalling and API port 7880 listens on loopback only, the media ports listen on 7881/tcp and 7882/udp, and nginx listens on 80 and 443:
systemctl is-active livekit-server.service nginx.service
/opt/livekit/livekit-server --version
lk --version
sudo ss -Htln '( sport = :7880 or sport = :7881 or sport = :443 or sport = :80 )'
sudo ss -Hulnp 'sport = :7882'
The health endpoint answers HTTP 200 without authentication, and plain HTTP on port 80 redirects to HTTPS:
sudo curl -s -o /dev/null -w 'healthz: %{http_code}\n' --cacert /etc/nginx/tls/livekit.crt https://127.0.0.1/healthz
curl -s -o /dev/null -w 'port 80: %{http_code}\n' http://127.0.0.1/

Step 5: The configuration and the API key
The server configuration is /etc/livekit/config.yaml; it holds no secret. The API key and secret are in a separate key file, /var/lib/livekit/keys.yaml, on the dedicated data disk. The key file is readable by root and the livekit group only, and the credentials file by root only:
sudo grep -vE '^\s*#|^\s*$' /etc/livekit/config.yaml
sudo findmnt -no SOURCE,TARGET,FSTYPE,SIZE /var/lib/livekit
sudo grep -v '^#' /var/lib/livekit/keys.yaml | cut -d: -f1
sudo stat -c '%n %a %U:%G' /var/lib/livekit/keys.yaml /root/livekit-credentials.txt
The third command prints only the API key's name; the secret after it is never shown.

Step 6: Mint an access token and prove the round trip
Clients join a room with a signed JWT access token. Mint one with lk from your API key and secret and validate it against the server: a token signed with your secret is accepted (HTTP 200), and one signed with any other secret is refused (HTTP 401):
sudo bash -c '
export HOME=/root
CRED=/root/livekit-credentials.txt; CA=/etc/nginx/tls/livekit.crt
K=$(grep "^livekit.api_key=" $CRED | cut -d= -f2-)
S=$(grep "^livekit.api_secret=" $CRED | cut -d= -f2-)
VT=$(lk token create --join --room demo --identity alice --valid-for 1h --api-key "$K" --api-secret "$S" --token-only 2>/dev/null | grep -m1 -oE "eyJ[A-Za-z0-9_-]+.eyJ[A-Za-z0-9_-]+.[A-Za-z0-9_-]+")
echo -n "valid token -> HTTP "; curl -s -o /dev/null -w "%{http_code}\n" --cacert $CA "https://127.0.0.1/rtc/validate?access_token=$VT"
BT=$(lk token create --join --room demo --identity mallory --api-key "$K" --api-secret wrong-secret --token-only 2>/dev/null | grep -m1 -oE "eyJ[A-Za-z0-9_-]+.eyJ[A-Za-z0-9_-]+.[A-Za-z0-9_-]+")
echo -n "wrong secret -> HTTP "; curl -s -o /dev/null -w "%{http_code}\n" --cacert $CA "https://127.0.0.1/rtc/validate?access_token=$BT"
'
The same credentials drive the RoomService API. Point lk at the server, trust the self signed certificate, then create, list and delete a room:
sudo bash -c '
export HOME=/root
CRED=/root/livekit-credentials.txt
K=$(grep "^livekit.api_key=" $CRED | cut -d= -f2-)
S=$(grep "^livekit.api_secret=" $CRED | cut -d= -f2-)
export LIVEKIT_URL=https://127.0.0.1/ LIVEKIT_API_KEY=$K LIVEKIT_API_SECRET=$S
export SSL_CERT_FILE=/etc/nginx/tls/livekit.crt
lk room create demo-room >/dev/null
lk room list
lk room delete demo-room >/dev/null
'

Step 7: The signalling WebSocket
At start-up LiveKit finds the VM's public IP address over STUN and advertises it to clients for ICE. The start-up log shows the address and the ports it uses:
sudo journalctl -u livekit-server.service --no-pager -o cat -b | grep -oE '"(externalIP|nodeIP|version|portHttp|rtc.portTCP)": ("[^"]*"|[0-9]+)|"rtc.portUDP": \{[^}]*\}' | sort -u
Client SDKs connect to wss://<address>/rtc with a join token. This opens that WebSocket through nginx the way an SDK does, and the server answers 101 Switching Protocols:
sudo bash -c '
export HOME=/root
CRED=/root/livekit-credentials.txt; CA=/etc/nginx/tls/livekit.crt
K=$(grep "^livekit.api_key=" $CRED | cut -d= -f2-)
S=$(grep "^livekit.api_secret=" $CRED | cut -d= -f2-)
T=$(lk token create --join --room demo --identity alice --valid-for 10m --api-key "$K" --api-secret "$S" --token-only 2>/dev/null | grep -m1 -oE "eyJ[A-Za-z0-9_-]+.eyJ[A-Za-z0-9_-]+.[A-Za-z0-9_-]+")
curl -s -i --http1.1 --max-time 3 --cacert $CA \
-H "Connection: Upgrade" -H "Upgrade: websocket" \
-H "Sec-WebSocket-Version: 13" -H "Sec-WebSocket-Key: $(openssl rand -base64 16)" \
"https://127.0.0.1/rtc?access_token=$T" | grep -aE "^HTTP/|^Upgrade|^Sec-WebSocket-Accept" | tr -d "\r"
'

Step 8: Use your own DNS name
First boot writes the VM's public IP address into the credentials file, the login message and the TLS certificate. Check it:
sudo grep -E '^livekit.(host|ws_url)=' /root/livekit-credentials.txt
To serve LiveKit on a DNS name you own, point the name's A record at the VM's public IP, then run:
sudo cloudimg-set-public-address <your-domain>
It updates the credentials file and the login message, makes a new self signed certificate for the name and restarts nginx. Your API key and secret do not change. Run the same command again (or with no argument, to go back to the public IP) whenever the address changes. A certificate you installed yourself is left alone.
For a certificate that browsers trust without extra steps, open TCP 80 in the Network Security Group and add a free Let's Encrypt certificate to nginx:
sudo apt-get install -y certbot python3-certbot-nginx
sudo certbot --nginx -d <your-domain> -m <your-email> --agree-tos --redirect
Step 9: Connect an application
Use a LiveKit SDK (JavaScript, Swift, Kotlin, Flutter, Go, Python and more). Mint a join token on your server with the API key and secret, then connect the client to the signalling URL:
// server side: mint a token with the LiveKit server SDK
import { AccessToken } from 'livekit-server-sdk';
const at = new AccessToken('<api-key>', '<api-secret>', { identity: 'alice' });
at.addGrant({ roomJoin: true, room: 'my-room' });
const token = await at.toJwt();
// client side: connect with the token
import { Room } from 'livekit-client';
const room = new Room();
await room.connect('wss://<your-domain-or-public-ip>/', token);
While you use the self signed certificate, development clients must trust /etc/nginx/tls/livekit.crt (copy it off the VM with sudo). Browsers refuse it otherwise; use a CA signed certificate (Step 8) for anything public.
Server components
| Component | Version | Source |
|---|---|---|
LiveKit server (livekit-server) |
1.13.11 | github.com/livekit/livekit release, sha256 checked |
LiveKit CLI (lk) |
2.20.1 | github.com/livekit/livekit-cli release, sha256 checked |
| nginx | 1.28.3 | Ubuntu 26.04 archive |
| Operating system | Ubuntu 26.04 LTS | Canonical |
Filesystem layout
| Path | What it holds |
|---|---|
/ |
The 30 GB OS disk (about 28 GB usable) |
/opt/livekit/livekit-server |
The LiveKit server binary |
/usr/local/bin/lk |
The LiveKit CLI |
/etc/livekit/config.yaml |
The server configuration (no secrets) |
/var/lib/livekit |
The 20 GB data disk (ext4, mounted by UUID) |
/var/lib/livekit/keys.yaml |
The API key and secret (640, root:livekit) |
/etc/nginx/tls/livekit.crt, livekit.key |
The TLS certificate and key nginx serves |
/root/livekit-credentials.txt |
The first boot summary and credentials (root only) |
/var/log/cloudimg-firstboot.log |
The first boot log |
/mnt |
The Azure temporary disk: its contents are lost when the VM is deallocated |
Managing the service
sudo systemctl status livekit-server.service nginx.service --no-pager --lines=0
sudo journalctl -u livekit-server.service -n 50 --no-pager
Restart LiveKit after changing /etc/livekit/config.yaml with sudo systemctl restart livekit-server, and nginx after changing its site with sudo nginx -t && sudo systemctl reload nginx.
Troubleshooting
-
Clients connect but get no audio or video: media is not reaching the VM. Check the Network Security Group allows TCP 7881 and UDP 7882 from your clients. The start-up log line
could not validate external IPmeans UDP 7882 was not reachable from the internet when LiveKit started; open it and restartlivekit-server. -
A browser refuses the connection: it does not trust the self signed certificate. Use a DNS name and a CA signed certificate (Step 8).
-
/rtc/validateanswers 401: the token was signed with a different secret, or it has expired. Mint tokens with the key and secret in/root/livekit-credentials.txt. -
lkreports a certificate error: setSSL_CERT_FILE=/etc/nginx/tls/livekit.crtas in Step 6, or connect to a name with a trusted certificate. -
The services are not running after first boot: read
sudo journalctl -u livekit-firstboot.serviceand/var/log/cloudimg-firstboot.log.
Security recommendations
-
Protect the API secret. It signs every access token. Keep it on your server, mint tokens with the shortest practical lifetime, and replace the key in
/var/lib/livekit/keys.yaml(then restartlivekit-server) if it is ever exposed. -
Use a CA signed certificate for your own domain (Step 8), so clients trust the signalling endpoint.
-
Restrict the Network Security Group. Allow TCP 443, TCP 7881 and UDP 7882 only from the networks that need them, and TCP 22 only from your admin range.
-
Tune for production media. LiveKit's log suggests a UDP receive buffer of about 5 MB for heavy load; raise
net.core.rmem_maxwithsysctlto match. For many participants, add Redis and more LiveKit nodes. -
Back up the data disk. The API key lives on
/var/lib/livekit; snapshot it with the OS disk as part of your recovery plan.
Support and licensing
LiveKit server and the LiveKit CLI are open source software under the Apache License 2.0. cloudimg provides the packaging, the first boot setup, the image maintenance and support. cloudimg's support team is on hand 24 hours a day by email (support@cloudimg.co.uk), with a guaranteed response within 24 hours.
LiveKit is a trademark of LiveKit, Inc. Ubuntu is a registered trademark of Canonical Ltd. cloudimg is not affiliated with, endorsed by or sponsored by either of them.
Deploy on Azure
Find LiveKit 1.13 on Ubuntu 26.04 LTS on the Azure Marketplace, published by cloudimg, and deploy it from the Portal or the Azure CLI as shown above.
Need help?
Email support@cloudimg.co.uk for deployment help, configuration questions or licensing enquiries.