Install Teamspeak 3 Server on Linux

From Bonus Bits Wiki
Jump to: navigation, search

Contents

Purpose

This article explains the basics for installing Teamspeak 3 on Linux. In the example CentOS 5.6 is used.


Create User

  • Create a user to run the server
    • Useradd teamspeak
    • Passwd teamspeak
    • /home/teamspeak


Create TS3 Directory

  1. mkdir /home/teamspeak/TS3


Download Files

  1. Browse to http://www.teamspeak.com/?page=downloads
  2. Select current Arch version
  3. Copy Shortcut Target from "I Agree"
  4. Use wget to download directly to the Linux server to a temp directory
    1. wget http://teamspeak.gameserver.gamed.de/ts3/releases/rc1/teamspeak3-server_linux-x86-3.0.0-rc1.tar.gz
      Note Do not extract on a Windows system and then transfer the extracted files to the Linux host. It will lose the file permissions.


Extract to Run Directory

Common TAR Commands

tar -zxvf teamspeak3-server_linux-x86-3.0.0-rc1.tar.gz --strip-components 1 -C /home/teamspeak/TS3
chown -R teamspeak:teamspeak /home/teamspeak

Manually Start First Time

su teamspeak -c "/home/teamspeak/TS3/ts3server_startscript.sh start"

Note Copy the server admin token key if the first time running.

 ------------------------------------------------------------------
                        I M P O R T A N T                           
  ------------------------------------------------------------------
               Server Query Admin Acccount created                 
           loginname= "serveradmin", password= "fDprQFjv"
  ------------------------------------------------------------------
   
   
  ------------------------------------------------------------------
                        I M P O R T A N T                           
  ------------------------------------------------------------------
        ServerAdmin privilege key created, please use it to gain 
        serveradmin rights for your virtualserver. please
        also check the doc/token_guide.txt for details.
  
         token=Drp5gFCr80GGFUfWrDSnun8Ugfq9+lblZ6x1aMHW
  ------------------------------------------------------------------


Connect

  1. Install Teamspeak 3 client on a system
  2. connect to the server IP address
  3. Make yourself the admin with the server admin token key
    1. Permissions | Use Privilege Key


Setup Automatic Launch on Boot

Create Launcher File

touch /etc/init.d/teamspeak3
vim /etc/init.d/teamspeak3

Paste this script into the file:

#!/bin/bash
#
# teamspeak3 Start/Stop/Restart Teamspeak service
#
# chkconfig: 2345 98 8
# description: Start/Stop/Restart the Teamspeak voice server
# install: chkconfig --add teamspeak3
# uninstall: chkconfig --del teamspeak3
# author: Tig (wowsin.org)

# Location of the 'su' command
su=/bin/su
# Username of the teamspeak3 user
user=teamspeak
# Directory of the teamspeak3 server. This can be absolute eg:
# /home/ts/ts3
# or relative (meaning if your directory is in the home directory of ts and is called ts3
# then you just need ts3, as is the default.
dir=/home/teamspeak/TS3/
# The start script (I use the current default
exec=./ts3server_startscript.sh

# See how we were called.
case "$1" in
start)
$su - $user -c "cd $dir;$exec start"
;;
stop)
$su - $user -c "cd $dir;$exec stop"
;;
restart)
$su - $user -c "cd $dir;$exec restart"
;;
status)
$su - $user -c "cd $dir;$exec status"
;;
*)
echo $"Usage: $0 {start|stop|restart|status}"
exit 2
esac
exit 0 


Change Permissions

chmod 0755 /etc/init.d/teamspeak3


Add Launch File to Chkconfig

chkconfig --add teamspeak3


Restart Server

service teamspeak3 restart


Migrating from one Server to another (Same Version)

If migrating then now copy all the files from the old server over top. This even works if going from Windows to Linux. You can dump the .txt, .dll and .exe files. be sure to check file permissions and ownership.


Sources

http://wiki.ipfire.org/en/addons/teamspeak3/start 

http://forum.teamspeak.com/showthread.php/63833-TS3-won-t-start-on-boot-Cento-OS?highlight=Linux+chkconfig