PDA

View Full Version : Install a TS3 Server + Autostart script



CroCop
08-28-2014, 01:26 AM
1 step: create a new user

login via ssh to your debian server and create a new user for your teamspeak 3 server.

adduser ts3server

choose whatever password you want.

now we need to create a new folder for your serverfiles and and change the owner of the folder

create folder:


mkdir /home/ts3server


change owner:


chown ts3server /home/ts3server


after that login as ts3server



su ts3server


2 step: download server files

download the latest linux server files from here: http://www.teamspeak.com/?page=downloads
depending on if you are using x86 or a x64 linux server, you have to choose the right teamspeak server



cd /home/ts3server
wget http://dl.4players.de/ts/releases/3.0.10.3/teamspeak3-server_linux-amd64-3.0.10.3.tar.gz


3 step: installing the server

as soon your download is finished, you need to unzip all server files with this command:


tar -xzvf teamspeak3-server_linux*.tar.gz

enter the folder with this command:


cd teamspeak3-server_linux-amd64-3.0.10.3

move everything inside the folder to the upper folder with this command:


mv * ..

now we are going to start the server for the first time:


./teamspeak3-server_linux-amd64/ts3server_minimal_runscript.sh

you should see this informations now and write them down

15533

your server is ready to run.

- - - Updated - - -

now that you have a working teamspeak 3 server, you want it to start automatically as soon as your server gets started too.

create a new file under /etc/init.d and call it simply ts3server:


nano /etc/init.d/ts3server

and copy paste this autostart script in it



#!/bin/sh
### BEGIN INIT INFO

# Provides: teamspeak3
# Required-Start: $local_fs $network
# Required-Stop: $local_fs $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Description: Teamspeak 3 Server
### END INIT INFO


# INIT Script by www.SysADMINsLife.com

######################################
# Customize values for your needs: "User"; "DIR"

USER="teamspeak3"
DIR="/home/ts3server/teamspeak3-server_linux-amd64"

###### Teamspeak 3 server start/stop script ######

case "$1" in
start)
su $USER -c "${DIR}/ts3server_startscript.sh start"
;;
stop)
su $USER -c "${DIR}/ts3server_startscript.sh stop"
;;
restart)
su $USER -c "${DIR}/ts3server_startscript.sh restart"
;;
status)
su $USER -c "${DIR}/ts3server_startscript.sh status"
;;
*)
echo "Usage: {start|stop|restart|status}" >&2
exit 1
;;
esac
exit 0


set permissions for this new file

chmod +x /etc/init.d/ts3server

and now update it for autostart

update-rc.d ts3server defaults

now everytime your linux server gets restartad for whatever reason, your teamspeak server will autostart.

some commands for your server:

teamspeak start

/etc/init.d/ts3server start

teamspeak stop

/etc/init.d/ts3server stop

teamspeak restart

/etc/init.d/ts3server restart

teamspeak status

/etc/init.d/ts3server status