Skip to content

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.

  1. Open dash.cloudflare.com/profile/api-tokens.
  2. Click Create Token, then Create Custom Token.
  3. Add two permissions: Zone, Zone, Read and Zone, DNS, Edit.
  4. Under Zone Resources, pick Include, Specific zone and your domain.
  5. 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.sh

To see what it will download, without changing anything:

bash
./install.sh --dry-run --role both

2. Run the installer ​

Run the installer with the both role. That means control and node on this machine:

bash
sudo ./install.sh --role both

It installs the latest release. Add --version v1.2.0 for a given one. The installer prints each step. It:

  1. Creates one system user per service (bs-control, bs-node) in the shared group bitstream, 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.
  2. Writes kernel settings for many long-lived connections to /etc/sysctl.d/90-bitstream.conf and turns on BBR.
  3. Installs PostgreSQL 16 (or reuses the one you have) and sizes it for your RAM.
  4. Installs Redis, binds it to 127.0.0.1, sets a password and turns off persistence.
  5. Installs the default ffmpeg builds (8.1 and latest) to /opt/bitstream/ffmpeg/ and checks their checksums.
  6. Writes the config files /opt/bitstream/etc/control.env and node.env.
  7. Installs the systemd units and starts bs-control and bs-node.
  8. Opens the firewall ports and enables ufw. Your SSH port is allowed first, so you do not lock yourself out.
  9. 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 -f

You 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-2XPD

If you lose it, the code is also in a file:

bash
cat /opt/bitstream/data/control/setup.code

You 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-server

Keep 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:

  1. 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.
  2. Admin account. Pick a username and a password of at least 10 characters. A short sentence works well.
  3. Language and time zone. English, Portuguese (Brazil) or Spanish, and your time zone.
  4. Service name. Clients see it in their apps and playlists.
  5. First server. Pick Use this server.
  6. Cloudflare. Paste the token and click Load my domains. Pick your domain and the panel address, for example painel for painel.example.com. Keep Use the Cloudflare proxy for the panel on. If you want a separate address for streaming, fill in Streaming address, for example tv. 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.
  7. 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 20

Look 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-control running on port 8080, with the panel and the admin API at /api/v1.
  • bs-node connected 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.

Next ​

Add your first channel.

Bitstream documentation