Headless Linux Server
This has been written and tested on Ubuntu 24.04, but should be translatable to other ubuntu/debian based distributions with little effort.
It require CasparCG 2.5.0 or later, earlier versions do not support running without a x11 server.
The aim of this, is to setup a server to run CasparCG on startup, without needing any manual intervention or login or user session.
This is quite barebones, and does not attempt to harden the setup in any way.
Please contribute any tips or improvements you may have
Basic system setup
-
Install Ubuntu 24.04 on your machine. You can choose the minimal install, and perform disk and other setup as you wish.
-
Ensure the system is fully updated
sudo apt update && sudo apt upgrade -
Install nvidia drivers
apt install nvidia-driver-570-server -
Install some common tools
apt install wget nano
Install Decklink drivers
-
Download these from the Blackmagic website. You may need to use the latest to ensure there aren't issues compiling against the kernel.
To do so directly onto the server, you can start the download locally to determine a valid url and then perform that on the server with:
wget "some-url-here" -O Blackmagic_Desktop_Video_Linux.tar.gz -
Extract the drivers
tar -xvzf Blackmagic_Desktop_Video_Linux.tar.gz -
Install the needed package
sudo apt install -y Blackmagic_Desktop_Video_Linux/deb/x86_64/desktopvideo_*.deb
Make sure to not install the gui portion, or it will pull in a lot more dependencies than are necessary
Install the server
Specific version
-
Download CasparCG onto your machine, and extract the zip if there is any
-
Install the scanner
sudo apt install -y casparcg-scanner*.deb -
Install CEF
sudo apt install -y casparcg-cef*.deb -
Install CasparCG
sudo apt install -y casparcg-server*.deb
Latest version
An Ubuntu PPA is also maintained, which contains the latest version of each minor release: https://launchpad.net/~casparcg/+archive/ubuntu/ppa
If you are less particular about the version, and are ok with it being updated with your system updates, you can install from there instead:
-
Setup the PPA
sudo add-apt-repository ppa:casparcg/ppa
sudo apt update -
Install the packages
sudo apt install -y casparcg-server casparcg-scanner
You can install a specific minor version instead of the latest with sudo apt install -y casparcg-server-2.4.
Multiple of these can be installed at once, each provides a binary named the same as the package
Configure CasparCG
The exact path of the configuration is not too important, but you need to make sure that everywhere references the same. For simplicity, we shall do so under /opt/casparcg. You are free to put it elsewhere or split it up like is possible on windows.
-
Create a system user to run casparcg as
sudo adduser casparcg --system --no-create-home -
Create configuration directory
sudo mkdir /opt/casparcg && sudo chown casparcg /opt/casparcg -
Copy default configuration
sudo cp /usr/share/casparcg-server-beta/casparcg.config /opt/casparcg/
Note: the source path of this may be different, depending on what version you installed -
Edit the config as required
sudo nano /opt/casparcg/casparcg.config
Setup autostart
-
Create scanner config
sudo nano nano etc/systemd/system/casparcg-scanner.service
With the content:[Unit]
Description=CasparCG Scanner
[Service]
Type=simple
User=casparcg
#Group=
WorkingDirectory=/opt/casparcg
ExecStart=/usr/bin/casparcg-scanner
Restart=on-failure
[Install]
WantedBy=default.target -
Create server config
sudo nano nano etc/systemd/system/casparcg-server.service
With the content:[Unit]
Description=CasparCG Server
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
User=casparcg
#Group=
WorkingDirectory=/opt/casparcg
ExecStart=/usr/bin/casparcg-server-beta
Restart=on-failure
[Install]
WantedBy=multi-user.targetNote: the name of the executable here may need changing to match the version of casparcg you have installed
-
Start everything
sudo systemctl daemon-reload
sudo systemctl enable --now casparcg-scanner
sudo systemctl enable --now casparcg-serverNote: you may need to reboot for it to start correctly.
Recommended config changes
You should disable the builtin logging to disk, as journald will also be doing this for you.
Update the <log-path disable="true">log/</log-path> line to set disable to true
If using CEF/HTML, you will likely want to enable gpu mode and setup a cache path
<html>
<enable-gpu>true</enable-gpu>
</html>
Debugging
If you want to more rapidly iterate on configuration, it can often be easier to disable the systemd launch, and start the server manually
cd /opt/casparcg
sudo systemctl stop casparcg-server
# edit the config
nano casparcg.config
casparcg-server-beta
# once done
sudo systemctl start casparcg-server