EN

Game servers

How to Create a TeamSpeak Server

Complete guide to install a TeamSpeak voice server on a VPS or dedicated Linux server: license, administration key, ports, systemd service, updates, backup and troubleshooting.

8 min read, updated on 18 November 2026

On this page

Your values

Enter them once and the commands in this guide update.

This guide explains how to install a TeamSpeak voice server on your VPS or dedicated Linux server, with a dedicated user and a systemd service, then retrieve your administration key and keep the server up to date.

Order a Server

TeamSpeak uses very few resources. HostMyServers offers several suitable options:

Prerequisites

  • SSH access as root or user with sudo privileges
  • 64-bit Linux system: Debian 12/13 or Ubuntu 22.04/24.04
  • Active firewall: nftables (recommended), iptables or ufw (use only one firewall tool at a time)
  • Ports 9987 UDP and 30033 TCP accessible
  • The TeamSpeak client on each user's computer

Required Configuration

TeamSpeak does not publish a numerical minimum configuration. The following values are a rough estimate for a 32-slot server:

Component Recommended
RAM 512 MB available
CPU 1 core
Storage 2 GB, plus the space for files shared by users
Network Stable connection, latency matters more than bandwidth

Choosing Your License

Without a license file, the server runs for free with one virtual server and 32 slots, for non-commercial use. Beyond that, or for commercial use, you need a license.

License Limits stated in the TeamSpeak agreement Usage
No license 1 virtual server, 32 slots Individuals and non-commercial groups
Non-Profit (NPL) 2 virtual servers, 512 slots, 6-month term Non-commercial groups
Annual Activation (AAL) From 1 server and 32 slots to 2 servers and 1024 slots, 1-year term Paid license

Offers and their availability change: check them on the TeamSpeak sales site. The full agreement is in the LICENSE file provided with the server.

System Update

Terminal
sudo apt update && sudo apt upgrade -y

Installing Dependencies

Terminal
sudo apt install -y ca-certificates curl tar bzip2 jq less cron

Creating a Dedicated User

The server must never run as root. Create a dedicated user:

Terminal
sudo adduser --disabled-password --gecos "" teamspeak

Ports Used

Port Protocol Usage Exposure
9987 UDP Voice Public, required
30033 TCP File transfer Public, required
10022 TCP ServerQuery over SSH Local in this guide
10011 TCP Unencrypted ServerQuery Disabled in this guide
10080 TCP WebQuery over HTTP Disabled by default
41144 TCP TSDNS, optional Not used in this guide

The server must also be able to reach TeamSpeak's services outbound, notably accounting2.teamspeak.com on TCP port 443. Do not block this traffic.

Firewall Configuration

With UFW

Terminal
sudo ufw allow 9987/udp
sudo ufw allow 30033/tcp
sudo ufw reload

With iptables

Terminal
sudo iptables -A INPUT -p udp --dport 9987 -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 30033 -j ACCEPT
sudo iptables-save | sudo tee /etc/iptables/rules.v4

Saving the rules across reboots requires the iptables-persistent package.

With nftables

These commands use the inet filter table and the input chain, present by default in /etc/nftables.conf on Debian.

Terminal
sudo nft add rule inet filter input udp dport 9987 accept
sudo nft add rule inet filter input tcp dport 30033 accept
(echo "flush ruleset"; sudo nft list ruleset) | sudo tee /etc/nftables.conf

Installing the Server

Log in as the teamspeak user. The following commands fetch the latest version published by TeamSpeak, check its SHA-256 checksum, then extract the archive:

Terminal
sudo -iu teamspeak
mkdir -p ~/teamspeak ~/backups
chmod 700 ~/backups
INFO=$(curl -fsSL https://www.teamspeak.com/versions/server.json)
URL=$(echo "$INFO" | jq -r '.linux.x86_64.mirrors["teamspeak.com"]')
SUM=$(echo "$INFO" | jq -r '.linux.x86_64.checksum')
echo "$URL"
curl -fL -o ~/ts3.tar.bz2 "$URL"
echo "$SUM  $HOME/ts3.tar.bz2" | sha256sum -c - && tar -xjf ~/ts3.tar.bz2 --strip-components=1 -C ~/teamspeak
rm ~/ts3.tar.bz2

The check must display OK. Otherwise, the archive is not extracted: run these commands again to download it anew.

Accepting the License

The server refuses to start until you have accepted its license. Read it (press q to quit):

Terminal
less ~/teamspeak/LICENSE

If you accept it, create the file provided for that purpose:

Terminal
touch ~/teamspeak/.ts3server_license_accepted

Server Configuration

By default, the ServerQuery administration interface listens on all addresses, including in clear text on port 10011. Restrict it to the SSH protocol and the local machine:

Terminal
nano ~/teamspeak/ts3server.ini
Configuration
query_protocols=ssh
query_ssh_ip=127.0.0.1
query_ssh_port=10022
Parameter Description
query_protocols Active ServerQuery protocols: raw, ssh and http
query_ssh_ip ServerQuery over SSH listening address
query_ssh_port ServerQuery over SSH port

Then exit the teamspeak user's session:

Terminal
exit

Installing a License File (optional)

If you obtained a license, copy the licensekey.dat file to /home/teamspeak/teamspeak/, then protect it:

Terminal
sudo chown teamspeak:teamspeak /home/teamspeak/teamspeak/licensekey.dat
sudo chmod 600 /home/teamspeak/teamspeak/licensekey.dat

Restart the server if it is already running.

Configuration as systemd Service

Create Service File

Terminal
sudo nano /etc/systemd/system/teamspeak.service

File content:

Configuration
[Unit]
Description=TeamSpeak 3 Server
Wants=network-online.target
After=network-online.target

[Service]
Type=simple
User=teamspeak
Group=teamspeak
WorkingDirectory=/home/teamspeak/teamspeak
ExecStart=/home/teamspeak/teamspeak/ts3server_minimal_runscript.sh inifile=ts3server.ini
Restart=on-failure
RestartSec=15
LimitNOFILE=100000

[Install]
WantedBy=multi-user.target

Enable and Start Service

Terminal
sudo systemctl daemon-reload
sudo systemctl enable teamspeak.service
sudo systemctl start teamspeak.service

Management Commands

Terminal
# Check status
sudo systemctl status teamspeak.service

# Stop server
sudo systemctl stop teamspeak.service

# Restart server
sudo systemctl restart teamspeak.service

# View logs
sudo journalctl -u teamspeak.service -f

Retrieving the Administration Key

On the very first startup, the server generates the password for the serveradmin account and a privilege key (token):

Terminal
sudo journalctl -u teamspeak.service --no-pager | grep -E 'loginname=|apikey=|token='
Item Purpose
token Single-use key to obtain Server Admin rights in the client
loginname and password ServerQuery login
apikey WebQuery access, if you enable it

Connecting to the Server

  1. Install the TeamSpeak client and launch it.
  2. Connect to the address SERVER_IP (port 9987 by default).
  3. On first connection, the client asks for a privilege key: paste the token. If the window does not appear, look for Use Privilege Key in the Permissions or Tools menu, depending on your client.

You then belong to the Server Admin group and can configure the server, its channels and its permissions from the client.

Administration with ServerQuery

From the server, log in with the serveradmin password:

Terminal
ssh -p 10022 serveradmin@127.0.0.1
Command Description
help Lists the commands
use sid=1 Selects the first virtual server
serverinfo Shows the virtual server information
clientlist Lists connected clients
servergrouplist Lists the groups and their IDs
tokenadd tokentype=0 tokenid1=<group> tokenid2=0 Creates a privilege key for a server group
quit Closes the session

Creating a New Administration Key

If the key has been used or lost, find the Server Admin group with servergrouplist. Use its sgid, here 6 as an example:

Text
use sid=1
servergrouplist
tokenadd tokentype=0 tokenid1=6 tokenid2=0

Administering Remotely

Preferably use an SSH tunnel from your computer, without opening any additional port:

Terminal
ssh -L 10022:127.0.0.1:10022 YOUR_USER@SERVER_IP

Then connect your ServerQuery tool to 127.0.0.1:10022.

If you really must expose ServerQuery, replace query_ssh_ip=127.0.0.1 with query_ssh_ip=0.0.0.0 in ts3server.ini, restart the service, and restrict the port to your fixed IP address:

Terminal
# UFW
sudo ufw allow from YOUR_IP to any port 10022 proto tcp

# iptables
sudo iptables -A INPUT -p tcp -s YOUR_IP --dport 10022 -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 10022 -j DROP

# nftables
sudo nft add rule inet filter input ip saddr YOUR_IP tcp dport 10022 accept
sudo nft add rule inet filter input tcp dport 10022 drop

Server Update

Install updates promptly: versions 3.13.8 and 3.13.9 fix security flaws, including a server crash that can be triggered remotely without authentication. Your data is kept, but make a backup first: create the script described in the “Automatic Backup” section beforehand.

Terminal
sudo /usr/local/sbin/teamspeak-backup.sh
sudo systemctl stop teamspeak.service
sudo -iu teamspeak
INFO=$(curl -fsSL https://www.teamspeak.com/versions/server.json)
URL=$(echo "$INFO" | jq -r '.linux.x86_64.mirrors["teamspeak.com"]')
SUM=$(echo "$INFO" | jq -r '.linux.x86_64.checksum')
curl -fL -o ~/ts3.tar.bz2 "$URL"
echo "$SUM  $HOME/ts3.tar.bz2" | sha256sum -c - && tar -xjf ~/ts3.tar.bz2 --strip-components=1 -C ~/teamspeak
rm ~/ts3.tar.bz2
exit
sudo systemctl start teamspeak.service
sudo journalctl -u teamspeak.service -n 30 --no-pager

The installed version appears at the beginning of the logs, on the TeamSpeak 3 Server line.

Automatic Backup

The script briefly stops the server to get a consistent copy of the database, then restarts it.

Backup Script

Terminal
sudo nano /usr/local/sbin/teamspeak-backup.sh
Terminal
#!/bin/bash
SERVER_DIR="/home/teamspeak/teamspeak"
BACKUP_DIR="/home/teamspeak/backups"
DATE=$(date +%Y-%m-%d_%H-%M-%S)
ARCHIVE="$BACKUP_DIR/teamspeak_$DATE.tar.gz"

# Items to keep, if they exist
ITEMS=()
for ITEM in ts3server.sqlitedb ts3server.sqlitedb-wal ts3server.sqlitedb-shm ts3server.ini \
    .ts3server_license_accepted licensekey.dat ssh_host_rsa_key query_ip_allowlist.txt \
    query_ip_denylist.txt files; do
    [ -e "$SERVER_DIR/$ITEM" ] && ITEMS+=("$ITEM")
done

install -d -m 700 -o teamspeak -g teamspeak "$BACKUP_DIR"

systemctl stop teamspeak.service
tar -czf "$ARCHIVE" -C "$SERVER_DIR" "${ITEMS[@]}"
RESULT=$?
systemctl start teamspeak.service

chown teamspeak:teamspeak "$ARCHIVE"
chmod 600 "$ARCHIVE"

# Delete backups older than 7 days
find "$BACKUP_DIR" -name "teamspeak_*.tar.gz" -mtime +7 -delete

exit $RESULT
Terminal
sudo chmod 700 /usr/local/sbin/teamspeak-backup.sh

Schedule Backup

Terminal
sudo crontab -e

Add:

Text
# Backup every day at 5 am
0 5 * * * /usr/local/sbin/teamspeak-backup.sh

Restoring a Backup

Replace the file name with that of your backup:

Terminal
sudo systemctl stop teamspeak.service
sudo -u teamspeak tar -xzf /home/teamspeak/backups/teamspeak_2026-01-01_05-00-00.tar.gz -C /home/teamspeak/teamspeak
sudo systemctl start teamspeak.service

Regularly copy these archives off the server: they contain the database and your license, if any.

Troubleshooting

The server asks you to accept the license

The message Please set the environment variable TS3SERVER_LICENSE to "accept" means the acceptance file is missing:

Terminal
sudo -u teamspeak touch /home/teamspeak/teamspeak/.ts3server_license_accepted
sudo systemctl restart teamspeak.service

instance check error Error

Without a license, the server checks that no other instance is running, using /dev/shm.

  • Look for another instance: pgrep -a ts3server
  • Check that /dev/shm is mounted: df -h /dev/shm

If it is not, mount it then add the line tmpfs /dev/shm tmpfs defaults 0 0 to /etc/fstab:

Terminal
sudo mount -t tmpfs tmpfs /dev/shm

Clients can't connect

  • Check that port 9987 is open on UDP: sudo ufw status
  • Check that the server is listening: sudo ss -ulnp | grep 9987
  • Check that the service is running: sudo systemctl status teamspeak.service

File transfers or avatars fail

TCP port 30033 is probably blocked. Check the firewall and that the server is listening:

Terminal
sudo ss -ltnp | grep 30033

Lost serveradmin password

Stop the service, then run the server once by hand with a new password:

Terminal
sudo systemctl stop teamspeak.service
sudo -iu teamspeak
cd ~/teamspeak
./ts3server_minimal_runscript.sh inifile=ts3server.ini serveradmin_password=NewPassword

Once the server has started, stop it with Ctrl+C, type exit, then restart the service:

Terminal
sudo systemctl start teamspeak.service

This password may remain visible in the shell history: change it afterwards or clear that history.

ServerQuery connection refused or banned

After several failures, ServerQuery temporarily blocks the address concerned. Wait a few minutes and check your password. To exempt a trusted address, add it to query_ip_allowlist.txt, then restart the service.

unable to connect to accounting server Error

The server cannot reach TeamSpeak's licensing services. Check the machine's DNS and outbound traffic:

Terminal
curl -I https://accounting2.teamspeak.com

The HTTP code returned does not matter: what counts is getting a response.

The system locale is set to "C" Warning

This message is harmless. It indicates that the service is running without a defined language. You can ignore it.