Appearance
Install your first server
In this tutorial you put Bitstream on one Linux server: the control plane, a streaming node, PostgreSQL and Redis, all on the same machine. At the end you have a running panel, an admin account and a connected node.
It takes about 15 minutes.
What you need
- A server with Ubuntu 22.04, Ubuntu 24.04 or Debian 12, on amd64 or arm64. A fresh VPS is best.
- Root access over SSH.
- Internet access from the server. The installer downloads the release from GitHub.
- A domain on Cloudflare (the free plan is fine) and a Cloudflare API token. The wizard cannot finish without it. Step 0 shows how to create the token.
Tested setup
The installer was tested end to end on Ubuntu 24.04. Ubuntu 22.04 and Debian 12 are supported by the script but were not run yet.
0. Create the Cloudflare token
Do this first, so the wizard does not wait for you.
- Open dash.cloudflare.com/profile/api-tokens.
- Click Create Token, then Create Custom Token.
- Add two permissions: Zone, Zone, Read and Zone, DNS, Edit.
- Under Zone Resources, pick Include, Specific zone and your domain.
- Create the token and copy it. Cloudflare shows it only once.
The wizard stores the token encrypted. It uses it to create the DNS records for the panel and to get the HTTPS certificate.
1. Get the installer
The installer downloads the binaries and the web panel from the GitHub Releases of bitstreamott/bitstream and checks each file against the release SHA256SUMS.
Connect to the server and get the script:
bash
ssh root@your-server
curl -fsSLO https://raw.githubusercontent.com/bitstreamott/bitstream/main/deploy/install.sh
chmod +x install.shTo see what it will download, without changing anything:
bash
./install.sh --dry-run --role both2. Run the installer
Run the installer with the both role. That means control and node on this machine:
bash
sudo ./install.sh --role bothIt installs the latest release. Add --version v1.2.0 for a given one. The installer prints each step. It:
- Creates one system user per service (
bs-control,bs-node) in the shared groupbitstream, and the folders under/opt/bitstream(bin,etc,data,logs). Each service owns its own data folder and config file, so the node cannot read the control's keys. - Writes kernel settings for many long-lived connections to
/etc/sysctl.d/90-bitstream.confand turns on BBR. - Installs PostgreSQL 16 (or reuses the one you have) and sizes it for your RAM.
- Installs Redis, binds it to
127.0.0.1, sets a password and turns off persistence. - Installs the default ffmpeg builds (8.1 and latest) to
/opt/bitstream/ffmpeg/and checks their checksums. - Writes the config files
/opt/bitstream/etc/control.envandnode.env. - Installs the systemd units and starts
bs-controlandbs-node. - Opens the firewall ports and enables ufw. Your SSH port is allowed first, so you do not lock yourself out.
- Prints the panel address and a one-time setup code.
You can run the installer again at any time. It keeps your passwords and secrets and only changes what is different.
Firewall
The installer enables ufw by default. If you manage the firewall yourself, add --firewall rules (add the rules, do not enable ufw) or --firewall off. All options are in the installer reference.
3. Check that it runs
bash
systemctl status bs-control bs-node
journalctl -u bs-control -fYou should see http listening with the address :8080, and a line that starts with setup pending. That line comes back on every start until you finish the wizard, and it names the file that holds the setup code. Press Ctrl+C to stop following the log.
bs-node is running too, but it is not connected yet. It waits for the wizard, which hands it a one-time join token.
4. Open the setup wizard
The end of the installer output looks like this:
Open the setup wizard: http://203.0.113.10:8080/setup
One-time setup code: 7KQM-2XPDIf you lose it, the code is also in a file:
bash
cat /opt/bitstream/data/control/setup.codeYou can open the wizard in two ways.
Through an SSH tunnel (safest). The panel has no HTTPS yet, so your password would cross the internet in clear text. A tunnel avoids that. On your own computer, run:
bash
ssh -L 8080:127.0.0.1:8080 root@your-serverKeep that window open and go to http://127.0.0.1:8080/setup in your browser. Through the tunnel the wizard sees you on the server itself, so it does not ask for the code.
Straight to the server. Open the address the installer printed and type the setup code on the first screen. The wizard checks the code before you go on. Do this only on a test server, or once HTTPS is set up.
The wizard has seven short steps:
- Welcome. Type the setup code if the screen asks for it. If the database, Redis or the master key has a problem, the screen tells you here.
- Admin account. Pick a username and a password of at least 10 characters. A short sentence works well.
- Language and time zone. English, Portuguese (Brazil) or Spanish, and your time zone.
- Service name. Clients see it in their apps and playlists.
- First server. Pick Use this server.
- Cloudflare. Paste the token and click Load my domains. Pick your domain and the panel address, for example
painelforpainel.example.com. Keep Use the Cloudflare proxy for the panel on. If you want a separate address for streaming, fill in Streaming address, for exampletv. Leave its proxy off: the Cloudflare proxy is not meant for video on most plans. Check the public IP the wizard found, then click Test connection. Finish setup turns on only when the test passes. If it fails, the field in red says what to fix, for example a missing permission on the token. - Done. You are already signed in. The panel now opens at
https://painel.example.com. The HTTPS certificate is issued in the background, which takes a few minutes. The done screen and Settings show its progress. Click Open the panel.
5. Check the node
Open Nodes in the menu. Your server shows up there within a minute, with its CPU and memory. On the server you can also check the log:
bash
journalctl -u bs-node -n 20Look for the line enrolled.
What happened behind the scenes
When you finished the wizard, bs-control wrote a single-use join token, valid for 60 minutes, to /opt/bitstream/data/join/local.token. bs-node was waiting for that file. It enrolled over https://127.0.0.1:8443, checked the control's certificate and deleted the file. A node that enrolls over loopback gets the proxy delivery mode, so viewers reach it through the panel address. With a streaming address it gets that address and the redirect mode, so viewers go straight to it. To add more machines, see Add a node.
6. Your free license
When you finished the wizard, the panel activated its free license. Bitstream has no limits: add as many lines, channels and servers as you like. The panel checks in once a day. If the license server is offline, nothing stops. Open License in the menu to see the key and the last check. See Free, with a license.
What you have now
bs-controlrunning on port 8080, with the panel and the admin API at/api/v1.bs-nodeconnected to it, ready to run channels.- PostgreSQL and Redis on this machine, both listening only on localhost.
- Config in
/opt/bitstream/etc, data in/opt/bitstream/data.
Back up the master key
/opt/bitstream/data/control/master.key encrypts line passwords, API secrets and backups. If you lose it, your backups cannot be restored. Copy it somewhere safe now.