TeamSpeak 3 is a popular VoIP solution that is commonly used in the PC Gaming community but it can also be used for online voice communication outside of gaming. TeamSpeak requires the user to have a client installed on each PC and a central server that all the client connect to. This tutorial will follow take you through a step-by-step process for setting up a Teamspeak server.
To follow this guide you will need the following:
- An Ubuntu 16.04 LTS server
- Root access or a user account with sudo privileges
- A system with the TeamSpeak 3 client installed to test the server
Step 1 – Running Updates
To being you should check to see if your Ubuntu 16.04 LTS install is up-to-date by running the following command:
sudo apt update && sudo apt upgrade
Step 2 – User Creation
Now a user account for the TeamSpeak 3 server will be created on your server to run the software and store the files for the software. This is being done because the TeamSpeak server software isn’t released in a way that can be installed via a distributions package manager.
sudo adduser --disabled-login teamspeak
The fields for entering a name and contact information can be left blank and then the server software for TeamSpeak can be installed.
wget http://dl.4players.de/ts/releases/18.104.22.168/teamspeak3-server_linux_amd64-22.214.171.124.tar.bz2 tar xvf teamspeak3-server_linux_amd64-126.96.36.199.tar.bz2 cd teamspeak3-server_linux_amd64 cp * -R /home/teamspeak cd .. rm -rf teamspeak3-server_linux_amd64* chown -R teamspeak:teamspeak /home/teamspeak
Step 3 – Startup Script
By default the TeamSpeak 3 server won’t start by default when the system boots. This can be corrected by creating a startup script. Start by running this command:
sudo nano /lib/systemd/system/teamspeak.service
Then paste the following content into the file.
[Unit] Description=Team Speak 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 done, save and close the editor then enable the server and startup script with this command:
systemctl --system daemon-reload systemctl start teamspeak.service systemctl enable teamspeak.service
You can check to see if the server is running by using the following command:
sudo systemctl status teamspeak.service
Step 4 – Firewall Rules
Before you can connect to the server, you will need to add firewall rules for the server to be open on the 3 ports a Teamspeak requires to function correctly. These ports are the following:
- 9987 UDP for TeamSpeak Voice Service
- 10011 TCP for TeamSpeak ServerQuery
- 30033 TCP for TeamSpeak FileTransfer
We are going to enable these ports using UFW via the following command:
sudo ufw allow 9987/udp sudo ufw allow 10011/tcp sudo ufw allow 3033/tcp
You can check to see if your firewall is configured correctly with the following command:
sudo ufw status
Step 5 – Connecting to the Server
You can now connect to your TeamSpeak 3 server via the client you should already have installed. You can connect via the public IP address of your server. When you first connect, you will be asked to enter the privilege key for your server to get full admin permissions. You can find this in the server logs by running the following command:
sudo cat /home/teamspeak/logs/ts3server_*
The privilege key will be near the top of the logs. Once entered into the client you can then configure the server from the TeamSpeak 3 client.
You now have a TeamSpeak 3 server running on your Ubuntu 16.04 server. If you need to rent an Ubuntu server, you can do so by DigitalOcean (referral link).