How to setup a Teamspeak Server using a VPS

Teamspeak is a VoIP-software (Voice over Internet Protocol) that is commonly used to communicate while e.g. playing games. I use it myself and therefore decided to create my own TS3 server.


Requirements

First of all you will need a VPS (Virtual Private Server). There are a ton of different options but I use Digital Ocean. Using my referral link you will receive $10 of credit to use for a VPS.

Then you will need an SSH Client like PuTTY or if you’re using a Linux distribution of your choice you can download it through their own package management system. I use Xubuntu myself and I can download the SSH daemon thru Terminal,

sudo apt-get install openssh-server

Firewall

Make a hole in the firewall for your SSH and after that enable it,

sudo ufw allow 22/tcp
sudo ufw enable

Last but not least you will need the credentials (IP, Password) for your VPS from the provider which will be sent to you via email.

Connecting to your VPS

Connect to your VPS using the PuTTY or the Terminal. Here you will need the credentials. Use the command ssh with root@yourIPaddress,

ssh root@123.123.123.123

Enter password. It will ask you to give a new password, remember to make it good. Never give bad passwords such as “catdog123” or “admin123” because they can be easily cracked using a dictionary attack. Give complex passwords that ideally contains numbers, symbols, lower and upper case letters.

Create a new sudo user, use your own name, I’ll use mine in this example,

sudo adduser kristian
sudo adduser kristian sudo
sudo adduser kristian adm
sudo adduser kristian admin

Test the account that it works by opening a new terminal and connecting with your username,

ssh kristian@123.123.123.123

Enter password and if you get in,  it works.

To add extra safety we are going to close the root account.

sudo usermod --lock root

Then we will disable the root login on SSH,

sudoedit /etc/ssh/sshd_config

Search for the line where it says PermitRootLogin yes and replace it with PermitRootLogin no. After that we will restart the SSH daemon so that the new configs will take place.

sudo service ssh restart

Update and upgrade your packages for the latest security patches,

sudo apt-get update
sudo apt-get upgrade

References for disabling root login

Installation

Create a new user “teamspeak”,

sudo adduser teamspeak

Download the Teamspeak package,

wget http://dl.4players.de/ts/releases/3.0.12.4/teamspeak3-server_linux_amd64-3.0.12.4.tar.bz2

Extract the package,

tar -jxvf teamspeak3-server_linux_amd*.tar.bz2

Move the the file to the teamspeak user,

sudo mv teamspeak3-server_linux_amd64 /usr/local/teamspeak

Change the owner of the directory,

sudo chown -R teamspeak:teamspeak /usr/local/teamspeak

Connect the ts3server_startscript.sh file to /etc/init.d/teamspeak directory,

sudo ln -s /usr/local/teamspeak/ts3server_startscript.sh /etc/init.d/teamspeak

And to make the server run automatically after system boot,

sudo update-rc.d teamspeak defaults

We need to create some holes to our firewall so that it can be accessible,

sudo ufw allow 9987/udp
sudo ufw allow 10011/tcp
sudo ufw allow 30033/tcp

To let the changes take place we need to restart the service,

sudo service teamspeak start

Privilege key for administration

You will need your privilege key to administrate your server, you will find this key by this command,

cat /usr/local/teamspeak/logs/ts3server_*

The key will be a long “password” like string and will locate under a line that says, ServerAdmin privilege key created, please use the line below, it will look something like this,

|--------------------------------------------------------
ServerAdmin privilege key created, please use the line below
token=jdIs2jo5sd30Asbm40JIi26m5aDmZT
|--------------------------------------------------------

When you run your Teamspeak Client and connect to your address it will ask for your privilege key, copy paste your own token, in my example it is jdIs2jo5sd30Asbm40JIi26m5aDmZT and press OK. If it works it will say Privilege Key successfully used.

Now you have successfully created your own Teamspeak Server, Congratulations!

You can now go ahead and create channels, sub-channels and more.

1 thought on “How to setup a Teamspeak Server using a VPS

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.