How to install and configure TeamSpeak3 Server- Linux – Debian – Ubuntu

How to install and configure TeamSpeak3 Server- Linux – Debian – Ubuntu


Create user dedicated for TeamSpeak3 server.

Home directory for TeamSpeak3 user – /opt.

sudo useradd -d /opt/teamspeak3-server -m teamspeak3-user

Install TeamSpeak3 server for Linux 64bit.

Download TeamSpeak3 server, unpack to home directory, and change file permission of our user home directory.

sudo wget
sudo tar -jxvf teamspeak3-server_linux_amd64-3.0.12.tar.bz2
sudo mkdir /opt/teamspeak3-server
sudo mv teamspeak3-server_linux_amd64/* /opt/teamspeak3-server
sudo chown teamspeak3-user:teamspeak3-user /opt/teamspeak3-server -R
sudo rm -fr teamspeak3-server_linux_amd64-3.0.12.tar.bz2 teamspeak3-server_linux_amd64


Install TeamSpeak3 server for Linux 32bit.

Download TeamSpeak3 server, unpack to home directory, and change file permission of user home directory.

sudo wget
sudo tar -jxvf teamspeak3-server_linux_x86-3.0.12.tar.bz2
sudo mkdir /opt/teamspeak3-server
sudo mv teamspeak3-server_linux_x86/* /opt/teamspeak3-server
sudo chown teamspeak3-user:teamspeak3-user /opt/teamspeak3-server -R
sudo rm -fr teamspeak3-server_linux_x86-3.0.12.tar.bz2 teamspeak3-server_linux-x86


Firewall configuration – iptables.

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


DNS server configuration – Bind9.

Add to your domain 2 records.
Change to your own domain name. 86400 IN SRV 0 5 9987 86400 IN SRV 0 5 41144


Teststing DNS server.

sudo nslookup -type=SRV


sudo nslookup -q=SRV


Address:        service = 0 5 9987


Configure database MySQL – MariaDB.

Create database teamspeak3 and user teamspeak3 for TeamSpeak3 server.
Change database PASSWORD to your own password.

sudo mysql -u root -p
create database teamspeak3;
GRANT ALL PRIVILEGES ON teamspeak3.* TO teamspeak3@localhost IDENTIFIED BY 'PASSWORD';
flush privileges;


Symlink library from /redist folder to TeamSpeak3 server directory.

sudo ln -s /opt/teamspeak3-server/redist/ /opt/teamspeak3-server/


Run ldd to prints the shared libraries required by TeamSpeak3 server.

sudo ldd /opt/teamspeak3-server/


Create configfiles for TeamSpeak3 server.

The configfiles can be created automatically by script:
./ with option createinifile=1.
This method allows running the server with a SQL database.

We are going to configure TeamSpeak3 server with the MySQL-MariaDB database,
We have to manually create configfiles:

  • query_ip_blacklist.txt
  • query_ip_whitelist.txt
  • ts3server.ini
  • ts3db_mariadb.ini

Create blacklist configfile.

sudo touch /opt/teamspeak3-server/query_ip_blacklist.txt


Create whitelist configfile.

sudo cat  << EOT > /opt/teamspeak3-server/query_ip_whitelist.txt


Create configfile with MySQL-MariaDB database option.

sudo cat << EOT > /opt/teamspeak3-server/ts3server.ini


Create configfile for database for TeamSpeak3 server.
Change PASSWORD for database of TeamSpeak3, use the same password you have created configuring MySQL database.

sudo cat << EOT > /opt/teamspeak3-server/ts3db_mariadb.ini


Change permissions for new configfiles.

sudo chown teamspeak3-user:teamspeak3-user /opt/teamspeak3-server -R


Create ts3 init script of TeamSpeak3 server (autostart).

sudo nano /etc/init.d/ts3
#! /bin/sh
# Provides:          ts3
# Required-Start:    $network mysql
# Required-Stop:     $network
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: TeamSpeak3 Server Daemon
# Description:       Starts/Stops/Restarts the TeamSpeak Server Daemon

set -e

DESC="TeamSpeak3 Server"

# Gracefully exit if the package has been removed.
test -x $DAEMON || exit 0

sleep 2


Change permission for ts3, and scripts.

sudo chmod a+x /etc/init.d/ts3
sudo chmod a+x /opt/teamspeak3-server/
sudo chmod a+x /opt/teamspeak3-server/
sudo update-rc.d ts3 defaults


First run of TeamSpeak3 server with MySQL – MAriaDB database.

Remember login – “serveradmin”,  password and token key.

sudo /etc/init.d/ts3 start
                      I M P O R T A N T
               Server Query Admin Account created
         loginname= "serveradmin", password= "jFB2A0Kg"

                      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.



Commands for ts3 script:

sudo /etc/init.d/ts3 {start|stop|restart|status}
Usage: ./ {start|stop|restart|status}



Test listening of TeamSpeak3 server.

sudo netstat -lnp | grep ts3
tcp    0      0*      LISTEN      21779/ts3server_lin
tcp    0      0*      LISTEN      21779/ts3server_lin
udp    0      0*                  21779/ts3server_lin


Download, install and configure TeamSpeak3 client.

Download TeamSpeak3 client from link below:


Run and configure TeamSpeak3 client.

Select Connections then select Connect.
Fill the boxes:

  • Server Address: (your own domain name or IP address),
  • Nickname: serveradmin,
  • Server Password: password generated by TeamSpeak3 server when you run the server firs time.


Select Connect

Now enter the token key and select OK.

From now you can fully manage your own TeamSpeak3 server.


Skip to comment form

    • Dan on 4 March 2015 at 03:43
    • Reply

    I tried your auto start script method, and I feel like I’m missing something as I can’t seem to change the default port in the /opt/teamspeak3-server/ts3server.ini file, whenever I reboot the server it changes to the default port.

    1. The init script is a simple Starts/Stops/Restarts the TeamSpeak Server Daemon.
      If your configfile is overwritten after reboot then change the permission to read only:

      sudo chattr +i /opt/teamspeak3-server/ts3server.ini

      to remove permission:

      sudo chattr -i /opt/teamspeak3-server/ts3server.ini

    • Aaron on 23 August 2015 at 16:43
    • Reply

    Thank you. It works perfectly on my Linux VPS.

    • Karppi on 22 October 2015 at 09:01
    • Reply

    When trying to start the server for the first time, it gives me this error:

    /etc/init.d/ts3: 28: /etc/init.d/ts3: sudo: not found

    Any idea what I’m doing noobily wrong?

    1. Install and configure sudo or use root account to configure and run script:
      password: root_password
      nano /etc/init.d/ts3
      /etc/init.d/ts3: star stop...

    • demontraven on 13 November 2015 at 13:03
    • Reply


    I get the following error when trying to start TS server through script:
    2015-11-13 12:56:02.194334|ERROR |DatabaseQuery | | mysql_real_connect() failed with error: Access denied for user ‘teamspeak3’@’localhost’ (using password: YES)
    2015-11-13 12:56:02.194533|CRITICAL|ServerLibPriv | | Server() unable to initialize database

    Output from ldd also seemed strange as it couldn’t find => (0x00006d7787515000) => not found => /lib/x86_64-linux-gnu/ (0x00006d7786f0d000) => /lib/x86_64-linux-gnu/ (0x00006d7786b47000)
    /lib64/ (0x00006d7787516000)

    Do you have any tips to resolve this?

    1. Username or password for teamspeak3 database must be wrong.
      don’t bother about this thing for now: => not found

    • Muzak on 9 December 2015 at 19:42
    • Reply

    I followed every step of your guide but when i start the server it gives me this output:

    Starting Teamspeak 3 server
    TeamSpeak 3 server started, for details please view the log file
    root@vps:/opt/teamspeak3-server# 2015-12-09 19:35:00.193009|CRITICAL|ServerLibPriv | | Server() unable to initialize database

    can you help me please?

    1. did you create database (unable to initialize database)?

    • Mike Edwards on 24 January 2016 at 21:14
    • Reply

    I’ve done all of the above and have created the init script and “sudo /etc/init.d/ts3 start” comes back as
    “Starting the Teamspeak 3 server”
    “Teamspeak 3 server started ….”
    But when I connect through my client I get “Failed to connect to server”

    Strangely when I run “./” manually I can connect to the server and use it normally albeit when “sudo /etc/init.d/ts3” start hasn’t already been ran or is stopped.

    Any ideas?

    1. check logs: /opt/teamspeak3-server/logs

    • Mia E on 2 March 2016 at 04:04
    • Reply

    Hi im getting an error when entering sudo chown for the install saying:

    chown: invalid user: ‘ teamspeak3-user:teamspeak3-user’

    I’m very new to this sort of thing and could definitely use some help!


    1. You didn’t/forgot create user: teamspeak3-user

    • Nico on 14 August 2018 at 16:26
    • Reply

    Hey i got the following error message :
    2018-08-14 15:14:07.968022|INFO |ServerLibPriv | |TeamSpeak 3 Server 3.3.0 (2018-07-31 16:10:01)
    2018-08-14 15:14:07.968120|INFO |ServerLibPriv | |SystemInformation: Linux 4.15.0-23-generic #25-Ubuntu SMP Wed May 23 18:02:16 UTC 2018 x86_64 Binary: 64bit
    2018-08-14 15:14:07.968140|INFO |ServerLibPriv | |Using hardware aes
    2018-08-14 15:14:07.968855|INFO |DatabaseQuery | |dbPlugin name: MariaDB plugin, version 3, (c)TeamSpeak Systems GmbH
    2018-08-14 15:14:07.968881|INFO |DatabaseQuery | |dbPlugin version: 2
    2018-08-14 15:14:07.985757|WARNING |Accounting | |Unable to open licensekey.dat, falling back to limited functionality
    2018-08-14 15:14:07.985935|INFO |Accounting | |Licensing Information
    2018-08-14 15:14:07.985957|INFO |Accounting | |licensed to : Anonymous
    2018-08-14 15:14:07.985968|INFO |Accounting | |type : No License
    2018-08-14 15:14:07.985984|INFO |Accounting | |starting date : Sun Jul 1 00:00:00 2018
    2018-08-14 15:14:07.985995|INFO |Accounting | |ending date : Wed Jul 31 00:00:00 2019
    2018-08-14 15:14:07.986004|INFO |Accounting | |max virtualservers: 1
    2018-08-14 15:14:07.986012|INFO |Accounting | |max slots : 32
    2018-08-14 15:14:08.035889|INFO | | |myTeamSpeak identifier revocation list was downloaded successfully – all related features are activated
    2018-08-14 15:14:08.486296|ERROR |Accounting | |failed to register local accounting service
    2018-08-14 15:14:08.727865|INFO | | |Puzzle precompute time: 718
    2018-08-14 15:14:08.728223|INFO |FileManager | |listening on
    2018-08-14 15:14:08.740516|INFO |Query | |listening for query on
    2018-08-14 15:14:08.740585|INFO |CIDRManager | |updated query_ip_whitelist ips:,

    “2018-08-14 15:14:08.486296|ERROR |Accounting | |failed to register local accounting service”

    Any Ideas ?

    • Me on 23 August 2019 at 08:37
    • Reply

    Hey there! Everthing is working well, but I would like to know where o how do I config DNS server configuration – Bind9, where do I have to paste the line? I just installed bind with this command:
    $ sudo apt-get install bind9 bind9utils bind9-doc –yes
    but don’t know where to paste the line.

    1. You have to have domain name (buy it), then 2 dns servers (1 master and 1 slave), then configure dns and add line to your domain name config file or ignore dns and use ip address instead.

Leave a Reply

Your e-mail address will not be published.