Post

Teamspeak 3 Installation

Teamspeak 3 server Installation on Linux

What’s needed?

  1. A Linux machine (VPS or Baremetal will work)
  2. Root on the machine

Configuration information

  1. All the commands that is showed in this guide is for Redhat.
  2. So if you use alma or Rocky you will be able to just follow the guide.
  3. I will be doing all commands from root and will not specify sudo on any commands so if you are not root use sudo infront of all commands.

Package needed

1
dnf install bzip2 firewalld

Lets start with firewall rules

  1. Time for enable and start firewalld
    • systemctl enable firewalld
    • systemctl start firewalld
  2. This port we need to open
    1
    2
    3
    4
    5
    
    firewall-cmd --add-port=9987/udp --permanent
    firewall-cmd --add-port=30033/tcp --permanent
    firewall-cmd --add-port=10022/tcp --permanent
    firewall-cmd --add-rich-rule 'rule family="ipv4" port port="10011" protocol=tcp source address="94.23.235.222/32" accept' --permanent
    firewall-cmd --reload
    

Description of the port

Port Protocol Description
9987 UDP This is the port for Teamspeak to work where the data of the voice goes
10011 TCP This is the port for query
10022 TCP This is the prot for encrypted query
30033 TCP This is used for file transfere.
  • I open 10011 to specefic host that because 94.23.235.222 is TSviewer.
  • I realy do not want any of our administraitor that need to login to the query to change settings to be able to use 10011 thats why i locked it down to tsviewer.

Teamspeak Installation

Now when the firewall is done and configured we can start to install Teamspeak

Lets set up the account that will be running teamspeak services

Lets add a system account called teamspeak

adduser --system --no-create-home --group teamspeak

Time to make a service configuration

Lets configure the Systemd Unit

vi /etc/systemd/system/teamspeak.service

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
echo '
[Unit]
Description=TeamSpeak3 Server
Wants=network-online.target
After=syslog.target network.target

[Service]
WorkingDirectory=/srv/teamspeak3-server_linux-amd64/
User=teamspeak
Type=forking
ExecStart=/srv/teamspeak3-server_linux-amd64/ts3server_startscript.sh start initfile=ts3server.ini
ExecStop=/srv/teamspeak3-server_linux-amd64/ts3server_startscript.sh stop
ExecReload=/srv/teamspeak3-server_linux-amd64/ts3server_startscript.sh restart
PIDFile=/srv/teamspeak3-server_linux-amd64/ts3server.pid
   
[Install]
WantedBy=multi-user.target ' > /etc/systemd/system/teamspeak.service
  • chmod 644 /etc/systemd/system/teamspeak.service

Now we got a account and a service file now we just missing the teamspeak installation

Download and installation of Teamspeak3 server

  • cd /srv
  • curl -O https://files.teamspeak-services.com/releases/server/3.13.7/teamspeak3-server_linux_amd64-3.13.7.tar.bz2
  • tar -xvjf teamspeak3-server_linux_amd64-3.13.7.tar.bz2
  • chown -R teamspeak:teamspeak teamspeak3-server_linux_amd64 Now we have downloaded, installed Teamspeak and set right permission we need to do a run to get the query password

First time run of the server

Before we can start we need to accept the licens

echo "license_accepted=1" > /srv/teamspeak3-server_linux_amd64/.ts3server_license_accepted

If you want to read the license before you accept it you can buy cat /srv/teamspeak3-server_linux_amd64/LICENSE

Now we can start the teamspeak server. sudo -U /srv/teamspeak3-server_linux_amd64/ts3server_startscript.sh start

After we started the server remeber to read and NOTE down the password and the amdin key.

it will look like this

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
------------------------------------------------------------------
                      I M P O R T A N T                           
------------------------------------------------------------------
               Server Query Admin Account created                 
         loginname= "serveradmin", password= "uDKHX4ok"
         apikey= "BAAFY3_89fq8XGsCJgYgGUfcvr4VqPOZqRaaTnn"
------------------------------------------------------------------


------------------------------------------------------------------
                      I M P O R T A N T                           
------------------------------------------------------------------
      ServerAdmin privilege key created, please use it to gain 
      serveradmin rights for your virtualserver. please
      also check the doc/privilegekey_guide.txt for details.

       token=zm2cg374UTENI2c3Q2nfeCAcqOAqcOI7Ye1kGqXg
------------------------------------------------------------------

Now we can connect to the teamspeak server and it ready to be used.

But first we need to stop the server.

sudo -U /srv/teamspeak3-server_linux_amd64/ts3server_startscript.sh stop

And do

  • systemctl enable teamspeak
  • systemctl start teamspeak

This will throw some errors because selinux doesent like us :D

Selinux configuration

The fix is very easy.

Lets fix this by

  1. mkdir /root/selinux-config/ && cd /root/selinux-config
  2. cat /var/log/audit/audit.log | audit2allow -M teamspeak
  3. we can check so it not allowing to much by cat teamspeak.te
  4. semodule -i teamspeak.pp
  5. systemctl start teamspeak

Now you should have a running Teamspeak server.

  • systemctl start teamspeak
This post is licensed under CC BY 4.0 by the author.