How to Install Teamspeak 3 Server on CentOS 8
TeamSpeak is a cross-platform voice server or VOIP application for real-time voice chat over the internet. TeamSpeak is lightweight and uses a very low amount of bandwidth and capable of handling thousands of simultaneous users. It is commonly used for gaming, education, training and chat with friends and family. TeamSpeak is absolutely free of charge. You just need to download and set up your own server and use the clients as per your need.
In this tutorial, we will show you how to install and setup TeamSpeak server on CentOS 8 server.
Prerequisites
- A server running CentOS 8.
- A root password is configured on your server.
Getting Started
By default, SELinux is enabled in CentOS 8 server. So you will need to disable it first.
You can do this by editing /etc/selinux/config file:
nano /etc/selinux/config
Make the following changes:
SELINUX=disabled
Save and close the file. Then, restart your system to apply the changes.
Next, you will need to install some dependencies to your server. You can install all of them with the following command:
dnf install nano wget perl tar net-tools bzip2
Once all the dependencies are installed, you can proceed to the next step.
Install TeamSpeak
Before installing TeamSpeak, you will need to add a user for TeamSpeak. You can create it with the following command:
adduser teamspeak -d /opt/teamspeak
Next, Download the latest version of TeamSpeak with the following command:
wget http://dl.4players.de/ts/releases/3.8.0/teamspeak3-server_linux_amd64-3.8.0.tar.bz2
Once the download is completed, extract the downloaded file with the following command:
tar xvf teamspeak3-server_linux_amd64-3.8.0.tar.bz2
Next, move the content of extracted directory to the /opt/teamspeak:
mv teamspeak3-server_linux_amd64/* /opt/teamspeak/
Next, you will need to create a file named ".ts3server_license_accepted" in the /opt/teamspeak directory in order to accept the license agreement.
touch /opt/teamspeak/.ts3server_license_accepted
Next, change the ownership of the /opt/teamspeak directory to TeamSpeak user with the following command:
chown -R teamspeak: /opt/teamspeak
Create a Systemd File for TeamSpeak
Next, you will need to create a systemd service file to manage the TeamSpeak service. You can create it with the following command:
nano /lib/systemd/system/teamspeak.service
Add the following lines:
[Unit] Description=Team Speak 3 Server After=network.target [Service] WorkingDirectory=/opt/teamspeak/ User=teamspeak Group=teamspeak Type=forking ExecStart=/opt/teamspeak/ts3server_startscript.sh start inifile=ts3server.ini ExecStop=/opt/teamspeak/ts3server_startscript.sh stop PIDFile=/opt/teamspeak/ts3server.pid RestartSec=15 Restart=always [Install] WantedBy=multi-user.target
Save and close the file. Then, reload the systemd daemon with the following command:
systemctl --system daemon-reload
Next, start the TeamSpeak service and enable it to start after system reboot with the following command:
systemctl start teamspeak
systemctl enable teamspeak
You can now check the status of the TeamSpeak service with the following command:
systemctl status teamspeak
You should see the following output:
? teamspeak.service - Team Speak 3 Server Loaded: loaded (/usr/lib/systemd/system/teamspeak.service; disabled; vendor preset: disabled) Active: active (running) since Sun 2019-10-27 12:51:44 EDT; 5s ago Process: 1298 ExecStart=/opt/teamspeak/ts3server_startscript.sh start inifile=ts3server.ini (code=exited, status=0/SUCCESS) Main PID: 1305 (ts3server) Tasks: 12 (limit: 5060) Memory: 25.3M CGroup: /system.slice/teamspeak.service ??1305 ./ts3server inifile=ts3server.ini daemon=1 pid_file=ts3server.pid Oct 27 12:51:44 centos8 systemd[1]: Starting Team Speak 3 Server... Oct 27 12:51:44 centos8 ts3server_startscript.sh[1298]: Starting the TeamSpeak 3 server Oct 27 12:51:44 centos8 ts3server_startscript.sh[1298]: TeamSpeak 3 server started, for details please view the log file Oct 27 12:51:44 centos8 systemd[1]: Started Team Speak 3 Server.
Next, you will need to retrieve the privileged key. You will require it when connecting to the TeamSpeak server from a TeamSpeak Client. You can view it with the following command:
cat /opt/teamspeak/logs/*
You should get the following output:
2019-10-27 17:06:00.334499|INFO | | |Puzzle precompute time: 4434 2019-10-27 17:06:00.335662|INFO |FileManager | |listening on 0.0.0.0:30033, [::]:30033 2019-10-27 17:06:00.337563|INFO |VirtualSvrMgr | |executing monthly interval 2019-10-27 17:06:00.337837|INFO |VirtualSvrMgr | |reset virtualserver traffic statistics 2019-10-27 17:06:00.376549|INFO |Query | |listening for query on 0.0.0.0:10011, [::]:10011 2019-10-27 17:06:00.377080|INFO |Query | |listening for query ssh on 0.0.0.0:10022, [::]:10022 2019-10-27 17:06:00.377152|INFO |Query | |creating QUERY_SSH_RSA_HOST_KEY file: ssh_host_rsa_key 2019-10-27 17:06:06.649531|INFO |CIDRManager | |updated query_ip_whitelist ips: 127.0.0.1/32, ::1/128, 2019-10-27 17:06:00.374048|INFO |VirtualServer |1 |listening on 0.0.0.0:9987, [::]:9987 2019-10-27 17:06:00.375751|WARNING |VirtualServer |1 |-------------------------------------------------------- 2019-10-27 17:06:00.375818|WARNING |VirtualServer |1 |ServerAdmin privilege key created, please use the line below 2019-10-27 17:06:00.375857|WARNING |VirtualServer |1 |token=2y8a9yBz5aRlyDUwaBfgw8lq4FtQVT47pyAeU4Ja 2019-10-27 17:06:00.375894|WARNING |VirtualServer |1 |--------------------------------------------------------
Setup Firewall for TeamSpeak
TeamSpeak is now installed and running. Next, TeamSpeak listens on a port 9987 (UDP), 10011 (TCP) and 30033 (TCP). So you will need to allow these ports from firewalld. You can allow them with the following commands:
firewall-cmd --zone=public --add-port=9987/udp --permanent
firewall-cmd --zone=public --add-port=10011/tcp --permanent
firewall-cmd --zone=public --add-port=30033/tcp --permanent
firewall-cmd --reload
Conclusion
Congratulations! you have successfully installed and configured the TeamSpeak server on CentOS 8 server. You can now download the TeamSpeak client, connect to the TeamSpeak server and start chatting with friends and family.