Skip to content

Instantly share code, notes, and snippets.

@sindastra
Created April 26, 2020 00:17
Show Gist options
  • Save sindastra/52237f1fc9969cd12689cd8a943fedd9 to your computer and use it in GitHub Desktop.
Save sindastra/52237f1fc9969cd12689cd8a943fedd9 to your computer and use it in GitHub Desktop.
TeamSpeak3 systemd service file tested with TeamSpeak version 3.12.1
[Unit]
Description=TeamSpeak3 Server
Wants=network-online.target
After=syslog.target network.target local-fs.target
[Service]
WorkingDirectory=/home/ts3server/teamspeak3-server_linux_amd64
User=ts3server
Group=ts3server
Type=forking
ExecStart=/home/ts3server/teamspeak3-server_linux_amd64/ts3server_startscript.sh start license_accepted=1
ExecStop=/home/ts3server/teamspeak3-server_linux_amd64/ts3server_startscript.sh stop
PIDFile=/home/ts3server/teamspeak3-server_linux_amd64/ts3server.pid
Restart=always
[Install]
WantedBy=multi-user.target
@sindastra
Copy link
Author

Create the file /etc/systemd/system/teamspeak.service with the above as its content.

Then to set up the server do something like (tested on Ubuntu 18.04 server):

adduser --disabled-password --disabled-login --shell /usr/sbin/nologin ts3server 
cd /home/ts3server
wget https://files.teamspeak-services.com/releases/server/3.12.1/teamspeak3-server_linux_amd64-3.12.1.tar.bz2
tar xf teamspeak3-server_linux_amd64-3.12.1.tar.bz2
chown -R ts3server:ts3server .
chmod -R g+s .
systemctl start teamspeak

If all goes well and it starts without issues, you can enable it to start automatically with:

systemctl enable teamspeak

To get the latest TeamSpeak 3 server or to upgrade the current installation get it from https://teamspeak.com/en/downloads/#server

Then cd to /home/ts3server, wget the latest .tar.bz2, untar it and restart the service with systemctl restart teamspeak

@Rohlik
Copy link

Rohlik commented Oct 22, 2022

Isn't Type=simple better solution? This way systemd monitors the process and you also get the stdout output from the teamspeak server in the journalctl output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment