A lot of people seem to have trouble setting up a teamspeak 3 server so I wrote a little tutorial to help those people.
The following list is not (yet) covered by me in this tutorial, maybe I will update this later. For now: Google is your friend.
- securing ssh connection
- proper firewall configuration
For this setup I have a basic Debian 8 on a Virtual Machine with root access over ssh.
- Step 1: Create a user.
This will create a user called “teamspeak”, that has no password and without being asked for input. (I recommend using a certificate instead of password)
adduser --disabled-password --gecos "" teamspeak
- Step 2: Create a folder.
This will create a folder for the teamspeak 3 server and grand rights to the user “teamspeak”.
mkdir /opt/teamspeak chown teamspeak:teamspeak /opt/teamspeak/ chmod 0770 /opt/teamspeak/
- Step 3: Create a service script.
Create a script to manage the teamspeak 3 server.
Press the “insert”-button and enter the following code:
[Unit] Description=Teamspeak 3 Server [Service] ExecStart=/opt/teamspeak/ts3server_startscript.sh start ExecStop=/opt/teamspeak/ts3server_startscript.sh stop PIDFile=/opt/teamspeak/ts3server.pid Type=forking User=teamspeak Group=teamspeak [Install] WantedBy=multi-user.target
Save and close the file by pressing the “escape”-button and typing:
Set proper rights and reload the systemctl daemon.
chmod 664 /etc/systemd/system/teamspeak3server.service systemctl daemon-reload systemctl enable teamspeak3server.service
- Step 4: Grant proper rights.
Grand user “teamspeak” sudo rights to manage the service.
Search for and add the following lines:
# Cmnd alias specification Cmnd_Alias TEAMSPEAK_CMDS = /bin/systemctl start teamspeak3server, /bin/systemctl stop teamspeak3server, /bin/systemctl restart teamspeak3server, /bin/systemctl status teamspeak3server # User privilege specification teamspeak ALL=NOPASSWD: TEAMSPEAK_CMDS, /sbin/reboot
Press the following button combination: “Ctrl + X”, press the “Y”-button and press the “Enter”-button.
- Step 5: Setup actual teamspeak 3 server.
Download and install teamspeak 3 server.
While in terminal as “root” now login as user “teamspeak” by typing the following:
sudo -iu teamspeak
Download, unpack, move and remove archive:
wget http://dl.4players.de/ts/releases/18.104.22.168/teamspeak3-server_linux_amd64-22.214.171.124.tar.bz2 tar xfv teamspeak3-server_linux_amd64-126.96.36.199.tar.bz2 mv ~/teamspeak3-server_linux_amd64/* /opt/teamspeak/ rm -rf ~/teamspeak3-server_linux_amd64*
Now startup your server with the following command, this will generate some important keys that will have to save to a file on the server itself (less secure) or on your pc (recommended):
When you saved the output to file I recommend to reboot the physical server to test the automatic start function, type:
After this you can manage the “teamspeak 3 server”-service as user “teamspeak” with the following commands:
sudo systemctl start teamspeak3server sudo systemctl stop teamspeak3server sudo systemctl restart teamspeak3server sudo systemctl status teamspeak3server
Now you can try to connect to your teamspeak server using the client, you will need the generated key you have saved earlier.