Install the agent on FreeBSD and Linux
This guide shows how to install the agent, check the service and uninstall it. You need about ten minutes and root access to your server once.
Note: The panel shows the commands with the exact address of the platform and your code. Use those values.
1. Check the requirements
- FreeBSD 12 or newer, or Debian 11 and newer or Ubuntu 22.04 and newer
- root access over SSH for the installation
- Python 3. If it is missing, the script installs it with
pkgorapt. - outgoing connections to the address of the platform, which is shown next to the code in the panel
- about 50 MB of free space
To see which system you run, use freebsd-version on FreeBSD and cat /etc/os-release on Linux. Check the Python version like this:
2. Get the code in the panel
Sign in to the panel, choose Server verbinden (connect server), give the server a name and choose your game. The panel shows a code in the format ABCD-EFGH and the two commands for your system. The code is valid for 24 hours and can be used once.
3. Download and read the script
Download the script as a file first so you can read it before you run it. On FreeBSD:
On Linux:
The script does the following:
- checks the system and Python 3 and installs Python after asking you
- downloads the agent program and checks its SHA-256 checksum
- copies the program to
/usr/local/libexec/serverwerk/(FreeBSD) or/opt/serverwerk-agent/(Linux) - creates the configuration at
/usr/local/etc/serverwerk/agent.confor/etc/serverwerk/agent.conf(mode 600) - sets up the service, starts it and exchanges the code for the server's own key
4. Install the agent
Run the script with your code. The command is the same on both systems:
The output looks roughly like this (the messages are in German for now):
The agent runs as root because it has to read the working directories of the game processes, the SSH settings and the open ports, and run approved actions. At first no action is approved, so it only reads. It does not start a shell and only calls fixed programs.
5. Check the service
On FreeBSD:
The script adds serverwerk_agent_enable="YES" to /etc/rc.conf so the agent starts again after a reboot of the server. You can check it with sysrc serverwerk_agent_enable.
On Linux:
If it says enabled, the agent also starts after a reboot of the server. What the agent did last is in the log on both systems:
In the panel the server now shows verbunden (connected). After about two minutes the first server check appears.
6. Firewall
The agent needs no open port. You only have to change something if your firewall also filters outgoing connections. In that case allow the outgoing connection to the address and port shown in the install command in the panel. In /etc/pf.conf on FreeBSD, for example:
Test the rules with pfctl -nf /etc/pf.conf and load them with pfctl -f /etc/pf.conf.
7. Common errors
The messages come from the script and are in German for now.
| Message | Cause and fix |
|---|---|
| Code ungültig oder abgelaufen | The code is older than 24 hours or was already used. Create a new one in the panel. |
| Keine Verbindung zur Plattform | Outgoing connections are blocked or name resolution is missing. Check the firewall and /etc/resolv.conf. |
| Auftrag abgelaufen oder liegt in der Zukunft | Jobs are valid for 10 minutes only, so the clock of the server must be right. Check the time with date and set up ntpd or timedatectl set-ntp true. |
| Python 3 nicht gefunden | The system version has no package sources any more. Update the system, see keeping the system up to date. |
8. Remove the agent
The command to remove it is also shown in the panel for your server:
It stops the service and removes the program, the configuration with the key, the status file and the log. If you no longer have the script, download it again as in step 3. To check that the service is gone, run this on FreeBSD. It then reports “does not exist”:
On Linux this one reports “could not be found”:
After that, remove the server in the panel. Measurements are deleted 30 days later. Backups on your server stay there until you delete them. Copies in our storage are deleted as soon as the server is removed.