Teamspeak is a popular voice chat program that allows you to have an audio conference with your friends, family, or coworkers; it is very useful especially when you need to hold a voice chat with many people at the same time.
If are interested in voice chats, you may have already used the similar feature provided by many instant messengers, like MSN Messenger or Skype. They work well, but they have a limit: they can support only few people on the chat at the same time (usually 5/10 people at maximum).
This limit is more than enough for many home users, but you may have experienced cases where you needed to support many more people. Playing a multi-players game is often a scenario for needing support for so many people.
Beside the above presentation, in this guide I am assuming that you are familiar with the Teamspeak’s client and probably you have already used it to connect to a third-party’s server, but eventually you found the need to host your own server.
Furthermore, as the title suggest, this guide only cover (for the moment …) the installation of the server on a Linux platform. In specific I tested it on Kubuntu since the 7.04 version and later versions; for the most parts this guide should work on any major Linux distribution, but be ready to have to adapt some step.
So, how do you get a Teamspeak server working:
sudo groupadd teamspeak
Then you can create the teamspeak user by typing:
sudo useradd -g teamspeak teamspeak -s /sbin/nologin
The “-g” flag indicates the group where the user will be added to and “-s” will disallow this user from logging interactively in to the system (since it is used to manage a single service, it should have no other access to the system).
sudo mkdir /home/teamspeak
sudo cp ts2_server_rc2_202319.tar.bz2 /home/teamspeak
sudo tar -jxvf ts2_server_rc2_202319.tar.bz2
cd tss2_rc2
sudo cp * -R /home/teamspeak
cd ..
sudo rm tss2_rc2 -R -f
sudo cp -f server_linux /home/teamspeak
sudo chgrp -R teamspeak /home/teamspeak
sudo chown -R teamspeak /home/teamspeak
sudo chmod a+x /home/teamspeak/server_linux
sudo -u teamspeak ./teamspeak2-server_startscript start
Wait a couple of seconds and than type:
sudo -u teamspeak ./teamspeak2-server_startscript stop
sudo vim /etc/init.d/teamspeak
I suggested to use vim since we are working from the console, but you can use any graphical editor without problems (from example kwrite o gedit). The code of the service is the following:
#! /bin/sh
### BEGIN INIT INFO
# Provides: teamspeak
# Required-Start: networking
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: S 0 1 6
# Short-Description: TeamSpeak Server Daemon
# Description: Starts/Stops/Restarts the TeamSpeak Server Daemon
### END INIT INFO
set -e
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DESC=”TeamSpeak Server”
NAME=teamspeak
USER=teamspeak
DIR=/home/teamspeak
DAEMON=$DIR/server_linux
#PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME
# Gracefully exit if the package has been removed.
test -x $DAEMON || exit 0
d_start() {
start-stop-daemon –start –quiet
–chuid $USER
–chdir $DIR
–exec $DAEMON
> /dev/null
|| echo -n ” already running”
}
d_stop() {
start-stop-daemon –stop –quiet
–chuid $USER
–chdir $DIR
–exec $DAEMON
|| echo -n ” not running”
}
case “$1” in
start)
echo -n “Starting $DESC: $NAME”
d_start
echo “.”
;;
stop)
echo -n “Stopping $DESC: $NAME”
d_stop
echo “.”
;;
restart|force-reload)
echo -n “Restarting $DESC: $NAME”
d_stop
sleep 15
d_start
echo “.”
;;
*)
echo “Usage: $SCRIPTNAME {start|stop|restart|force-reload}” >&2
exit 3
;;
esac
exit 0
Save and exit from the text editor.
sudo chmod a+x /etc/init.d/teamspeak
sudo /etc/init.d/teamspeak start
“Unfortunately” in my case it worked right away, so right now I do not have any idea about possible errors. If you find some please post it as a comment. 😀
cd /etc/rc0.d
sudo ln -s ../init.d/teamspeak K21teamspeak
cd /etc/rc1.d
sudo ln -s ../init.d/teamspeak K21teamspeak
cd /etc/rc2.d
sudo ln -s ../init.d/teamspeak S21teamspeak
cd /etc/rc3.d
sudo ln -s ../init.d/teamspeak S21teamspeak
cd /etc/rc4.d
sudo ln -s ../init.d/teamspeak S21teamspeak
cd /etc/rc5.d
sudo ln -s ../init.d/teamspeak S21teamspeak
cd /etc/rc6.d
sudo ln -s ../init.d/teamspeak K21teamspeak
Now the server will always start when you boot your machine and properly shut down when you either shut down the computer or merely reboot it.
When dealing with server applications, the install process is only half of the job and a great dealing of attention must be made to the configuration. Unfortunately, for the moment my guide stops here. I am already thinking to continue it with the configuration steps, but if you have the urge to finish the job now, you can find information on the below links and by Goolging around.
Links
Teamspeak’s home page: https://www.teamspeak.com/
Teamspeak’s download page: https://www.teamspeak.com/?page=downloads.
A (very good and especially complete) alternative guide: https://ubuntuforums.org/showthread.php?t=236834
This guide has been inspired by a similar guide made by the user “tja” in the Ubuntu’s forum; you can find the original post at https://ubuntuforums.org/showthread.php?t=236834.
The Teamspeak’s logo is copyrighted by TeamSpeak Systems GmbH.