Appearance
install.sh options
deploy/install.sh installs or updates Bitstream on Ubuntu 22.04, Ubuntu 24.04 or Debian 12 (amd64 or arm64). Run it as root. It downloads the binaries, the web panel and the deploy files from the GitHub Releases of bitstreamott/bitstream (the latest, or --version) and checks each file against the release SHA256SUMS.
It is safe to run again. Secrets are kept, configs are updated in place, and an existing PostgreSQL, Redis or ffmpeg install is reused.
Examples
bash
sudo ./deploy/install.sh --role both # control + node on one host
sudo ./deploy/install.sh --role both --firewall rules # add ufw rules, do not turn ufw on
sudo ./deploy/install.sh --role control
sudo ./deploy/install.sh --node --join <token> --control https://panel.example.com:8443
sudo ./deploy/install.sh --role license # platform license server (not for panel owners)
curl -fsSL https://raw.githubusercontent.com/bitstreamott/bitstream/main/deploy/install.sh | sudo bash -s -- --role both
./deploy/install.sh --dry-run --version v1.2.0 # print the asset URLs it would fetch, change nothingOptions
| Option | What it does |
|---|---|
--role control|node|proxy|both|license | What to install. Asked on a terminal when you leave it out (control is the first choice). Without a terminal (or with -y) the default is both. both is for a test lab only and prints a warning. license installs the platform license server; panel owners never need it. |
--node | Same as --role node. |
--role proxy | A node without FFmpeg that serves viewers in front of other nodes, with the proxy tuning preset. The panel's Add proxy command passes it for you. See Add a proxy. |
--join TOKEN | Join token for the node. Implies --role node when no role is given. Needs --control. |
--control URL | URL of the control's node API, port 8443. |
--domain NAME | Node: its public domain, like edge1.example.com. The node joins with it as its first domain. Asked on a terminal when you join a node without it; press Enter to skip. |
--db-url DSN | Control: use an external PostgreSQL 14+ instead of installing one. Use sslmode=verify-full. See External Postgres and Redis. |
--db-ca FILE | CA bundle of the external Postgres. |
--db-direct-url DSN | Optional. Direct Postgres URL for migrations and backups when --db-url is a pooler. A Neon -pooler host finds its direct host by itself. Without it, everything uses --db-url, as before. |
--pgbouncer | --db-url is PgBouncer in transaction pooling. Needs --db-direct-url. |
--redis-addr HOST:PORT | Control: use an external Redis instead of installing one. Local is recommended. |
--redis-user U, --redis-password P | Redis ACL user and password. |
--redis-tls, --redis-ca FILE | TLS to Redis, with an optional private CA. |
--spa-origins LIST | Panel origins on another host, like https://panel.example.com on Cloudflare Pages. |
--ffmpeg LIST | ffmpeg builds for nodes: all, none, or a list like 4.4,7.1,latest. Default: the manifest default (8.1,latest). 4.4 is compiled from source, see below. |
--ffmpeg-force | Download the ffmpeg builds again. |
--firewall on|rules|off | ufw: add the rules and turn ufw on (default), only add the rules, or leave ufw alone. |
--no-firewall | Same as --firewall off. |
--no-sysctl | Do not write /etc/sysctl.d/90-bitstream.conf. |
--binaries DIR | Use local bs-control, bs-node and bs-license from this folder instead of downloading them. |
--skip-binaries | Do not copy binaries or the panel. Use what is already in /opt/bitstream/bin. |
--version TAG | Release to install, like v1.2.0. Default: the latest release. |
--repo OWNER/NAME | GitHub repository with the releases. Default: bitstreamott/bitstream. |
--dry-run | Print the release asset URLs it would download for this role and stop. Needs no root. |
--release-url URL | Download and use a release tarball (bin/, web/, deploy/) instead of the GitHub release assets. |
--memory-max SIZE | systemd MemoryMax for bs-control and bs-node, for example 2G. |
--public-host HOST | Public name or IP of this host. Default: the detected primary IP. |
--force-os | Try anyway on a distribution that was not tested. |
-y, --yes | Never ask. |
-h, --help | Show the help. |
What goes where
| Path | Contents |
|---|---|
/opt/bitstream/bin | The binaries. |
/opt/bitstream/etc | control.env (root:root, 0600: it holds database and Redis passwords; systemd reads it as root), node.env (root:bs-node) and license.env (root:bs-license), mode 0640. .install-secrets (0600, root) keeps the database and Redis passwords for the next run. |
/opt/bitstream/data/{control,node,license} | Data of each service, mode 0700, owned by that service's user. |
/opt/bitstream/data/join | Role both only. Mode 2770, bs-control:bs-node. Holds local.token, the one-time join token the setup wizard writes for the local node. |
/opt/bitstream/media/vod | Node: the VOD folder (vod_dir). Download and reprocess jobs write here. Mode 0750, bs-node:bs-node. A proxy does not get it. |
/opt/bitstream/data/node/archive | Node: the TV archive folder (BS_ARCHIVE_DIR), also read for timeshift. Mode 0750, bs-node:bs-node. A proxy does not get it. |
/opt/bitstream/logs | Mode 1770, root:bitstream. |
/opt/bitstream/ffmpeg/<version>/bin | ffmpeg and ffprobe builds. |
/opt/bitstream/web | The built panel. |
/opt/bitstream/data/control/geoip | country.mmdb and asn.mmdb, the free DB-IP Lite databases (CC BY 4.0). Downloaded at install when the server is online; the panel updates them weekly. See IP location. |
/etc/systemd/system/bs-*.service | systemd units. |
/etc/sysctl.d/90-bitstream.conf | Kernel tuning. Delete it to go back to the defaults. |
/opt/bitstream/data/tune/ | Node: tuning requests from bs-node (request.json) and the root helper's answer (result.json). Owned by root, sticky. |
/etc/systemd/system/bs-node-tune.{path,service} | Node: the root helper that applies tuning from the panel. |
/etc/postgresql/<ver>/<cluster>/conf.d/90-bitstream.conf | PostgreSQL tuning. |
/etc/redis/bitstream.conf | Redis settings, included from redis.conf. |
Firewall
With --firewall on or rules, the installer installs ufw and adds these rules:
| Role | Ports (tcp) |
|---|---|
| all | every port sshd listens on, plus 22 |
| control | 80, 443, 8080, 8443 |
| node | 80, 8090, 8091 |
| license | 8070 |
With on it then turns ufw on if it was off.
WARNING
If ufw was off before, the default --firewall on turns it on, and every port not in the list is blocked from then on (for example a second node on port 8092). Use --firewall rules when you manage the firewall yourself, or --firewall off to leave it untouched.
System users
Each service runs as its own system user: bs-control, bs-node and bs-license. They share the group bitstream, which only lets them enter etc/ and data/ and write logs/. Each data dir and env file belongs to its service, so the node (and any ffmpeg it runs) cannot read the control's master key or the license admin key. The systemd units also set InaccessiblePaths for the other services' files. Running the installer on an older install moves the files to the new owners.
Where the node can write
bs-node.service uses ProtectSystem=strict, so the node can write only to the folders in its ReadWritePaths line. Each run of the installer creates the VOD and archive folders and puts them in that line, in the unit itself. If you set BS_VOD_DIR or BS_ARCHIVE_DIR in node.env, run the installer again: it creates that folder and adds it too. Media roots (media_roots) are only read, so they need no entry. An archive folder you set for one node in the panel needs a drop-in with its own ReadWritePaths.
ffmpeg 4.4
The public static 4.4 builds crash on MPEG-TS input, so the manifest marks 4.4 with layout source. The installer then runs deploy/ffmpeg/build-ffmpeg.sh and compiles a lean copy-only ffmpeg 4.4.5 into /opt/bitstream/ffmpeg/4.4. It installs build-essential, nasm, pkg-config and libssl-dev if they are missing, and takes a few minutes. You can run it by hand too:
bash
sudo bash deploy/ffmpeg/build-ffmpeg.sh 4.4.5 /opt/bitstream/ffmpeg/4.4Notes
- The node unit is not enabled until it has a join token, a join token file (role
both) or an identity from an earlier join, so it does not crash-loop on boot. On roleboth,bs-nodestarts and waits for the setup wizard to writelocal.token. - At the end the installer prints the panel URL and the one-time setup code from
data/control/setup.code. WithoutBS_HTTP_TLS_LISTENit also warns that passwords would travel in clear text, and prints an SSH tunnel command. Through the tunnel (loopback), setup needs no code. It also reminds you to have a Cloudflare API token ready: the wizard cannot finish without one. - Other ffmpeg downloads are checked against a pinned sha256, or the release checksum list for
latestbuilds. The 4.4 arm64 build has no published checksum: the installer warns and installs it unverified. - The GeoIP download is not fatal. Without internet the install goes on and the panel fetches the files later.
- When the role changes between runs on the same host, the PostgreSQL size changes too, and PostgreSQL restarts.
Setup wizard and Cloudflare
The setup wizard needs a working Cloudflare connection to finish. It checks the token, writes the DNS records for the panel and starts the HTTPS certificate. See Install your first server for the token permissions.
Two variables on the control process exist for test labs only. Put them in /opt/bitstream/etc/control.env and restart bs-control. Nothing in the panel or the API can set them.
| Variable | Effect |
|---|---|
BS_LICENSE_SKIP=1 | The wizard can finish without activating the free license, and the panel never registers. For automated tests and offline labs. Never on a real server. |
BS_SETUP_SKIP_CLOUDFLARE=1 | The wizard can finish without Cloudflare. The panel keeps the address you opened it on, with no DNS records and no certificate. For automated tests and offline dev. Never on a real server. |
BS_CLOUDFLARE_API_URL | Sends every Cloudflare API call to this URL instead of https://api.cloudflare.com/client/v4. For a fake Cloudflare server in tests. |
Release assets
Each release on bitstreamott/bitstream has these files. The names have no version, so releases/latest/download/<name> always works.
| File | What |
|---|---|
bs-control-linux-amd64, bs-control-linux-arm64 | Control plane. |
bs-node-linux-amd64, bs-node-linux-arm64 | Node. |
bs-license-linux-amd64, bs-license-linux-arm64 | Platform license server. |
bitstream-web.tar.gz | The web panel. |
bitstream-deploy.tar.gz | The installer, the systemd units and the ffmpeg manifest. |
SHA256SUMS | Checksums of every file. Check by hand with sha256sum -c --ignore-missing SHA256SUMS. |
Releases are built by the Bitstream team. They are the only place binaries come from.