Installing Unda
This guide takes you from a fresh Linux server to your first live stream, with your team signed in. It is written for the person who runs the server.
You need:
- a Linux server (4 vCPU, 8 GB RAM and 100 Mbit/s+ upload are enough for about ten 720p streams and a few hundred viewers without transcoding). A Windows PC works too, through WSL or Docker Desktop: see Unda on Windows;
- a DNS name pointing at it, e.g.
tv.example.com(needed for HTTPS); - the Unda Docker image (
ghcr.io/localhostdeveloper/unda) or binary from your vendor, and your license file (something.license.json). Without a license Unda runs in evaluation mode for 30 days: everything works, up to 2 live streams and 2 accounts besides the owner.
Steps:
- Install: Docker or a binary with systemd
- HTTPS options: built in (Let's Encrypt), Caddy, nginx or your own certificate
- Create the owner account
- Install the license
- Invite your team
- First stream
- Firewall
- Backups and upgrades
- If someone is locked out
- Support access for your vendor
- Troubleshooting
- Removing Unda
1. Install
Quickest (Ubuntu/Debian): one command downloads, verifies and installs everything, with HTTPS:
curl -fsSL https://get.undamedia.com/install.sh | sudo bash -s -- --domain tv.example.com --email you@example.comIt stops before changing anything if a port is taken or a download does not match its checksum. --help lists the options (--staging, --with-ffmpeg, the port options, --cert-file). The manual ways follow.
Every release is signed (from v0.1.49). The installer checks the signature on the release's list of checksums before it installs anything, so a download altered on the way, or on the download site itself, is refused; with --docker it pulls the image by the exact digest that list names. The installer carries the public key it checks against; to be sure it is ours, compare it with this one (also in each release as unda-release.pub):
-----BEGIN PUBLIC KEY-----
MCowBQYDK2VwAyEAB1ecJf7qS5QmW0tNgROglMxl5ozWIk4HnHj8b1/EOVs=
-----END PUBLIC KEY-----To check a release by hand, in its folder: openssl base64 -d -A -in SHA256SUMS.sig -out sig.bin && openssl pkeyutl -verify -pubin -inkey unda-release.pub -rawin -in SHA256SUMS -sigfile sig.bin should print Signature Verified Successfully, then grep -v ' image:' SHA256SUMS | sha256sum -c --ignore-missing checks the files you downloaded (the line left out is the Docker image's digest).
To check the installer itself before it runs. The one-line command above runs install.sh as it downloads, so it trusts our download site; the installer then checks everything else it fetches. To trust only the key and the version printed on this page, check the installer first, in a new, empty folder (made fresh each time, so no file left from before is used):
cd "$(mktemp -d)" && pwd
V=v0.1.50
for f in install.sh SHA256SUMS SHA256SUMS.sig; do curl -fsSLO --proto '=https' "https://get.undamedia.com/$V/$f"; done
printf '%s\n' '-----BEGIN PUBLIC KEY-----' 'MCowBQYDK2VwAyEAB1ecJf7qS5QmW0tNgROglMxl5ozWIk4HnHj8b1/EOVs=' '-----END PUBLIC KEY-----' > unda-release.pub
openssl base64 -d -A -in SHA256SUMS.sig -out sig.bin
openssl pkeyutl -verify -pubin -inkey unda-release.pub -rawin -in SHA256SUMS -sigfile sig.bin
grep ' install.sh$' SHA256SUMS | sha256sum -c -
grep -q "^DEFAULT_BASE_URL=.* # $V (" install.sh && echo "install.sh is $V"You should see Signature Verified Successfully, install.sh: OK and install.sh is with that version. If any is missing, stop and tell us. V is the newest version when this page was published (it is not read from the download site, which could otherwise hand you an older release); if the release notes list a newer one, use that. Then run the checked installer from that folder with the options you need, for example sudo bash install.sh --domain tv.example.com --email you@example.com (or --docker). It downloads and checks the rest of the release as usual. Upgrades the same way. From v0.1.50 the installer refuses to put an older version over a newer one (see Backups and upgrades).
The same in Docker: add --docker. It installs Docker and its compose plugin from your system's packages if they are missing, writes /opt/unda/docker-compose.yml and /opt/unda/unda.yaml, pulls the image, starts it and prints the setup link. Running it again with --docker upgrades to the new image and keeps your settings and data.
- With
--domain(a server the internet reaches): the ports are published as in A. Docker below, and HTTPS comes from Let's Encrypt (or--cert-file). - Without
--domain(a PC on your own network): Unda uses the machine's network directly, so multicast inputs and outputs work with nothing more to set up, and the dashboard is onhttps://<this machine's address>:8443with a certificate made for the machine. Browsers warn about it once: choose Advanced, then continue.
curl -fsSL https://get.undamedia.com/install.sh | sudo bash -s -- --dockerAn Intel graphics card is given to the container for transcoding (the image carries Intel's driver on 64-bit Intel/AMD machines). AMD and NVIDIA cards are not: install without --docker to use one.
AlmaLinux, Rocky Linux and Red Hat Enterprise Linux (tested on AlmaLinux 10 with SELinux on): the same one-line command works after two steps of your own, because the installer opens ports only in Ubuntu's firewall (ufw) and installs FFmpeg only with Debian's apt.
If firewalld is on (
systemctl is-active firewalldsaysactive), open Unda's ports in it:bashsudo firewall-cmd --permanent --add-port=80/tcp --add-port=443/tcp --add-port=1935/tcp --add-port=1936/tcp --add-port=6000/udp --add-port=8189/udp sudo firewall-cmd --reloadThese are the default ports; open the ones you choose if you change them with the port options.
Install FFmpeg from EPEL and RPM Fusion. On AlmaLinux and Rocky Linux 10:
bashsudo dnf install -y epel-release sudo dnf config-manager --set-enabled crb sudo dnf install -y https://mirrors.rpmfusion.org/free/el/rpmfusion-free-release-10.noarch.rpm sudo dnf install -y ffmpegOn version 9, use
rpmfusion-free-release-9. On Red Hat Enterprise Linux, turn on EPEL as Red Hat's documentation describes, then the last two lines.
Then run the one-line command above without --with-ffmpeg.
Alpine Linux (tested on Alpine 3.24): Unda runs there in Docker. The service install needs systemd, which Alpine doesn't use, so the plain command stops with "systemd is required" and changes nothing. As root, install Docker from Alpine's own packages and start it with the server (iproute2 gives the installer ss, which it checks ports with), then run the installer with --docker:
apk add bash curl docker docker-cli-compose iproute2
rc-update add docker default
rc-service docker start
curl -fsSL https://get.undamedia.com/install.sh | bash -s -- --docker --domain tv.example.com --email you@example.comAlpine runs no firewall unless you set one up; Docker opens Unda's published ports by itself.
Another web server already holds ports 80 and 443 (nginx, Caddy or Apache serving other sites, AzuraCast, Owncast)? Add --behind-proxy PORT: that web server keeps 80, 443 and the certificates, and forwards your domain to Unda on 127.0.0.1:PORT, which only this machine reaches.
curl -fsSL https://get.undamedia.com/install.sh | sudo bash -s -- --domain tv.example.com --behind-proxy 8090- With nginx, the script adds the site for your domain itself. If nginx already has one for it, it only checks that it forwards to Unda. Then it asks certbot for the certificate, when certbot is installed, as for your other sites (
--emailgoes to certbot). - With another web server, it prints what to forward.
- RTMP's port 1935 taken too (another media server)? Add
--rtmp-port 1936; encoders then usertmp://tv.example.com:1936/live. - RTMPS is off: the certificate is the web server's.
- Graphics cards work as in any service install. Unlike Docker, an NVIDIA card can be used: install FFmpeg with
--with-ffmpeg.
Only RTMP, SRT and WebRTC need opening in a firewall; never the port after --behind-proxy. Another program on 80 and 443 that is not a web server able to forward a name? Give Unda other ports and a certificate file instead: see "Sharing a server" in section 2.
Pick one: Docker (A) or binary + systemd (B). Both get HTTPS certificates from Let's Encrypt automatically, with nothing else to install. Replace tv.example.com with your domain, and point its DNS (an A record) at the server before the first start. Let's Encrypt checks the domain by connecting to it on ports 443 and 80.
(Prefer a reverse proxy? --behind-proxy above does it in one command; section 2 has Caddy and nginx by hand.)
A. Docker
Create a directory, e.g. /opt/unda, with these two files.
docker-compose.yml:
services:
unda:
image: ghcr.io/localhostdeveloper/unda:v0.1.50 # newest version: see the release notes
restart: unless-stopped
ports:
- "443:8443" # HTTPS: dashboard, watch pages, HLS
- "80:8080" # HTTP: redirects to HTTPS, answers Let's Encrypt
- "1935:1935" # RTMP (encoders)
- "1936:1936" # RTMPS (encoders, encrypted)
- "6000:6000/udp" # SRT (encoders, optional)
- "8189:8189/udp" # WebRTC media: WHIP encoders, low-latency viewers (optional)
volumes:
- unda-data:/data
- ./unda.yaml:/etc/unda/unda.yaml:ro
environment:
TZ: UTC # your time zone (e.g. Europe/Paris): recording file names and logs
read_only: true
tmpfs: [/tmp]
cap_drop: [ALL]
security_opt: [no-new-privileges:true]
ulimits:
nofile: 65536
logging: # Docker keeps logs forever otherwise
options: { max-size: "10m", max-file: "5" }
volumes:
unda-data:unda.yaml:
server:
rtmp_addr: ":1935"
http_addr: ":8443" # published as 443
http_redirect_addr: ":8080" # published as 80
public_https_port: 443 # where that redirect sends browsers
tls:
letsencrypt:
domains: [tv.example.com]
email: ops@example.com # optional: expiry notices
log:
level: info
paths:
recordings_dir: /data/recordings
hls_dir: /data/hls
data_dir: /data/state # accounts, channels, license, certificates: back this up
media_dir: /data/media # files uploaded for playout channels
srt:
addr: ":6000"
webrtc:
# Docker's bridge hides this server's public address from Unda; WebRTC
# tells players where to send their media, so give it here.
public_ips: [203.0.113.7] # this server's public IPv4 addressStart it:
docker compose up -d
docker compose logs unda | grep -E 'certificate ready|could not get|setup_link'certificate ready means HTTPS works. Keep the setup_link line; you need it in step 3.
Admin commands (used below) run inside the container:
docker compose exec unda unda admin -config /etc/unda/unda.yaml list-usersUDP, RTP, RIST and multi-channel inputs listen on ports you choose when you add them. Publish each one under ports: as well, e.g. - "5000:5000/udp" (RIST uses the port and the one after it, so publish both). Multicast (udp://239.…) does not pass Docker's port mapping: to receive or send it, give the service network_mode: host and remove its ports: list (the container then uses the server's ports directly). Unda then listens on :8443 and :8080 itself, and it runs without root rights, so it can't take ports 443 and 80: Let's Encrypt can't reach it, so give it your own certificate, or use install.sh --docker without --domain for a machine on your own network.
B. Binary + systemd
# the binary from your vendor
sudo install -m 755 unda /usr/local/bin/unda
sudo useradd --system --no-create-home --shell /usr/sbin/nologin unda
sudo install -d -o unda -g unda -m 750 /var/lib/unda
sudo install -d /etc/unda
sudo install -m 644 unda.service /etc/systemd/system/unda.service # shipped with the binary
sudo touch /etc/unda/unda.env && sudo chmod 640 /etc/unda/unda.env \
&& sudo chown root:unda /etc/unda/unda.env # optional secrets; may stay empty/etc/unda/unda.yaml:
server:
rtmp_addr: ":1935"
http_addr: ":443"
http_redirect_addr: ":80" # redirects to HTTPS, answers Let's Encrypt
tls:
letsencrypt:
domains: [tv.example.com]
email: ops@example.com # optional: expiry notices
log:
level: info
paths:
recordings_dir: /var/lib/unda/recordings
hls_dir: /var/lib/unda/hls
data_dir: /var/lib/unda/state # accounts, channels, license, certificates: back this up
srt:
addr: ":6000"The service may bind ports 443 and 80 (CAP_NET_BIND_SERVICE in unda.service), and nothing more.
sudo systemctl daemon-reload
sudo systemctl enable --now unda
sudo journalctl -u unda | grep -E 'certificate ready|could not get|setup_link'certificate ready means HTTPS works. Keep the setup_link line; you need it in step 3.
Admin commands always run as the unda user. As root they can leave files in the data directory that the server can no longer open:
sudo -u unda unda admin -config /etc/unda/unda.yaml list-usersTranscoding (adaptive quality for viewers) needs FFmpeg on the server (sudo apt install ffmpeg, or install.sh --with-ffmpeg); the Docker image already has it. Turn it on in the dashboard under Server → Transcoding, which lists the encoders this server has (the CPU, and NVIDIA, Intel or other GPUs), each tested. On an NVIDIA server, install the NVIDIA driver first so nvidia-smi works, and use an FFmpeg built with NVENC. When a card in the machine isn't usable, the page says why under the list. Installs made before v0.1.41 hide graphics cards from Unda (PrivateDevices=true) and block the local sockets NVIDIA's encoder needs (AF_UNIX): run install.sh again (it writes the new unit), or
sudo mkdir -p /etc/systemd/system/unda.service.d
printf '[Service]\nPrivateDevices=false\nRestrictAddressFamilies=\nRestrictAddressFamilies=AF_INET AF_INET6 AF_NETLINK AF_UNIX\n' | sudo tee /etc/systemd/system/unda.service.d/gpu.conf
sudo systemctl daemon-reload && sudo systemctl restart undathen press Detect again on that page.
2. HTTPS options
People sign in with an email and a password, so Unda refuses a sign-in over plain HTTP from another machine: anyone on the network could read the password. Section 1 already sets up HTTPS the built-in way. The details, and the alternatives:
Built-in Let's Encrypt (section 1):
- Getting the certificate:
- on the first start, Unda asks Let's Encrypt for a certificate for each domain in
server.tls.letsencrypt.domains; - Let's Encrypt checks you control the domain by connecting on port 443 or 80;
- the certificate is stored in
<data_dir>/acme.
- on the first start, Unda asks Let's Encrypt for a certificate for each domain in
- Renewal happens on its own, well before expiry, with no restart.
- The dashboard's Server page shows each certificate's expiry. An alert opens if renewal fails for long enough to matter.
- Trying a setup first? Add
directory_url: staging. You get Let's Encrypt's test certificates, which browsers warn about, without using up the real rate limits (5 certificates per domain set per week). Remove the line and the<data_dir>/acmefolder when it works. - Behind a router or firewall: forward public ports 443 and 80 to the server. At least one must reach it: 443 to
http_addr, or 80 tohttp_redirect_addr. - Wildcard certificates (
*.example.com) are not supported. List each name instead.
Caddy in front. Ready-made files are in deploy/caddy/ (Docker). Caddy gets the certificate; Unda listens only for Caddy. Leave out server.tls and list Caddy in server.trusted_proxies; otherwise Unda ignores its headers and treats every browser as plain HTTP.
On a systemd install:
sudo apt install caddy
printf 'tv.example.com {\n reverse_proxy 127.0.0.1:8080\n}\n' | sudo tee /etc/caddy/Caddyfile
sudo systemctl reload caddyThen in unda.yaml:
server:
http_addr: "127.0.0.1:8080"
trusted_proxies: ["127.0.0.1/32", "::1/128"]nginx instead of Caddy. Keep the Host header, turn off buffering so the dashboard's live updates flow, and allow 16 MB request bodies (media uploads arrive in 8 MB pieces):
location / {
proxy_pass http://127.0.0.1:8080;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
include /etc/nginx/snippets/unda-proxy-key.conf; # the secret, below
proxy_buffering off;
proxy_request_buffering off;
client_max_body_size 16m;
proxy_read_timeout 1h;
}The web server's secret. Unda believes the web server about who a visitor is because of the address it connects from. Any other program that can reach Unda from that address (another user on the same machine, another container on the same Docker network) could then claim to be any visitor: guess passwords past the sign-in lockout, lock a real person out, put any address in the audit log. A secret only the web server sends closes that. install.sh --behind-proxy sets it up when it writes the nginx site; until a server has one, the dashboard shows a security notice on its Overview.
With nginx (do nginx first: Unda ignores the header until it has the secret):
KEY=$(openssl rand -hex 24)
sudo install -d -m 755 /etc/nginx/snippets
sudo install -m 600 /dev/null /etc/nginx/snippets/unda-proxy-key.conf
printf 'proxy_set_header X-Unda-Proxy-Key "%s";\n' "$KEY" | sudo tee /etc/nginx/snippets/unda-proxy-key.conf >/dev/null
# add the include line above to Unda's location block, then:
sudo nginx -t && sudo systemctl reload nginx
echo "UNDA_TRUSTED_PROXY_SECRET=$KEY" | sudo tee -a /etc/unda/unda.env >/dev/null
sudo systemctl restart undaWith Caddy on a systemd install, keep the key in a file only root reads and give it to Caddy as an environment variable:
KEY=$(openssl rand -hex 24)
sudo install -m 600 /dev/null /etc/caddy/unda.env
echo "UNDA_PROXY_KEY=$KEY" | sudo tee /etc/caddy/unda.env >/dev/null
sudo mkdir -p /etc/systemd/system/caddy.service.d
printf '[Service]\nEnvironmentFile=/etc/caddy/unda.env\n' | sudo tee /etc/systemd/system/caddy.service.d/unda.conf >/dev/null
printf 'tv.example.com {\n reverse_proxy 127.0.0.1:8080 {\n header_up X-Unda-Proxy-Key {$UNDA_PROXY_KEY}\n }\n}\n' | sudo tee /etc/caddy/Caddyfile
sudo systemctl daemon-reload && sudo systemctl restart caddy
echo "UNDA_TRUSTED_PROXY_SECRET=$KEY" | sudo tee -a /etc/unda/unda.env >/dev/null
sudo systemctl restart undaThe secret can also go in unda.yaml as server.trusted_proxy_secret (16 to 256 letters, digits, -, _, . or ~). The ready-made Caddy folder for Docker reads it from a .env file next to its docker-compose.yml (see the comment at its top).
Your own certificate files. Set server.tls.cert_file and key_file (e.g. certbot's fullchain.pem / privkey.pem, readable by the service user) instead of letsencrypt. Unda re-reads the files when they are renewed. install.sh --cert-file F --key-file F does this for you: it checks the pair (the key matches, the certificate names your domain and has not expired), copies it to /etc/unda/tls so the unda user can read it, and installs unda-cert-sync.timer, which copies it again daily when the source changes. One combined PEM can be given as --cert-file alone.
Sharing a server with a program that holds ports 80 and 443. Unda then runs on other ports (e.g. HTTPS 8443, RTMP 1936) with a certificate file. Where the certificate comes from is up to you, from most to least independent:
Unda's own, through DNS (recommended): certbot proves the domain with a DNS record instead of a port, so it works whatever holds 80 and 443. Use a name of its own, e.g.
unda.example.com(anArecord to this server). With a DNS provider that has a certbot plugin, renewal is automatic, e.g. Cloudflare (an API token with Zone: DNS: Edit):bashsudo apt install certbot python3-certbot-dns-cloudflare echo "dns_cloudflare_api_token = YOUR_TOKEN" | sudo tee /root/cloudflare.ini sudo chmod 600 /root/cloudflare.ini sudo certbot certonly --dns-cloudflare --dns-cloudflare-credentials /root/cloudflare.ini -d unda.example.comPlugins exist for Route 53, DigitalOcean, Google, OVH, Linode and others (
apt search python3-certbot-dns). Without one,certbot certonly --manual --preferred-challenges dnsworks too, but must be repeated every 90 days. Then:bashcurl -fsSL https://get.undamedia.com/install.sh | sudo bash -s -- --domain unda.example.com \ --cert-file /etc/letsencrypt/live/unda.example.com/fullchain.pem \ --key-file /etc/letsencrypt/live/unda.example.com/privkey.pem \ --https-port 8443 --rtmp-port 1936RTMPS then takes port 1937 (1936 is plain RTMP's here): encoders use
rtmps://unda.example.com:1937/live. Add--rtmps-port Nfor another port, or--rtmps-port 0for none.A certificate you bought, or one the other program already renews for the same name: the same
--cert-file/--key-fileoptions. Unda then depends on that program keeping it renewed.Behind that program as a reverse proxy (Caddy/nginx above), if it is a web server that can forward a name to Unda. With Docker and an nginx that is already on the server, follow Docker behind nginx on the same server.
Or give Unda a server of its own: nothing to share, and the one-line install needs no options.
Docker behind nginx on the same server
For a server where nginx already holds ports 80 and 443, often next to another media server (Flussonic, Wowza) that holds RTMP's port 1935. nginx keeps 80, 443 and the certificate, and forwards a name of Unda's own (unda.example.com below) to it. Unda's web port is reachable only from the server itself. RTMP and SRT go to Unda directly: nginx does not forward them.
1. Check the ports. Nothing should be printed:
sudo ss -tulpn | grep -E ':(1936|6000|8090)\b'If a port is listed, choose another free one and change it everywhere below. Use the same number on both sides of ports: and in unda.yaml: the dashboard shows encoders the ports Unda listens on.
2. DNS: an A record for unda.example.com pointing to this server.
3. /opt/unda/docker-compose.yml:
services:
unda:
image: ghcr.io/localhostdeveloper/unda:v0.1.50 # newest version: see the release notes
restart: unless-stopped
ports:
- "127.0.0.1:8090:8090" # dashboard, watch pages, HLS: only nginx on this server reaches it
- "1936:1936" # RTMP (the other media server keeps 1935)
- "6000:6000/udp" # SRT (encoders, optional)
- "8189:8189/udp" # WebRTC media (optional; add webrtc.public_ips to unda.yaml)
volumes:
- unda-data:/data
- ./unda.yaml:/etc/unda/unda.yaml:ro
environment:
TZ: UTC # your time zone (e.g. Europe/Paris): recording file names and logs
UNDA_TRUSTED_PROXY_SECRET: ${UNDA_PROXY_KEY:-} # from /opt/unda/.env (step 5)
read_only: true
tmpfs: [/tmp]
cap_drop: [ALL]
security_opt: [no-new-privileges:true]
ulimits:
nofile: 65536
logging: # Docker keeps logs forever otherwise
options: { max-size: "10m", max-file: "5" }
networks: [unda]
networks:
unda:
ipam:
config:
- subnet: 172.30.0.0/24 # fixed, so unda.yaml can trust nginx by address
volumes:
unda-data:4. /opt/unda/unda.yaml:
server:
rtmp_addr: ":1936"
http_addr: ":8090"
# nginx's requests reach the container from the Docker network above, not
# from 127.0.0.1. Trusting it lets Unda see that the browser used HTTPS (so
# sign-in works) and log visitors' real addresses. Other programs on this
# server come from there too, so nginx also sends a secret (step 5).
trusted_proxies: ["172.30.0.0/24"]
log:
level: info
paths:
recordings_dir: /data/recordings
hls_dir: /data/hls
data_dir: /data/state # accounts, channels, license: back this up
media_dir: /data/media # files uploaded for playout channels
srt:
addr: ":6000"No tls: section: nginx holds the certificate. If your license names domains, add public_domains: [unda.example.com] under server: (section 4).
5. nginx: /etc/nginx/sites-available/unda:
server {
listen 80;
server_name unda.example.com;
location / {
proxy_pass http://127.0.0.1:8090;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
include /etc/nginx/snippets/unda-proxy-key.conf; # the secret, made below
proxy_buffering off; # the dashboard's live updates
proxy_request_buffering off;
client_max_body_size 16m; # media uploads arrive in 8 MB pieces
proxy_read_timeout 1h;
}
}Make the secret nginx sends Unda (only root can read it), enable the site and get the certificate (certbot adds the HTTPS part and the redirect to this file, and renews it):
KEY=$(openssl rand -hex 24)
sudo install -d -m 755 /etc/nginx/snippets
sudo install -m 600 /dev/null /etc/nginx/snippets/unda-proxy-key.conf
printf 'proxy_set_header X-Unda-Proxy-Key "%s";\n' "$KEY" | sudo tee /etc/nginx/snippets/unda-proxy-key.conf >/dev/null
sudo install -m 600 /dev/null /opt/unda/.env
echo "UNDA_PROXY_KEY=$KEY" | sudo tee /opt/unda/.env >/dev/null
sudo ln -s /etc/nginx/sites-available/unda /etc/nginx/sites-enabled/
sudo nginx -t && sudo systemctl reload nginx
sudo certbot --nginx -d unda.example.comAn install made before this step existed: add the include line and make the two files the same way, reload nginx, then docker compose up -d in /opt/unda.
6. Start Unda:
cd /opt/unda
docker compose up -d
docker compose logs unda | grep setup_linkOpen https://unda.example.com/dashboard#setup/<token> and continue with section 3. Encoders use rtmp://unda.example.com:1936/live and srt://unda.example.com:6000?streamid=publish:<key>; open 1936/tcp and 6000/udp in the firewall (section 7), never 8090.
If something goes wrong:
- Sign-in says HTTPS is required: nginx is not sending
X-Forwarded-Protoor the secret (theincludeline, and the same key in the snippet and in/opt/unda/.env), ortrusted_proxiesdoes not match the network'ssubnet. docker compose upsays the address pool overlaps: another Docker network already uses 172.30.0.0/24. Pick another private range (e.g. 172.31.0.0/24) and change it in both files.- nginx answers 502: Unda is not running or not on 8090 (
docker compose ps,docker compose logs unda). - The log repeats
open /etc/unda/unda.yaml: no such file or directory: see the first row of section 11.
A closed studio LAN without HTTPS can set auth.allow_insecure_login: true. The server logs a warning at every start, because passwords then cross the network unencrypted. Without it, plain HTTP from another machine refuses every credential (password, API key, api.token, session cookie) with 403 https_required, so scripts and Prometheus need https:// too. On a public server, also firewall the plain HTTP port if nothing needs it.
3. Create the owner account
The first account is the owner, who can do everything. On its first start the server logs a one-time link (setup_link) and saves the token in <data_dir>/setup-token.
Open it on your HTTPS address:
https://tv.example.com/dashboard#setup/<token>Enter your email, name and a password of at least 10 characters. The link stops working once the owner exists.
No HTTPS yet, or the link is lost? Create the owner from the server's shell instead. The password is read from standard input:
# systemd
sudo -u unda unda admin -config /etc/unda/unda.yaml create-user you@example.com owner "Your Name"
# Docker (-T: the password is piped in)
read -rs PW && printf '%s\n' "$PW" | docker compose exec -T unda \
unda admin -config /etc/unda/unda.yaml create-user you@example.com owner "Your Name"Then, under Server → Account, turn on two-factor sign-in (any authenticator app) and store the recovery codes in your password manager.
4. Install the license
As the owner: Server → License → Install a license → choose your .license.json file → Install. Or from the shell:
sudo -u unda unda license -config /etc/unda/unda.yaml install acme.license.json
sudo -u unda unda license -config /etc/unda/unda.yaml showInstalled from the dashboard, stream and account limits apply at once; from the shell, the running server picks the file up within the hour (restart it to apply at once). Features that start with the server (SRT, UDP inputs, transcoding) follow a new license after a restart.
What the states mean:
| State | What happens |
|---|---|
| valid | everything in the license |
| expiring | a banner shows from 30 days before the end date |
| grace | expired less than 14 days ago; everything still works and the banner counts down |
| expired | new streams are refused; streams already live keep going. Install a renewed license: it takes effect at once |
| evaluation | no license file: 2 live streams, 2 accounts besides the first owner, for 30 days |
| evaluation_ended | the 30 days are over: new streams are refused until a license is installed |
| invalid | the file is damaged or not for this server: evaluation limits until a valid one is installed |
A license can be issued for your domain(s). Then it only works on a server whose HTTPS certificate is for those names. Behind Caddy or nginx, where Unda has no certificate of its own, list the name(s) in /etc/unda/unda.yaml:
server:
public_domains: [tv.example.com]Server → License shows the domains a license is for, and says so when this server's domain is not one of them.
The license is checked on the server, offline. Nothing is sent to your vendor.
5. Invite your team
Users → Invite someone: email, role and, for streamers, how many channels they may create. You get a link valid for 72 hours, usable once. Send it yourself (chat, email); the person opens it and picks a password.
| Role | Can |
|---|---|
| owner | everything: license, support access, other owners |
| admin | users (not owners), security settings, API keys, audit log, and everything an operator can |
| operator | runs the production: all streams, stop, record, restream, transcoding, UDP inputs, server page |
| streamer | only their own channels: stream key, status, health, viewers, their restream destinations |
Useful settings:
- Users → Security: require two-factor sign-in for roles (for example owner, admin and operator). People in those roles must set it up at their next sign-in before they can do anything else.
- Server → API keys (admin): for scripts and Prometheus. Each key has a role, is shown once and can be revoked. Prometheus:
authorization.credentials_fileholding an operator key, scrapinghttps://tv.example.com/metrics. - Audit log (admin): who did what — sign-ins, failed sign-ins, role changes, stream keys revealed or replaced, licenses, support access. Kept for a year.
Sessions last 12 hours without activity and 7 days at most. Five wrong passwords from one address block that address from the account for 15 minutes, doubling each time up to a day; the account keeps working from other addresses. unda admin unlock clears every block. Behind a reverse proxy, list it in server.trusted_proxies, or every visitor shares the proxy's address and one guesser blocks everyone.
6. First stream
Streams publish to channels. A channel has a public name, used in the watch link (/watch/<name>), and a secret stream key (sk_…), which is the only thing that lets someone go live on it.
- Channels → New channel → e.g.
main-show. An admin can create it for a streamer; a streamer creates their own. - The page shows the encoder settings. In OBS: Settings → Stream → Service “Custom…”, then:
- Server:
rtmp://tv.example.com:1935/live, or over the internetrtmps://tv.example.com:1936/live(RTMPS: the key and the pictures travel encrypted; OBS, vMix and FFmpeg support it) - Stream key: the
sk_…key
- Server:
- Start streaming. Within a few seconds it appears under Streams as
main-show. - Viewers watch at
https://tv.example.com/watch/main-show. The key is never in that link.
If a key leaks, use New key on the channel. The old key stops working at once and a live stream using it is disconnected.
SRT encoders use srt://tv.example.com:6000?streamid=publish:<sk_… key> (from Channels).
OBS 30 and newer can also publish over WebRTC (WHIP), with about a second of delay to viewers who use the watch page's Low latency switch: Service WHIP, Server https://tv.example.com/whip/main-show, Bearer Token the sk_… key. WebRTC needs the license's WebRTC feature, HTTPS, and UDP port 8189 open (section 7).
7. Firewall
Open only what is used:
sudo ufw allow 443/tcp # HTTPS: dashboard, watch pages, HLS
sudo ufw allow 80/tcp # Let's Encrypt checks and the HTTP → HTTPS redirect
sudo ufw allow 1935/tcp # RTMP encoders
sudo ufw allow 1936/tcp # RTMPS encoders (RTMP over TLS, encrypted)
sudo ufw allow 6000/udp # SRT encoders (if used)
sudo ufw allow 8189/udp # WebRTC media: WHIP encoders, low-latency viewers (if used)With firewalld (AlmaLinux, Rocky Linux, Red Hat), open the same ports with firewall-cmd --permanent --add-port=… and firewall-cmd --reload (section 1).
When ufw is on, the installer opens Unda's ports on the first install only. An upgrade leaves the firewall as it is (so a rule you narrowed stays narrow) and lists the ports Unda uses, in case a new version uses one more.
RTMPS is on by default whenever Unda has HTTPS: same certificate, port 1936 (1937 if plain RTMP was moved to 1936). Plain RTMP sends the stream key and the pictures as they are, so anyone on the path can copy the key: over the internet prefer RTMPS, SRT with a passphrase, or WHIP. server.rtmps_addr sets another port, or off turns RTMPS off. If its port is taken by another program, Unda starts without RTMPS and says so in its log.
WebRTC's signalling goes through HTTPS (443); its audio and video use the one UDP port webrtc.udp_port (8189). Behind 1:1 NAT (Docker's bridge, a cloud server with a private address) set webrtc.public_ips to the public address. Viewers on networks that block UDP need a TURN relay: see the WebRTC guide.
With a proxy in front (section 2), do not open Unda's own HTTP port (8080): only the proxy should reach it.
UDP and RTP inputs have no password and no encryption: anyone who can reach the port can send a stream into it, and anyone on the path can watch it. Keep them on a private network you trust (a studio LAN, a leased line, a VPN), give each input an allow list of its senders, and open the port only to those senders:
sudo ufw allow from 192.0.2.20 to any port 5004 proto udp # one sender, one inputThe same holds for UDP and RTP outputs: whatever they send can be read on the way, so send them only across a network you trust. Over the internet, use SRT (with a passphrase) or RIST instead.
8. Backups and upgrades
Everything that cannot be recreated is in the data directory (/var/lib/unda/state or the /data/state Docker volume): unda.db holds accounts, channels and keys, API keys, settings and the audit log. license.json is the license. acme/ holds the HTTPS certificates (they can be obtained again, but keeping them avoids Let's Encrypt's rate limits). Recordings are separate (recordings_dir).
Daily copies are automatic. While it runs, Unda copies the database once a day to state/backups/daily-<date>.db in the data directory (/var/lib/unda/state/backups, or /data/state/backups in the Docker volume) and keeps the seven newest. Server → Status in the dashboard shows the newest copy; a copy that fails (a copy always leaves 1 GB of the disk free) is an alert there. To keep more, or none (another backup covers the database):
backups:
keep_days: 30 # 0 = 7, at most 365
# disabled: trueCopy them off the server. Those copies are on the server's own disk, so a lost disk or server takes them with it. Copy the folder and license.json to another machine regularly, for example nightly from the server's crontab:
# systemd install (as root)
tar czf - -C /var/lib/unda/state backups license.json | \
ssh backup@backup.example.com "cat > unda-$(date +%F).tgz"
# Docker
docker compose exec -T unda tar czf - -C /data/state backups license.json | \
ssh backup@backup.example.com "cat > unda-$(date +%F).tgz"Or download a locked backup to your computer. On Server → Status, an owner can download a copy of the database locked with a passphrase they choose, after typing their password (and 2FA code) again. Without the passphrase the file opens nothing, so it is safe on a laptop or in cloud storage; keep the passphrase somewhere else (a password manager). It holds the accounts, channels and their keys, every setting and the logs; it leaves out the licence file, who is signed in, sign-in lockouts, pending invitations and the viewer history. At most six an hour can be downloaded, and each is in the audit log.
To take a copy yourself at any time (before a big change), the backup command is safe while the server runs:
# systemd
sudo -u unda unda admin -config /etc/unda/unda.yaml \
backup /var/lib/unda/backup-$(date +%F).db
# Docker
docker compose exec unda unda admin -config /etc/unda/unda.yaml \
backup /data/backup-$(date +%F).dbThe backup file must not exist yet (it is never overwritten), hence the date in its name. The database holds stream keys, so keep backups as private as the server.
Restore: stop Unda, then unda admin restore puts a backup back: a locked backup downloaded from the dashboard (it asks for the passphrase) or a plain copy (a daily one, a pre-upgrade one, unda admin backup). The database it replaces is kept in state/backups/pre-restore-<time>/, and a wrong passphrase or a damaged file changes nothing. Everyone signs in again afterwards. On a new server, install license.json as well: it is not part of backups.
# systemd: copy the file to the server first (scp unda-backup-….unda-backup you@server:/tmp/)
sudo systemctl stop unda
sudo -u unda unda admin -config /etc/unda/unda.yaml restore /tmp/unda-backup-2026-10-20.unda-backup
sudo systemctl start unda
# Docker: copy the file into the volume, then restore with the service stopped
docker compose stop unda
docker compose cp unda-backup-2026-10-20.unda-backup unda:/data/
docker compose run --rm --entrypoint unda unda admin -config /etc/unda/unda.yaml \
restore /data/unda-backup-2026-10-20.unda-backup
docker compose start undaThe passphrase is visible as you type it; to avoid that, pipe it in (printf '%s\n' "$PASSPHRASE" | … restore FILE, adding -T after docker compose run). It refuses while Unda is running, and as root when the data folder belongs to the service user (run it with sudo -u unda, as above, so the restored file stays Unda's).
Without the command (a plain copy only):
sudo systemctl stop unda
sudo -u unda rm -f /var/lib/unda/state/unda.db-wal /var/lib/unda/state/unda.db-shm
sudo -u unda cp backup-2026-09-24.db /var/lib/unda/state/unda.db
sudo systemctl start undaUpgrade:
However you upgrade, the new version's first start copies the database before changing anything: state/backups/pre-upgrade-<old>-to-<new>-<time>.db in the data directory (/var/lib/unda/state/backups, or /data/state/backups in the Docker volume; the five newest are kept). If that copy fails (a full disk), Unda does not start and says so; free space and start it again. UNDA_SKIP_UPGRADE_BACKUP=1 in its environment starts it without the copy, for when you have another.
Installed with
install.sh, from v0.1.50:bashsudo unda upgrade # unda upgrade -check only looksYour Unda checks the new release with the vendor's key built into it before anything runs: the release's signature, every file, that it really is the version it claims, and that it is newer than yours (it never goes back, so a download site set back to an older release can't take your server back). Then it runs that release's checked installer, which upgrades as below.
-version vX.Y.Zpicks a release other than the newest (never an older one).Installed with
install.sh, the other way: run the same install command again (thecurl … | sudo bash -s -- --domain …line, or./install.shfrom the new release folder; from v0.1.50--upgradecan replace--domain …). It also backs up the database with the old version first, to/var/lib/unda/backups/pre-upgrade-<date_time>.db(the five newest are kept), then replaces the binary and restarts Unda. Your configuration, accounts, channels, license and certificates are kept. If that backup fails, nothing is upgraded.Docker: set the new version in
docker-compose.yml(image: …/unda:v0.2.0), then:bashdocker compose pull docker compose up -dTo go back, set the old version again and restore that upgrade's
pre-upgrade-…copy (above): an older version refuses a database a newer one has changed.By hand: replace the binary and
systemctl restart unda.
Knowing when there is one: twice a day Unda reads the description of the latest release from your vendor's release page. When a newer version exists, owners and admins see it on the dashboard (Overview → Other notices, and at the bottom of the sidebar) with a link to its release notes. It only reads: nothing is downloaded or installed until you run the upgrade. The request carries no information about your server beyond its version. To turn it off:
updates:
disabled: trueunda -version prints the installed version.
The database is upgraded automatically at start. A server restart disconnects live encoders for a few seconds; OBS reconnects by itself.
Going back to an older version after an upgrade is refused ("newer than this build knows"). Restore the backup taken before the upgrade, or run the newer version. The installer (from v0.1.50) also refuses to put an older version over a newer one, so an old release served in place of the newest can't take a server back. To go back on purpose, restore the backup first, then run the older release's installer with --allow-downgrade (installers before v0.1.50 don't need it).
Ubuntu's own security updates: Ubuntu installs them every morning by itself, and its needrestart tool then restarts services still using a library an update replaced. Unda's FFmpeg processes use such libraries, so it used to restart Unda then, taking every channel off the air for a few seconds. The installer stops that (/etc/needrestart/conf.d/unda.conf): the updates still install, and every FFmpeg that Unda starts afterwards uses them at once, but the ones already running keep the old copy until Unda restarts. Restart it at a quiet time when an update is waiting:
sudo needrestart -r l # lists the services waiting for a restart
sudo systemctl restart unda # encoders reconnect by themselvesAn Unda upgrade or a server reboot does the same.
9. If someone is locked out
Anyone but the owner: an admin fixes it in Users:
- Disable / Enable;
- Sign out (ends every session of that person);
- Reset 2FA (a lost phone).
The owner, or nobody can sign in: use the server's shell. Having shell access to the server is the credential here:
G="sudo -u unda unda admin -config /etc/unda/unda.yaml"
# Docker: G="docker compose exec -T unda unda admin -config /etc/unda/unda.yaml"
$G list-users
$G unlock you@example.com # after too many wrong passwords
read -rs PW && printf '%s\n' "$PW" | $G reset-password you@example.com
$G disable-2fa you@example.com # lost phone and recovery codes
read -rs PW && printf '%s\n' "$PW" | $G create-user new@example.com owner "New Owner"Every one of these is recorded in the audit log as done by shell.
10. Support access for your vendor
Your vendor has no account and no way in unless you give them one.
- Give access: as the owner, go to License → Support access, enter the vendor's email and a duration (1 to 14 days). Send them the link it shows.
- What they get: an admin account. Everything it does appears in the audit log marked “(support)”.
- When it ends: automatically at the end date. End support access now closes it at once and signs them out.
11. Troubleshooting
When the install stops
The installer stops before it writes anything of Unda's when something on the machine is in the way, and says what to do. Fix it, then run the same command again.
| The installer says | Cause and fix |
|---|---|
Switching off the snap version of Docker (not an error) | Ubuntu's snap Docker can't run Unda: it can't read /opt/unda and keeps containers off the machine's network. The installer switches it off (its images and containers are kept; sudo snap start --enable docker brings it back) and installs Ubuntu's own Docker. |
the snap version of Docker runs N container(s) here | Something else on this machine runs in snap Docker, so the installer leaves it alone. Stop those containers (or move them to Docker Engine), then sudo snap stop --disable docker and run the install again. |
Docker did not start. Its log says: … | Docker Engine is installed but won't start; the lines after "Its log says" are Docker's own reason. A mistake in /etc/docker/daemon.json: sudo dockerd --validate. iptables or NAT chain errors: sudo apt-get install -y iptables, then sudo systemctl restart docker. containerd: sudo systemctl restart containerd docker. Docker's whole log: sudo journalctl -u docker -n 50 --no-pager. |
this Docker is Docker Desktop | Docker Desktop runs containers in a virtual machine of its own, out of reach of this machine's folders, ports and multicast. Install Docker Engine instead (Ubuntu's docker.io or Docker's docker-ce). |
port N (…) is used by another program | The message names the program and the option to choose another port (--rtmp-port, --https-port, --http-port, --srt-port, --webrtc-port, --rtmps-port). Or stop the other program. |
give your domain: --domain tv.example.com | The install without Docker needs a domain. On a machine without one, add --docker instead (section 1). |
After the install
| Symptom | Cause and fix |
|---|---|
Docker: the log repeats open /etc/unda/unda.yaml: no such file or directory (or is a directory) | The container was started before unda.yaml existed next to docker-compose.yml (or under another name), so Docker made an empty folder in its place. In that folder, ls -la: unda.yaml must be a file (-rw-), not a folder (d). If it is a folder, rm -r unda.yaml and write the file again; then chmod 644 unda.yaml and docker compose up -d --force-recreate unda (this replaces only Unda's container; other Docker apps keep running) |
could not get a certificate in the log, or the browser warns about the certificate | The domain's DNS must point at this server, and ports 443 and/or 80 must be open and forwarded to it. The log line gives Let's Encrypt's reason. Repeated failures can hit Let's Encrypt's rate limit (5 failed checks per hour), so test with directory_url: staging |
Unda does not start: listen tcp :1935: bind: address already in use (or :443, :80, :6000) | Another program uses that port. Give Unda another one in /etc/unda/unda.yaml (rtmp_addr: ":1936": encoders then use rtmp://DOMAIN:1936/live; srt.addr; http_addr: ":8443": viewers then use https://DOMAIN:8443), or pass --rtmp-port, --https-port, --http-port, --srt-port to install.sh on a new install. Let's Encrypt still needs port 80 or 443 for Unda: if a web server holds both (nginx, Caddy, Apache), install Unda behind it with --behind-proxy PORT (section 1); if another kind of program does, use a certificate file (--cert-file; "Sharing a server" in section 2) |
| “signing in over plain HTTP is only allowed from this machine” | Use the HTTPS address. Behind a proxy, check server.trusted_proxies lists it and that it sends X-Forwarded-Proto |
| “cross-site request refused” | The proxy changes the Host header; keep it (proxy_set_header Host $host) |
| Dashboard stays on “Reconnecting…” behind nginx | Add proxy_buffering off (live updates are a long-lived response) |
| An SRT destination keeps failing: "no answer", "server didn't respond" | Nothing listens on that address and port, a firewall blocks UDP on the way, or the receiver is taken: most SRT receivers accept one caller at a time, so another caller holds it (an analysis of the same address under Broadcast → Analyse, another server, a connection that hasn't timed out yet). Stop the other caller, then switch the destination off and on: it retries at once. The channel's Logs button downloads every line about that address |
Server → Transcoding: nvidia-smi failed: No devices were found | The NVIDIA driver is loaded but can't start the card (sudo dmesg | grep NVRM shows RmInitAdapter failed). If nvidia-smi -L fails for you too, the cause is the machine, not Unda. Try another closed driver that ubuntu-drivers list offers (sudo apt install nvidia-driver-580, restart; installing the previous one goes back); the -open drivers run only cards from 2018 on. Then the BIOS ("Above 4G Decoding", an update) or another slot; on a cloud server those are the provider's: send them the RmInitAdapter failed line and ask them to reset the card on their host. Details: the transcoding guide, "When your graphics card isn't listed" |
| An NVIDIA or AMD card isn't used in Docker | Unda's Docker image has no NVIDIA encoder and no AMD driver (Intel works with devices: [/dev/dri]). Install without Docker; next to another web server, with --behind-proxy |
| An encoder is refused with “license limit” | The license's concurrent stream limit is reached (or evaluation's 2). See Server → License |
| The encoder is refused and the key looks right | The channel's key was replaced (New key), or the channel was deleted. Copy the key again from Channels |
| “… is at schema version N, newer than this build knows” | An older version was started on a database from a newer one: restore the pre-upgrade backup or run the newer version |
| The banner says “invalid” | The license file is damaged or signed for another build: ask your vendor for a new file |
| Nobody can sign in | Section 9 |
Logs: journalctl -u unda or docker compose logs unda (one JSON line per event; passwords and stream keys are never logged).
12. Removing Unda
Keep what you may need first. Removing Unda deletes its accounts, channels, recordings, uploaded media and license. Copy out what you want to keep: a database backup (section 8), your .license.json file (to move the license to another server), and the recordings and media folders.
Docker
In the folder with Unda's docker-compose.yml (e.g. /opt/unda):
cd /opt/unda
docker compose down --volumes --rmi all # no undo: Unda's container, network, data volume and image
cd / && sudo rm -r /opt/undaThis touches only what that docker-compose.yml defines: other Docker apps on the server (AzuraCast, databases, other projects) keep running and keep their data. Never run docker system prune for this; it removes far more than Unda. With the Caddy folder, the same command also removes Caddy and its certificates.
Behind nginx (that setup), also remove its site and certificate:
sudo rm /etc/nginx/sites-enabled/unda /etc/nginx/sites-available/unda
sudo nginx -t && sudo systemctl reload nginx
sudo certbot delete --cert-name unda.example.comBinary + systemd (and the one-command install)
Check paths: in /etc/unda/unda.yaml first: the folders below are the installer's; move or delete any you set elsewhere yourself.
sudo systemctl disable --now unda
sudo systemctl disable --now unda-cert-sync.timer 2>/dev/null # only with --cert-file
sudo rm -f /etc/systemd/system/unda.service \
/etc/systemd/system/unda-cert-sync.service /etc/systemd/system/unda-cert-sync.timer \
/usr/local/sbin/unda-cert-sync /usr/local/bin/unda /etc/needrestart/conf.d/unda.conf
sudo systemctl daemon-reload
sudo rm -r /etc/unda # config, secrets file, certificate copies
sudo rm -r /var/lib/unda # no undo: accounts, recordings, media, backups, certificates
sudo userdel undaFFmpeg (--with-ffmpeg) is left installed, since other programs may use it: sudo apt remove ffmpeg if nothing does.
Firewall
Close the ports you opened for Unda (section 7), but only those no other program uses: on a shared server, 443 and 80 usually still serve the other program.
sudo ufw status numbered
sudo ufw delete allow 1935/tcp # e.g. RTMP; repeat for each of Unda's own ports