Appearance
Add a node on another machine
A node is a server that delivers channels to viewers. Add more nodes when one machine runs out of bandwidth or CPU, or to have a server closer to your viewers.
The node on the panel's own machine joins by itself when you pick Use this server in the setup wizard. This page is for every other machine.
Before you start
- The new machine runs Ubuntu 22.04, Ubuntu 24.04 or Debian 12.
- It can reach the control on port 8443 (TCP). The node always opens the connection, so it can sit behind NAT.
- Viewers can reach the node on port 8090 (HTTP), and 8091 if you turn on HTTPS. See ports and firewall.
- You have the same release tarball you used for the control, unpacked on the new machine.
1. Create the install command
In the panel, open Nodes and click Add server.
- Type a Note so you know which machine the key is for, for example
edge in Frankfurt. - Pick how long the key is valid: 1 hour or 24 hours.
- Click Create command.
The panel shows a ready to paste Install command. The key works only once. The panel fills in the control address for you: the node API public URL if you set one (node_api.public_url), else the panel's host, with port 8443.
Automate it
bash
curl -s -X POST $PANEL/node-join-tokens \
-H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \
-d '{"note": "edge in Frankfurt", "ttl_minutes": 60}' | jq -r .install_commandttl_minutes goes from 5 to 1440 (24 hours). The default is 60. The answer also has the bare token, in the form bsj1.<secret>.<hash>. The last part is the hash of the control's certificate authority, so the node checks it talks to the right control before it sends anything. The token and the command are shown only in this answer.
List open keys with GET /node-join-tokens and revoke one with DELETE /node-join-tokens/{id}.
2. Run it on the new machine
Tip: the panel can also do this step for you over SSH. See Install a node or a proxy from the panel.
Open a terminal on the new machine as root, go to the unpacked release and paste the command. It looks like this:
bash
sudo ./deploy/install.sh --node \
--join 'bsj1.xxxxx.yyyyy' \
--control https://panel.example.com:8443 \
--domain edge1.example.com--domain is optional. Fill it in the Add server dialog and the command already has it. Without it the installer asks on the terminal (press Enter to skip). You can add more domains later on the server's Edit page.
The installer sets up the ffmpeg builds (it compiles ffmpeg 4.4 from source, which takes a few minutes), tunes the kernel for the machine's RAM and link speed (see Tuning), adds the firewall rules, writes /opt/bitstream/etc/node.env with BS_JOIN_TOKEN, BS_CONTROL_URL and BS_PUBLIC_HOST (the domain), and starts bs-node.
On its first start the node:
- Makes its own private key. The key never leaves the machine.
- Sends a certificate request to
POST /node/v1/enrollwith the token. - Gets back its node id, its certificate and a secret for play tokens, and saves them in
/opt/bitstream/data/node. - Opens the control channel (WebSocket over mTLS) and fetches its config.
Check it:
bash
journalctl -u bs-node -fYou should see enrolled with the new node_id. In the panel the server shows up in Nodes as Online within a minute. After that the token is no longer needed.
3. Give the node a public address
Viewers are sent to the node with a redirect, so it needs a public name or IP. Open the server in Nodes, then Edit, and add its domains (the first one is the main one). Without it, viewers are sent to 127.0.0.1.
You do not need to type the ports. The node reports its HTTP and HTTPS ports when it joins and on every heartbeat. If viewers reach it on other ports than the ones it listens on (NAT, a reverse proxy), set BS_PUBLIC_PORT and BS_PUBLIC_TLS_PORT in node.env and restart bs-node. A port typed in the panel is replaced by the next report.
Automate it
bash
curl -s -X PATCH $PANEL/nodes/2 \
-H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \
-d '{"name": "edge-sp-1", "public_host": "sp1.example.com"}' | jqCloudflare
If you use Cloudflare, the record for a node must be DNS only (grey cloud). Video through the Cloudflare proxy breaks their terms and limits the ports. See Cloudflare and HTTPS.
4. Put channels on it
Open a channel in Live streams. In the Servers section, pick the new server. A new channel preselects the server when there is only one. For relays between servers, see the server tree.
Useful node settings
| Panel label | API field | What it does |
|---|---|---|
| How clients are served | delivery_mode | redirect (default) sends viewers to the node with a 302. proxy makes the control stream through itself. A node that joins over loopback (the panel's own machine) gets proxy and the panel's host as its public domain. |
| Mode | admin_status | maintenance takes no new viewers but keeps the current ones. disabled stops everything. |
| Weight, Max clients | weight, max_clients | Load balancing weight (100 is normal) and a cap on viewers (0 means no cap). |
| FFmpeg build | ffmpeg_version | Pin one of the builds the node reported. Empty picks the newest. |
| Internal URL | internal_url | What other nodes use to relay from this one, if it is not the public domain. |
| Allow private network sources | allow_internal_sources | Allow sources on private networks and UDP. Off by default. |