Installing and setting up TS3 on a Linux CentOs VPS with Auto Restart
You do not want to run teamspeak as the root user. We will start with creating a user, password and setting the file permissions correctly. You will need to login to your server using Putty or another ssh program. I personally use WinSCP and PuTTy.Resources:
The first step is creating the user for your TS3 installation.
useradd ts3userYou need to create a password for the user. You will need to enter the password 2 times.
You will need to change the file permissions for the user to 0755. You do this by running the following command.
chmod 755 /home/ts3user
Once the user is created and file permissions set you will need to switch to that user.
Now you need to go into the directory
Once in the directory, you need to download the version of teamspeak you want to use. You can get that from http://www.teamspeak…page=downloads
I am using 64bit CentOs 6.5 Final, so I will use the following url.
To download the file simply copy the url and paste it into the command window by right clicking. You will need to use the wget command before the url. It will look like this.
Once the file is downloaded you need to unpack it. (Change the version number to the version you downloaded)
tar -zxvf teamspeak3-server_linux-amd64-220.127.116.11.tar.gz
Now you need to delete the downloaded file.
We can now change the name of the folder so it is a little shorter.
mv teamspeak3-server_linux-amd64 teamspeak3-server
Now you will need to go into that directory.
You do not have a ts3server.ini file yet so we need to create one. This is the file we will need to edit so we can change the ip address and ports if needed.
You will get some information including your master token key. Copy it by highlighting it and using normal copy ctrl+c. Now you need to edit the ts3server.ini file. You can download this file from the root/home/ts3user/teamspeak3-server_linux-amd64 folder on your server. For starters, you just need to add the ip address for the voice connection. You can also edit the file from command line by doing the following:
Upload the file and then start the server. If you used nano just hit Ctrl + O and hit enter to save. Then press Ctrl + X to exit that file.
Your server is now running. You can stop, start and restart the server with the same command. You simply need to change the command at the end.
Creating the Auto Restart Service
You will want to switch to the root user and then root directory.
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.
# chkconfig: 2345 99 10
case “$1” in
su $USER -c “$STARTSCRIPT start”
su $USER -c “$STARTSCRIPT stop”
su $USER -c “$STARTSCRIPT restart”
su $USER -c “$STARTSCRIPT status”
echo “Usage $0 start|stop|restart|status”
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 teamspeak
chkconfig –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
That is all! Your Teamspeak 3 server should be running smooth on your VPS server. If you make a mistake and need to start over, you can easily remove the user and user directory from the server by using the following command.
userdel -r ts3user
I hope this helps.