How to install TeamSpeak server on Ubuntu 16

Try it in our public cloud & Get $5 Credit

How to install TeamSpeak server on Ubuntu 16

TeamSpeak is a voice over internet protocol (VoIP) software that allows users to communicate with each other over the internet. It is often used in computer gaming, but it is also used in business and for general communication between friends and family. This step-by-step article explains how to create and administrate a secure TeamSpeak server on your Ubuntu 16.04 LTS system.

Getting Started

Confirm that you have the following before you follow this guide:
• 1 Node (Cloud Server or Dedicated Server) running Ubuntu 16.
• Root access to the node or one sudo non-root user
• A TeamSpeak client on your platform of choice in order to test things out.
• The following utilities: nano, wget, tar, perl, bzip2 (in case you don’t have them, but they should be installed by default on Ubuntu)


Start by running these commands on your Ubuntu 16.04 server. These commands will automatically get the latest update for your server.

apt-get update && apt-get upgrade -y

Ubuntu should include the nano, wget, perl and bzip2 binaries, but if they aren’t included then you’ll need to install the necessary packages.

apt-get install nano wget tar perl bzip2

Teamspeak User Creation

First we will create a dedicated user that will be used to execute the TeamSpeak server software. This is important from a security standpoint; running daemon programs as root can be dangerous. Creating a new user will allow us to run TeamSpeak with limited privileges. This is done by executing the following command as root:

adduser --disabled-login teamspeak

You can leave the info fields empty and validate the information in the end by pressing Y or simply by pressing enter. It is required that you validate the information when creating the new user.

Now we will install the latest version of the TeamSpeak server software by executing the following command:

tar xvf teamspeak3-server_linux_amd64-
cd teamspeak3-server_linux_amd64
cp * -R /home/teamspeak
cd ..
rm -rf teamspeak3-server_linux_amd64*
chown -R teamspeak:teamspeak /home/teamspeak

Startup Script

By default, the TeamSpeak server will not start when your system boots. You will need to create a startup script so that your system will automatically start the TeamSpeak server software on boot. To do this, we will create the following file:

nano /lib/systemd/system/teamspeak.service

Copy the following content into the startup script file:

Description=Team Speak 3 Server

ExecStart=/home/teamspeak/ start inifile=ts3server.ini
ExecStop=/home/teamspeak/ stop


When you are done, save the file and exit the editor.

Now we will start the TeamSpeak server and enable it to start when your system boots:

systemctl --system daemon-reload
systemctl start teamspeak.service
systemctl enable teamspeak.service

You can check that your server is actually running with the following command:

systemctl status teamspeak.service

Firewall Rules Addition

If you are using Ubuntu’s firewall service (iptables), you may need to open ports to allow access to your TeamSpeak server. This can be done by executing the following command:

iptables -A INPUT -p udp --dport 9987 -j ACCEPT
iptables -A INPUT -p udp --sport 9987 -j ACCEPT
iptables -A INPUT -p tcp --dport 30033 -j ACCEPT
iptables -A INPUT -p tcp --sport 30033 -j ACCEPT
iptables -A INPUT -p tcp --dport 10011 -j ACCEPT
iptables -A INPUT -p tcp --sport 10011 -j ACCEPT

For your reference, these are the ports that are used by TeamSpeak:

9987 UDP : TeamSpeak Voice service
10011 TCP : TeamSpeak ServerQuery
30033 TCP : TeamSpeak FileTransfer

If you are using the iptables-services package, you can open these ports by adding this set of rules to your iptables file:

-A INPUT -p udp --dport 9987 -j ACCEPT
-A INPUT -p udp --sport 9987 -j ACCEPT
-A INPUT -p tcp --dport 30033 -j ACCEPT
-A INPUT -p tcp --sport 30033 -j ACCEPT
-A INPUT -p tcp --dport 10011 -j ACCEPT
-A INPUT -p tcp --sport 10011 -j ACCEPT

Administrate Your TeamSpeak Server

When you first connect to your TeamSpeak server using the client software, you will be prompted to enter a privilege key. Entering this key will give you administrative access to the server from the client software. Note that this key can only be used one time.

The privilege key has already been generated when the TeamSpeak server first started. To retrieve the key, run the following command:

cat /home/teamspeak/logs/ts3server_*

This command will return similar to the following:

2********* ********.520940|INFO |ServerLibPriv | |TeamSpeak 3 Server (2016-04-25 15:16:45)
2********* ********.521029|INFO |ServerLibPriv | |SystemInformation: Linux 4.4.0-22-generic #40-Ubuntu SMP Thu May 12 22:03:46 UTC 2016 x86_64 Binary: 64bit
2********* ********.521064|INFO |ServerLibPriv | |Using hardware aes
2********* ********.521891|INFO |DatabaseQuery | |dbPlugin name: SQLite3 plugin, Version 2, (c)TeamSpeak Systems GmbH
2********* ********.521935|INFO |DatabaseQuery | |dbPlugin version: 3.8.6
2********* ********.522295|INFO |DatabaseQuery | |checking database integrity (may take a while)
2********* ********.548703|INFO |SQL | |db_CreateTables() tables created
2********* ********.724410|WARNING |Accounting | |Unable to find valid license key, falling back to limited functionality
2********* ********.946351|INFO | | |Puzzle precompute time: 1193
2********* ********.947038|INFO |FileManager | |listening on
2********* ********.948636|INFO |VirtualSvrMgr | |executing monthly interval
2********* ********.948799|INFO |VirtualSvrMgr | |reset virtualserver traffic statistics
2********* ********.020816|INFO |CIDRManager | |updated query_ip_whitelist ips:,
2********* ********.021840|INFO |Query | |listening on
2********* ********.015755|INFO |VirtualServer |1 |listening on
2********* ********.016218|INFO |VirtualServer |1 |client 'server'(id:0) added privilege key for servergroup 'Server Admin'(id:6)
2********* ********.016251|WARNING |VirtualServer |1 |--------------------------------------------------------
2********* ********.016272|WARNING |VirtualServer |1 |ServerAdmin privilege key created, please use the line below
2********* ********.016290|WARNING |VirtualServer |1 |token=******************************************************
2********* ********.016318|WARNING |VirtualServer |1 |--------------------------------------------------------

What you are looking for here is the token. Copy and paste it into your TeamSpeak client. If everything is successful, you will get this message:

Privilege Key successfully used.

Your newly-connected user will then be granted full administrative rights over your TeamSpeak server.


You’ve now successfully installed and configured a TeamSpeak server on your Ubuntu 16.04 LTS system. You have also created a startup script for the server so that it is executed automatically when your system boots and configured your iptables firewall to allow external users to connect using TeamSpeak’s ports. You can now enjoy all of the features of your TeamSpeak server and start communicating with your friends and colleagues.

If you found this article helpful, feel free to share it with your friends and let us know in the comments below!

  • Alexandre Francois

    Hi, thank you very much for this tutorial, it works as expected.
    Just need to follow all the steps !

  • Fin

    Worked really well thanks man!

  • Pascal De Witte

    It does not works, i cannot access my server from my external IP.
    Internal, it works but from external i’ve: Failed to connect to server

    • ptalbot

      Hi Pascal,

      I think you may have a firewall issue. Try the command netstat:

      #netstat -anp | grep 10011

      If you can see the program is listening on*, this means that it’s listening on all interface, which can confirm that you may have a firewall issue.

      If it’s the case, you will need to open ports 9987 30033 10011.

      Hope this helps,

      • Pascal De Witte

        Hi, thanks for your answer, here is the result of the netstat:

        tcp 0 0* LISTEN 1160/ts3server
        tcp6 0 0 :::10011 :::* LISTEN 1160/ts3server

        I followed your tuto and i configured iptables, here is my config:

        Chain INPUT (policy ACCEPT)
        target prot opt source destination
        ACCEPT udp — anywhere anywhere udp dpt:9987
        ACCEPT udp — anywhere anywhere udp spt:9987
        ACCEPT tcp — anywhere anywhere tcp dpt:30033
        ACCEPT tcp — anywhere anywhere tcp spt:30033
        ACCEPT tcp — anywhere anywhere tcp dpt:10011
        ACCEPT tcp — anywhere anywhere tcp spt:10011

        Chain FORWARD (policy ACCEPT)
        target prot opt source destination

        Chain OUTPUT (policy ACCEPT)
        target prot opt source destination

        • ptalbot

          It seems that your Teamspeak server is running on port 1160 according to your netstat command. I would then recommend to open ports 1160 too:

          -A INPUT -p tcp –dport 1160 -j ACCEPT
          -A INPUT -p tcp –sport 1160 -j ACCEPT

          And then try to reconnect to it.

  • Thomas Stilling

    So getting this when running systemctl start teampspeak.service:

    Job for teamspeak.service failed because the control process exited with error code. See “systemctl status teamspeak.service” and “journalctl -xe” for details.

    journalctl output:

    — Unit teamspeak.service has begun starting up.
    mar 24 21:02:32 XXXXXXX systemd[2047]: teamspeak.service: Failed at step EXEC
    — Subject: Process /home/teamspeak/ could not be execut
    — Defined-By: systemd
    — Support:

    — The process /home/teamspeak/ could not be executed an

    — The error number returned by this process is 2.
    mar 24 21:02:32 XXXXXXX systemd[1]: teamspeak.service: Control process exited
    mar 24 21:02:32 XXXXXXX systemd[1]: Failed to start Team Speak 3 Server.
    — Subject: Unit teamspeak.service has failed
    — Defined-By: systemd
    — Support:

    — Unit teamspeak.service has failed.

    — The result is failed.
    mar 24 21:02:32 XXXXXXX[1]: teamspeak.service: Unit entered failed st
    mar 24 21:02:32 XXXXXXX[1]: teamspeak.service: Failed with result ‘ex
    mar 24 21:02:46 XXXXXXX sudo[2091]: XXXXXXX : TTY=pts/8 ; PWD=/home/XXXXXXX ;
    mar 24 21:02:46 XXXXXXX sudo[2091]: pam_unix(sudo:session): session opened fo
    lines 1691-1713/1713 (END)

    Any Ideas?

    • ptalbot

      Are your running this command as root user ? or are you using sudo ? This file might be restricted

      • Thomas Stilling

        Was running as sudo. Then I tried as root and it worked 🙂

        Pretty new to Linux, so I assumed sudo would grant the same access level as root 😉

  • Johan Wasserfall

    Hi There,

    Hardware: Raspberry Pi 2
    OS: 2017-04-10-raspbian-jessie

    I followed your instruction to the letter.

    When I run “systemctl start teamspeak.service”

    But I am still getting the following errors.

    pi@raspberrypi:~ $ sudo systemctl status teamspeak.service
    ● teamspeak.service – Team Speak 3 Server
    Loaded: loaded (/lib/systemd/system/teamspeak.service; enabled)
    Active: activating (auto-restart) (Result: resources) since Sun 2017-04-23 06:56:23 -02; 10s ago
    Process: 1984 ExecStart=/home/teamspeak/ start inifile=ts3server.ini (code=exited, status=0/SUCCESS)
    Main PID: 1088 (code=exited, status=2)

    Apr 23 06:56:23 raspberrypi systemd[1]: Failed to start Team Speak 3 Server.
    Apr 23 06:56:23 raspberrypi systemd[1]: Unit teamspeak.service entered failed state.


    Also when I get to “cat /home/teamspeak/logs/ts3server_*”

    cat: /home/teamspeak/logs/ts3server_*: No such file or directory

  • Jon Swift

    server admin token invalid