How to Install Teamspeak 3 Server on Ubuntu 16.04 64-bit

Published on: Mon, Aug 14, 2017 at 5:14 pm EST

Overview

Sick of using Discord/Skype? Tired of not having complete control of your server? Or maybe it's because of the lack of customizable settings? Too much bandwidth usage? Well look no further! Teamspeak is here to help!

In this guide, I will show you on how to install TeamSpeak 3 Server on your Ubuntu 16.04 64-bit Vultr VPS.

Requirements

  • A VPS running Ubuntu 16.04 from Vultr.

Instructions

Step 1.

First, create a new user with your desired name, we will use the name "teamspeak" for this guide.

adduser --disabled-login teamspeak

Step 2.

Get the latest TeamSpeak 3 server files for 64-bit Linux. Check their website, a new version may be available.

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

Step 3.

Extract the archive.

tar xvf teamspeak3-server_linux_amd64-3.1.1.tar.bz2

This will create a new folder in the root directory called: teamspeak3-server_linux_amd64

Step 4.

Move the extracted files to the teamspeak user's home directory then remove the extracted folder and downloaded archive.

cd teamspeak3-server_linux_amd64 && mv * /home/teamspeak && cd .. && rm -rf teamspeak3*

Accept the license agreement:

touch /home/teamspeak/.ts3server_license_accepted

Step 5.

Change ownership of the TeamSpeak 3 server files.

chown -R teamspeak:teamspeak /home/teamspeak

Step 6.

Make the TeamSpeak 3 server start on boot. Use your favorite editor to make a new file called teamspeak.service in /lib/systemd/system/.

nano /lib/systemd/system/teamspeak.service

Paste this content into it:

[Unit]
Description=TeamSpeak 3 Server
After=network.target

[Service]
WorkingDirectory=/home/teamspeak/
User=teamspeak
Group=teamspeak
Type=forking
ExecStart=/home/teamspeak/ts3server_startscript.sh start inifile=ts3server.ini
ExecStop=/home/teamspeak/ts3server_startscript.sh stop
PIDFile=/home/teamspeak/ts3server.pid
RestartSec=15
Restart=always

[Install]
WantedBy=multi-user.target

Once you are done, save the file and close the editor. Now we will activate the script so that it will start on boot.

This makes to systemd recognize the file we just created.

systemctl --system daemon-reload

Enable the service.

systemctl enable teamspeak.service

Start the TeamSpeak server.

systemctl start teamspeak.service

Once you've started the server, you can check that it's running with this command.

systemctl status teamspeak.service

Step 7.

When you first try to connect to your TeamSpeak server, you may be prompted to use a privilege key. This privilege key allows to administrate your TeamSpeak server. To get this privilege key, use the following command:

cat /home/teamspeak/logs/ts3server_*

At bottom you'll see something that looks like this:

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

Replace the stars with your unique token, and enter it into your TeamSpeak client. You'll see a prompt telling you that the privilege key was successfully used.

Optional: Firewall

If you are using the built-in firewall that was included with the Ubuntu installation then iptables is your firewall. You may need to forward the following ports to allow connections to your TeamSpeak 3 Server.

iptables -A INPUT -p udp --dport 9987 -j ACCEPT
iptables -A INPUT -p udp --sport 9987 -j ACCEPT
iptables -A INPUT -p tcp --dport 30033 -j ACCEPT
iptables -A INPUT -p tcp --sport 30033 -j ACCEPT
iptables -A INPUT -p tcp --dport 10011 -j ACCEPT
iptables -A INPUT -p tcp --sport 10011 -j ACCEPT