TeamSpeak is a popular cross-platform voice chat software used by gamers, teams, and schools. It provides a lightweight and fast communication solution that offers more control as it can be hosted on your own server. In this tutorial, we will guide you through the process of installing the TeamSpeak server on a Debian 11 based server and connecting to it using a Windows client.
Prerequisites
Before we begin, make sure you have the following:
- A Debian 11 based server
- A non-root user with sudo privileges
- Sudo package installed
- System packages updated
To update your system packages, run the following command:
$ sudo apt update && sudo apt upgrade
Step 1 – Configure Firewall
The first step is to configure the firewall on your Debian server. Debian comes with ufw (Uncomplicated Firewall) which provides an easy way to manage firewall rules.
To check if the firewall is running, run the following command:
$ sudo ufw status
You should see the status as “inactive” which means the firewall is not enabled yet. We need to allow specific ports required by TeamSpeak.
Run the following commands to allow the necessary ports:
$ sudo ufw allow OpenSSH $ sudo ufw allow 9987/udp $ sudo ufw allow 30033/tcp $ sudo ufw allow 10011/tcp $ sudo ufw allow 10022/tcp $ sudo ufw allow 10080/tcp
Finally, enable the firewall:
$ sudo ufw enable
Step 2 – Download TeamSpeak
Now, let’s download the latest version of the TeamSpeak server. Visit theTeamSpeak’s download page and find the latest version number. At the time of writing this tutorial, the latest version is v3.13.6.
Run the following command to download the TeamSpeak server:
$ TVERSION=3.13.6 $ wget https://files.teamspeak-services.com/releases/server/${TVERSION}/teamspeak3-server_linux_amd64-${TVERSION}.tar.bz2
Once the download is complete, extract the downloaded archive:
$ tar -xf ./teamspeak3-server_linux_amd64-${TVERSION}.tar.bz2
Step 3 – Create TeamSpeak User and Directory
Next, we will create a dedicated user for running the TeamSpeak server. This provides better security and isolation.
Run the following command to create the user:
$ sudo adduser ts3 --home /opt/teamspeak --shell /bin/bash --disabled-password
Now, move the extracted TeamSpeak directory to the newly created user’s home directory:
$ sudo mv teamspeak3-server_linux_amd64/* /opt/teamspeak/
To ensure proper permissions, run the following command:
$ sudo chown -R ts3:ts3 /opt/teamspeak
Step 4 – Run TeamSpeak Server
Now, let’s start the TeamSpeak server and create a privilege key for administrative access.
Switch to the TeamSpeak user by running the following command:
$ sudo -u ts3 -i
To accept the TeamSpeak server license, create a file called .ts3server_license_accepted
in the TeamSpeak’s working directory:
$ touch.ts3server_license_accepted
Start the TeamSpeak server by running the following command:
$ ./ts3server_startscript.sh start
This will generate a privilege key and a server query administrator account. Make sure to note down the generated credentials as you will need them later.
To stop the server, press Ctrl + C
on your keyboard.
Exit the TeamSpeak user by running the following command:
$ exit
Step 5 – Creating TeamSpeak Service Daemon
To ensure that the TeamSpeak server starts automatically on system boot, we will create a systemd service.
Create the service file by running the following command:
$ sudo nano /lib/systemd/system/ts3server.service
Paste the following code into the file:
[Unit]
Description=TeamSpeak3 Server
Wants=network-online.target
After=syslog.target network.target local-fs.target
[Service]
WorkingDirectory=/opt/teamspeak
User=ts3
Group=ts3
Type=forking
ExecStart=/opt/teamspeak/ts3server_startscript.sh start license_accepted=1
ExecStop=/opt/teamspeak/ts3server_startscript.sh stop
ExecReload=/opt/teamspeak/ts3server_startscript.sh restart
Restart=always
RestartSec=15
[Install]
WantedBy=multi-user.target
Save and close the file by pressing Ctrl + X
, then Y
to confirm.
Reload the systemd daemon to make the changes take effect:
$ sudo systemctl daemon-reload
Enable the TeamSpeak service and start it:
$ sudo systemctl enable ts3server --now
Verify the status of the service:
$ sudo systemctl status ts3server
Step 6 – Connect using TeamSpeak Client
To connect to the TeamSpeak server, you will need to download and install the TeamSpeak 3 Client on your Windows computer.
Visit theofficial TeamSpeak website and download the Windows client.
Once the client is installed, launch it on your desktop. You will be prompted to accept the license agreement.
Click on the “Connections” menu and select “Connect”. Enter the IP address of your server, the privilege key generated in Step 4, and a nickname for yourself.
Click the “Connect” button to establish a connection to your TeamSpeak server.
Congratulations! You are now connected to your TeamSpeak server and can start using the client for communication.
Step 7 – Changing Access Password
If you wish to change the Server Administrator password for your TeamSpeak server, follow these steps:
Stop the TeamSpeak service:
$ sudo systemctl stop ts3server
Switch to the TeamSpeak user:
$ sudo -i -u ts3
Start the TeamSpeak server and specify the new password using the serveradmin_password
parameter:
$ ./ts3server_startscript.sh start serveradmin_password=new_password
Replace new_password
with a strong password of your choice.
Stop the server:
$ ./ts3server_startscript.sh stop
Switch back to your user account:
$ exit
Start the TeamSpeak service again:
$ sudo systemctl start ts3server
Step 8 – Installing and Configuring MySQL
By default, TeamSpeak uses the SQLite database for storing communication and user data. However, if you have a large number of users, it is recommended to use a more robust database solution like MySQL or PostgreSQL.
In this step, we will install and configure MySQL as the database for TeamSpeak.
Install MariaDB server, a drop-in replacement for MySQL, by running the following command:
$ sudo apt install mariadb-server -y
During the installation, the MariaDB service will be started automatically. You can verify its status by running:
$ sudo systemctl status mariadb
Next, run the security script to secure your MariaDB installation:
$ sudo mysql_secure_installation
Follow the on-screen prompts to set the root password and answer the security-related questions.
Log in to the MySQL shell as the root user:
$ sudo mysql
Create a new user for TeamSpeak and grant it access to a new database:
mysql> CREATE USER 'ts3user'@'localhost' IDENTIFIED BY 'password'; mysql> CREATE DATABASE teamspeak3; mysql> GRANT ALL PRIVILEGES ON teamspeak3.* TO 'ts3user'@'localhost'; mysql> FLUSH PRIVILEGES; mysql> EXIT;
Replace 'password'
with a strong password for the ts3user
.
Switch to the TeamSpeak user:
$ sudo -i -u ts3
Create a symbolic link for the MariaDB library:
$ ln -s /opt/teamspeak/redist/libmariadb.so.2 /opt/teamspeak/libmariadb.so.2
To determine the required shared libraries for TeamSpeak, run the following command:
$ ldd /opt/teamspeak3-server/libts3db_mariadb.so
Create a configuration file for the MariaDB database parameters:
$ nano ts3db_mariadb.ini
Paste the following code into the file:
[config] host=127.0.0.1 port=3306 username=ts3user password=password database=teamspeak3 socket=
Replace 'password'
with the password you set for the ts3user
.
Create a configuration file for TeamSpeak:
$ nano ts3server.ini
Paste the following code into the file:
machine_id=default voice_port=9987 voice_ip=0.0.0.0 licensepath= filetransfer_port=30033 filetransfer_ip=0.0.0.0 query_port=10011 query_ip=0.0.0.0 query_ip_whitelist=query_ip_whitelist.txt query_ip_blacklist=query_ip_blacklist.txt dbsqlpath=sql/ dbplugin=ts3db_mariadb dbsqlcreatepath=create_mariadb/ dbpluginparameter=ts3db_mariadb.ini dbconnections=10 logpath=logs/ logquerycommands=0 dbclientkeepdays=30 logappend=0 query_skipbruteforcecheck=0
Save and close the file.
Exit the TeamSpeak user:
$ exit
Open the TeamSpeak service file:
$ sudo nano /lib/systemd/system/ts3server.service
Find the line ExecStart=/opt/teamspeak/ts3server_startscript.sh start license_accepted=1
and modify it to include the configuration file details:
ExecStart=/opt/teamspeak/ts3server_startscript.sh start license_accepted=1 inifile=ts3server.ini
Save and close the file.
Reload the systemd daemon:
$ sudo systemctl daemon-reload
Enable and start the TeamSpeak service:
$ sudo systemctl enable ts3server --now
Verify the status of the server:
$ sudo systemctl status ts3server
Step 9 – Upgrading TeamSpeak
To upgrade your TeamSpeak server to a newer version, follow these steps:
Stop the TeamSpeak server:
$ sudo systemctl stop ts3server
Download the latest version from theofficial TeamSpeak website and extract the archive to the /opt/teamspeak
directory, overwriting the existing files.
Ensure the correct permissions:
$ sudo chown -R ts3:ts3 /opt/teamspeak
Start the TeamSpeak server:
$ sudo systemctl start ts3server
Congratulations! You have successfully installed and configured TeamSpeak Server on your Debian 11 based server. You can now connect to it using the TeamSpeak client and enjoy seamless voice communication.
If you have any questions or need further assistance, feel free to reach out to our support team at Shape.host. We provide reliable Linux SSD VPS hosting services to empower businesses with scalable and secure cloud hosting solutions.