The time finally arrived to annihilate the old Crystal Docks TeamSpeak3 server, and rebuild it to make it harder better faster stronger. Below is all the bits and pieces related to rebuilding TeamSpeak3 on the new server.
This was created on a Ubuntu 18.04 LTS server, so if you’re using a different distribution then you might run into problems executing the commands below.
Backup
It’s always a good idea to backup your stuff, especially when you’re going to be detonating servers. It’s also a smart move to test your backups, which you should totally do because I definitely did. When you back up TeamSpeak3, you should stop the service for the backup. I use the below rsync command. Adjust as you need.
|
|
Migration Files
If you need to migrate your TeamSpeak3 instance over to a new instance, there’s a few files which you’ll want to move over from your backup. Their knowledge base suggests migrating the below files.
- licensekey.dat
- query_ip_whitelist.txt
- query_ip_blacklist.txt
- files/*
- ts3server.sqlitedb
- *.ini
- tsdns/tsdns_settings.ini
Installation and Configuration
We’ll create a specific and unprivileged user account to run TeamSpeak3. You can call it what you like, but teamspeak
seems pretty reasonable. Make sure to note the password, even though we won’t need to log in often. Worst case you can just reset it with your privileged account.
|
|
Now we can switch over to the teamspeak
user, create a teamspeak3-server-current
directory (which will act as the operating TS3 directory), download, then extract TeamSpeak3. If you just copy and paste the below commands, you’ll get version 3.1.3 - It’s a good idea to get the latest stable version. Go to the TeamSpeak3 downloads page and check what the latest Linux Server 64-bit release is. You’ll need to copy the link as you’ll be downloading it with wget.
|
|
Now you’ll want to move your backed up files over, if you have any. Make sure the owner and group of the migrated files are set to teamspeak
, which would be sudo chown teamspeak:teamspeak /path/to/file
. Remember to change files within directories too.
TS3 License
You’ll probably need to accept the TeamSpeak3 license - if you’ve tried to run TeamSpeak3 without accepting the license, it won’t start up.
If you’ve migrated an existing server, you bypass accepting the license during the usual setup. We can notify TeamSpeak that we accept the license by creating a dot file and putting a variable in there.
|
|
With license_accepted=1
in it.
Now we’ll want to type and execute exit
to exit out of our teamspeak
user, and land back in our sudo enabled account.
Firewall
We need to open some ports on our firewall to allow connections through. I’ll be using Uncomplicated Firewall, and we’ll need root permissions. If you’re not using UFW, then you’ll need to find your commands to allow port/protocol 9987/udp
, 30033/tcp
, 10011/tcp
.
If you use TSDNS, you will also need to allow 41144/tcp.
|
|
TeamSpeak3 Service - Start on Boot
There’s two popular initialisation systems - the older systemV, and the newer systemd. These will allow you to create and manage the TeamSpeak3 service more easily, and also allow TeamSpeak3 to automatically start if your server reboots.
systemd
Systemd calls it’s configuration files “Unit Files”, and we’ll be creating our Unit File in the /etc/systemd/system/
directory.
|
|
Thanks to Schroeffu, who has a nice example and breakdown on a systemd Unit File for TeamSpeak3 which I’ve pilfered and modified ever so slightly.
|
|
Make sure our permissions are set correctly on our new file.
|
|
Then we’ll tell systemd that our shiny new Unit File is a thing and it should totally check it out because it’s pretty sweet, and then we’ll start the teamspeak service.
|
|
Now we can control the teamspeak service with the below commands.
|
|
systemV
SystemV calls it’s configuration files “Init Files”, and we’ll be creating our Init File in the /etc/init.d/
directory.
|
|
Our Init File will have the below contents.
|
|
Make sure our permissions are set correctly on our new file.
|
|
Now we’ll need to let the system know we’ve got a new service.
|
|
Now we can control the teamspeak service with the below commands.
|
|