A Teamspeak server is a piece of VoIP software which allows users to communicate with each other via speech. Teamspeak consists of two applications: a client and a server.
The client application is the program that you use on your computer to log into teamspeak. It can be downloaded from the download page on the official website. Download the client for the operating system that you are using.
The server application is the application that brings each client together. It is in charge of processing the VoIP data and handling messages between you and your friends.
This guide will explain the basics of setting up a TeamSpeak 3 server on Linux (Debian, CentOS & Ubuntu Distributions).
A VPS running Ubuntu / Debian / CentOS.
Teamspeak client software installed on your computer.
An initial server setup for:
First, create a new user with your desired name, we will use the name "teamspeak" for this guide.
adduser --disabled-login teamspeak
useradd teamspeakpasswd teamspeak
Get the latest TeamSpeak 3 server files for 64-bit Linux. Check their website, a new version may be available for all the distributions.
Extract the archive for all the distributions.
tar xvf teamspeak3-server_linux_amd64-3.3.0.tar.bz2
This will create a new folder in the root directory called:
Move the extracted files to the
teamspeak user's home directory then remove the extracted folder and downloaded archive.
cd teamspeak3-server_linux_amd64 && mv * /home/teamspeak && cd .. && rm -rf teamspeak3*
Accept the license agreement:
Change ownership of the TeamSpeak 3 server files.
chown -R teamspeak:teamspeak /home/teamspeak
Make the TeamSpeak 3 server start on boot. Use your favorite editor to make a new file called
Paste this content into it:
/lib/systemd/system/teamspeak.service[Unit]Description=TeamSpeak 3 ServerAfter=network.target[Service]WorkingDirectory=/home/teamspeak/User=teamspeakGroup=teamspeakType=forkingExecStart=/home/teamspeak/ts3server_startscript.sh startExecRestart=/home/teamspeak/ts3server_startscript.sh stopExecStop=/home/teamspeak/ts3server_startscript.sh stopPIDFile=/home/teamspeak/ts3server.pidRestartSec=15Restart=always[Install]WantedBy=multi-user.target
Once you are done, save the file and close the editor. Now we will activate the script so that it will start on boot.
This makes to systemd recognize the file we just created.
systemctl --system daemon-reload
Enable the service.
systemctl enable teamspeak.service
Start the TeamSpeak server.
systemctl start teamspeak.service
Once you've started the server, you can check that it's running with this command.
systemctl status teamspeak.service
Make Teamspeak3 start on boot up. For this, we will need to create a symlink to the script which was included in the archive that we downloaded earlier.
sudo ln -s /usr/local/teamspeak/ts3server_startscript.sh /etc/init.d/teamspeaksudo update-rc.d teamspeak defaults
Now all that is left to do is to start your Teamspeak server!
sudo service teamspeak start
On your terminal, you will see a screen with the query username/password and a privilege key - be sure to write this information down as you will need it to administer your server.
Now we need to create the script in the /etc/init.d folder:
Once you are in the file paste the following code into the file by right clicking the mouse.
/etc/init.d/teamspeak#!/bin/sh# chkconfig: 2345 99 10USER="teamspeak"TS3='/home/teamspeak/'STARTSCRIPT="$TS3/ts3server_startscript.sh"cd $TS3case "$1" in'start')su $USER -c "$STARTSCRIPT start";;'stop')su $USER -c "$STARTSCRIPT stop";;'restart')su $USER -c "$STARTSCRIPT restart";;'status')su $USER -c "$STARTSCRIPT status";;*)echo "Usage $0 start|stop|restart|status"esac
Click Ctrl + O to save the file then Ctrl + X to exit the file. We can then set the file permission so it will work properly.
chmod 755 /etc/init.d/teamspeak
Now we need to add the service so it will restart when the server is restarted. Enter the following commands and then restart the server.
chkconfig --add teamspeakchkconfig --level 2345 teamspeak on
Once the server restarts connect to teamspeak and make sure everything restarted. You can also check the status through command line by using the following command.
service teamspeak status
When you first try to connect to your TeamSpeak server, you may be prompted to use a privilege key. This privilege key allows to administrate your TeamSpeak server. To get this privilege key, use the following command:
At bottom you'll see something that looks like this:
--------------------------------------------------------ServerAdmin privilege key created, please use the line belowtoken=****************************************--------------------------------------------------------
Replace the stars with your unique token, and enter it into your TeamSpeak client. You'll see a prompt telling you that the privilege key was successfully used.
If you are using the built-in firewall that was included with the Ubuntu installation then
iptables is your firewall. You may need to forward the following ports to allow connections to your TeamSpeak 3 Server.
iptables -A INPUT -p udp --dport 9987 -j ACCEPTiptables -A INPUT -p udp --sport 9987 -j ACCEPTiptables -A INPUT -p tcp --dport 30033 -j ACCEPTiptables -A INPUT -p tcp --sport 30033 -j ACCEPTiptables -A INPUT -p tcp --dport 10011 -j ACCEPTiptables -A INPUT -p tcp --sport 10011 -j ACCEPT
Congratulations! You've successfully created a Teamspeak Server. You can connect to it with the Teamspeak Client.