Create a directory
mkdir /teamspeak
and a non-root user
adduser teamspeak --system --home /teamspeak --disabled-login
Get the server package downloadlink from either the website or directly from the fileserver
https://www.teamspeak.com/de/downloads/#server https://files.teamspeak-services.com/releases/server/
Change to your directory and download the package
cd /teamspeak wget <URL>
Unpack
tar -xjf <PACKAGE>
Change the owner of the files to your user
chown -R teamspeak /teamspeak/
If you feel the need to change ports or add a proxy, you can create an .ini file and edit it
Change to your non-root user and execute the following in your teamspeak directory
su teamspeak -s /bin/sh ./ts3server createinifile=1
You can also create a white- and blacklist to prevent users from joining
vi query_ip_whitelist.txt #example 127.0.0.1 ::1 192.168.0.0/16
vi query_ip_blacklist.txt #example 127.0.0.1 ::1 192.168.0.0/16
Change to your non-root user, accept the license and start the server for the first time
su teamspeak -s /bin/sh touch .ts3server_license_accepted ./ts3server_minimal_runscript.sh
Keep the window open and login to your server with the client
The login details are shown in your CLI, also the “ServerAdmin privilege key” which you need to enter.
If you were logged in, stop the server via strg + c
Create a new unit “/etc/systemd/system/teamspeak.service” with the following content
[Unit] Description=TeamSpeak3 Server Wants=network-online.target After=syslog.target network.target [Service] WorkingDirectory=/teamspeak/teamspeak3-server_linux-amd64/ User=teamspeak Type=forking ExecStart=/teamspeak/teamspeak3-server_linux_amd64/ts3server_startscript.sh start initfile=ts3server.ini ExecStop=/teamspeak/teamspeak3-server_linux_amd64/ts3server_startscript.sh stop ExecReload=/teamspeak/teamspeak3-server_linux_amd64/ts3server_startscript.sh restart PIDFile=/teamspeak/teamspeak3-server_linux_amd64/ts3server.pid [Install] WantedBy=multi-user.target
Incase you already had this file and/or changed anything, run “systemctl daemon-reload” to reload the units
Add the service to autostart
systemctl enable teamspeak
You can now start/stop/restart and see the status of the service via the following commands
systemctl start teamspeak systemctl stop teamspeak systemctl restart teamspeak systemctl status teamspeak
The server doesnt start and the log shows the following error
failed to register local accounting service: File exists
Reason:
A file was created by root and cant be used by your non-root user
Fix:
Check for a cryptic file in /dev/shm/
ls -al /dev/shm/ total 39228 drwxrwxrwt 2 root root 1800 Dez 5 11:41 . drwxr-xr-x 17 root root 3640 Nov 13 06:47 .. -rw-r--r-- 1 root root 128 Dez 5 11:41 7gbhujb54g8z9hu43jre8and remove it
rm /dev/shm/7gbhujb54g8z9hu43jre8
If you start teamspeak now, the file will be created with the correct user
ls -al /dev/shm/ total 39228 drwxrwxrwt 2 root root 1800 Dez 5 12:10 . drwxr-xr-x 17 root root 3640 Nov 13 06:47 .. -rw-r--r-- 1 teamspeak teamspeak 128 Dez 5 12:10 7gbhujb54g8z9hu43jre8
The server doesnt start and the log shows the following error
|CRITICAL|Accounting | |Failed loading default license file!
Reason:
Your license expired
Fix:
Update your Teamspeakserver to renew the license
Get the server package downloadlink from either the website or directly from the fileserver
https://www.teamspeak.com/de/downloads/#server https://files.teamspeak-services.com/releases/server/
Change to your directory and download the package
cd /teamspeak wget <URL>
Backup your old folder in case something is broken after overwriting
cp -a teamspeak3-server_linux_amd64 teamspeak3-server_linux_amd64_bak_20211124
Unpack (overwrite the existing folder)
tar -xvf <PACKAGE>
and start as usual
systemctl start teamspeak