sudo apt install git gcc autoconf automake libtool libgmp3-dev g++ libz-dev libjpeg-dev libx11-dev libgl-dev libxpm-dev libasound2-dev libsdl2-dev unzip
git clone git://git.xonotic.org/xonotic/xonotic.git
cd xonotic/
./all update -p
./all compile -r
cp server/server.cfg data/
test that the server is working
./all run dedicated xonotic
create a start script
#!/bin/bash
cd /home/<user>/xonotic/ && ./all run dedicated xonotic > /dev/null 2>&1
create a service file
sudo vim /lib/systemd/system/xonotic.service
add the following there
[Unit]
Description=Xonotic
After=network.target
[Service]
WorkingDirectory=/home/<user>/xonotic
ExecStart=/home/<user>/xonotic/run-dedicated.sh
User=<user>
[Install]
WantedBy=graphical.target #check target by running: systemctl get-default
enable and start the service
sudo systemctl daemon-reload
sudo systemctl enable xonotic.service
sudo systemctl start xonotic.service
check the server is running
ps -ef | grep darkplaces