Installing and running Sapsan¶
This page describes how to install Sapsan, activate it with a license, run it with a minimal configuration, and verify that the server works.
Before installation¶
Sapsan does not run without a license: the license.txt file is required before the first start, and the server needs internet access for online activation. See licensing for details.
Note
TODO: system requirements (OS, architectures, CPU/RAM, DVR disks).
Installing from the deb package¶
Sapsan is distributed as the sapsan deb package from the Flussonic repository:
curl -sSf http://apt.flussonic.com/binary/gpg.key > /etc/apt/trusted.gpg.d/flussonic.gpg
echo "deb http://apt.flussonic.com binary/" > /etc/apt/sources.list.d/flussonic.list
apt update
apt install sapsan
The package installs the /usr/sbin/sapsan binary, the sapsan.service systemd unit, the default config at /etc/sapsan/sapsan.yaml, and creates the state directory /var/lib/sapsan.
Activation¶
Before starting, put the license file you received next to the config:
cp license.txt /etc/sapsan/license.txt
chmod 600 /etc/sapsan/license.txt
On the first start Sapsan activates online and writes activation artifacts to the state directory /var/lib/sapsan:
| File | Contents |
|---|---|
server.id |
unique server identifier (UUID) |
activation-<version>.json |
activation for a specific product version |
keys/ |
directory with key material generated by Sapsan |
See licensing for license states and how to check them.
Minimal configuration¶
Sapsan reads its configuration from sapsan.yaml (the path can be overridden with the CONFIG_PATH environment variable). A minimal config is one HTTP port and one stream:
listeners:
http:
- port: 80
streams:
- name: demo
inputs:
- syntetic: {}
transcoder:
output:
- source: !content video
codec: !set h264
- source: !content audio
codec: !set aac
streams is a list: each stream is an item with its own name. To move on to real video, see video ingest.
Running in Docker¶
The official image is flussonic/sapsan. Map the ports and mount the config, the license, and the state directory:
mkdir -p config data
# put config/sapsan.yaml and config/license.txt in place
docker run --rm -p 80:80 -p 554:554 -p 1935:1935 \
-v "$(pwd)/config/sapsan.yaml:/etc/sapsan/sapsan.yaml:ro" \
-v "$(pwd)/config/license.txt:/etc/sapsan/license.txt:ro" \
-v "$(pwd)/data:/var/lib/sapsan" \
flussonic/sapsan:latest
The data directory (/var/lib/sapsan) must be writable and persist across restarts — it holds server.id, activation files, and the keys/ directory. The CONFIG_PATH and SERVER_ID_PATH paths are already set in the image.
Starting and stopping¶
When installed from the deb package, the server is managed by systemd:
systemctl start sapsan # start
systemctl status sapsan # status
systemctl stop sapsan # stop
systemctl enable sapsan # start on boot
Reload the configuration without interrupting streaming with a signal:
kill -HUP "$(systemctl show -p MainPID --value sapsan)"
Health check¶
Make sure the process is running:
systemctl status sapsan
Check that the license is activated:
curl http://localhost/streamer/api-v4/license/status
The Licensed state means Sapsan is installed, activated, and ready. Also open the test stream playlist:
curl http://localhost/streaming/v/demo/index.m3u8
If the server returns a playlist, the demo stream works. Next, configure real video ingest.