Setup Teamspeak Server Ubuntu 15.04

October 17, 2015 119.4k views
Ubuntu Getting Started MariaDB Applications Deployment

Someone asked me to write a tutorial about how to setup a teamspeak server on Ubuntu 15.04. If you got any problems after using this tutorial, please make a comment. I made this tutorial in a way I think is the best, if you got any improvements or want to use something else please tell me.


  • A droplet with Ubuntu 15.04
  • An SSH client / SFTP client

What we will do

  • Install MariaDB
  • Install Teamspeak
  • Configure Teamspeak
  • Create an autostart script

Install MariaDB
MariaDB is a replacement for MySQL with a better performance. The database will hold all users/settings etc. of the Teamspeak server instead of SQLlite.
Inside your droplet use the following command:

sudo apt-get install mariadb-client mariadb-server

Once the install process is finished, you have to firstly setup your MariaDB install with new root password (default is blank). Issue this command:

Enter current password for root (enter for none): Enter
Set root password? [Y/n]  Y
Remove anonymous users? [Y/n]  y
Disallow root login remotely? [Y/n] Depends on what you want
Remove test database and access to it? [Y/n]   y
Reload privilege tables now? [Y/n]   y

Now the MariaDB service should be running with a new root password.

Lets configure the database now. We will create a new user and database for the Teamspeak server. Create the database with your own password:

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

Install Teamspeak
First we will create a new user with its own directory in /opt/. Then we will download the latest teamspeak server and unpack it.

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

Now download, extract, move and change permissions of the teamspeak server files:

sudo wget
sudo tar -zxvf teamspeak3-server_linux-amd64-
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- teamspeak3-server_linux-amd64

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/

If ==> not found shows, use the following command:

sudo apt-get install libmariadb2

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

  • queryipblacklist.txt
  • queryipwhitelist.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 nano /opt/teamspeak3-server/ts3server.ini

With the following inside of it:


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

sudo nano /opt/teamspeak3-server/ts3db_mariadb.ini



Now you need to change permissions of the new config files:
sudo chown teamspeak3-user:teamspeak3-user /opt/teamspeak3-server -R
Now the configuration is done.

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

Now change permissions for the 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

Now everything should be done, and ready to go. Lets start the Teamspeak3 server for the first time:
sudo /etc/init.d/ts3 start
You will first see the serveradmin password and token key. Make sure you save the serveradmin password somewhere save. With this you can query inside your teamspeak server. For the token key, you can also look in the logs:


Hit enter, and its all running.

Hope this worked for you. Please do not comment or answer if it has got nothing to do with this.

  • nice tutorial :) quick and efficient, I can confirm this works fine on debian jessie

  • unable to init database, doesn’t work if i copy paste everything running ubuntu 15.04

    Edit: Never mind, i’m an idiot. Forgot to change password to my own in this command: GRANT ALL PRIVILEGES ON teamspeak3.* TO teamspeak3@localhost IDENTIFIED BY ‘PASSWORD’;

  • @schinsue No problem, these things can happen. If you just copy past everything without reading (like I sometimes do as well) you don’t see things like that. Good you got it working!

  • Hey there. Awesome tutorial.
    Uhm… when I try to install libmariadb2 on 64-bit Ubuntu 14.04 (trusty), I can’t find the package.

    When I run this, as per the instructions....

    If ==> not found shows, use the following command:
         sudo apt-get install libmariadb2

    I get this:

    Unable to locate package libmariadb2

    Everything else worked fine except for this.

  • @TrevorLaneRay Hello, thank you for the compliment. Yes this package isn’t included in the trusty version yet, please use the following command and then follow the tutorial again:

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

    If you got any more questions don’t hesistate to ask them.

  • Show 21 more comments
19 Answers

Honestly the first guide that has worked flawlessly for me in a year. Thanks for the detail and good instructions!

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

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

This tutorial works on Ubuntu 14.04 ?

  • Yes, as you can see the comment of TrevorLaneRay above it all works. You only need to change one command.

    sudo apt-get install libmariadb2


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

This worked for my machine, but what if I want to create more than 1 teamspeak from one Instance(Server). I already checked to log in with the port 3306, but I didn’t work.

  • Good to hear, I am sorry for the late reply.

    If you like to have multiple virtual teamspeak servers you would need a license from Teamspeak. You can find more information about which license fits you on their website

quick question.... i followed everything you said and got to the end… after having to add lines to the sources for the libmariadb2 installation… but when i start the service i get this:::

Starting the TeamSpeak 3 server
TeamSpeak 3 server started, for details please view the log file
root@ArkabLegions:~# 2016-03-19 17:44:06.674268|CRITICAL|ServerLibPriv | | Server() unable to initialize database

Is the server running?

  • What does your teamspeak log tells you? This gives usefull information most of the time.
    Do you have the mariadb server running?
    Wich OS are you using?

    • I used Ubuntu 14.04, i dont’ know how to get to the log. i am sort of new at this. i don’t know if the mariadb server is running. i followed the setup instructions word for word… and you have to add in the source for the mariadb2 which i already did… and i updated and upgraded all through apt-get… so i am just confused…

      I just found the log… here is what it says::

      2016-03-19 21:18:07.102172|INFO |ServerLibPriv | | TeamSpeak 3 Server (2015-08-18 13:30:34)
      2016-03-19 21:18:07.102642|INFO |ServerLibPriv | | SystemInformation: Linux 3.13.0-79-generic #123-Ubuntu SMP F$
      2016-03-19 21:18:07.102697|INFO |ServerLibPriv | | Using hardware aes
      2016-03-19 21:18:07.105581|INFO |DatabaseQuery | | dbPlugin name: MariaDB plugin, ©TeamSpeak Systems GmbH
      2016-03-19 21:18:07.105639|INFO |DatabaseQuery | | dbPlugin version: 1
      2016-03-19 21:18:07.107010|ERROR |DatabaseQuery | | mysqlrealconnect() failed with error: Access denied for us$
      2016-03-19 21:18:07.107082|CRITICAL|ServerLibPriv | | Server() unable to initialize database

    • nevermind… i figured it out on my own… i had to change the /opt/teamspeak3-server/ts3db_mariadb.ini file and remove the line that reads “socket=”

      after that it booted and ran perfectly fine

      • I was having the same issue, so I did as you did by removing “socket=”. It didnt help in my case.

        I’ve doubled back to make sure I correctly typed the username/password correctly, too. Both in the ini file and for the database itself.

        Any help would be appreciated.

        • i honestly don’t know what it could be… i was doing trial and error with different google searches. try to boot it up and then get the log after the error and post it up in here and see if there is something missing in the log.

          • I’ve got it working since then. I created a new database and user (ts3) and a simpler password. I’m not sure why this worked other then maybe making a typing error when entering the password where needed … but i double, triple checked that. Thanks for looking into it, though.

          • Yeah to be honest, i had to wipe and start over probably 4 or 5 times before i got the thing to run properly. let me know if you figure out how to add the Non-Profit License in through putty or how ever you have to do it....

        • hey… i had to reinstall again because i wanted an email server as well as website and ts3 and i was told to start with email server and i ran into the problem again… and i think i figured it out.... when you are creating the database… you have to actually specify the password unless you going to leave it as PASSWORD.... so…

          sudo mysql -u root -p
          create database teamspeak3;
          GRANT ALL PRIVILEGES ON teamspeak3.* TO teamspeak3@localhost IDENTIFIED BY ’(yourmysqlpassword)’;
          flush privileges;

          • Do you mean that you need to configure the password in the teamspeak ts3db_mariadb.ini file the same you setup the database password with?

            Yes, thats the point of setting up a database with a user so the Teamspeak server can communicate with the database.

Cannot get past: sudo apt-get install mariadb-client mariadb-server

E: Unable to fetch some archives, maybe run apt-get update or try with –fix-missing?


really nice scripts and thanks for making it for me as a noob in Linux.

Everything went fine and its running without errors.

But how do i change the PASSWORD to something else after i made it with PASSWORD as password ?

And another thing is ........

Now with the TS3 server running, where is it ? Shouldnt i have an icon on my GUI/desktop to start a GUI version of the TS3 server and how do i let people into it and how do i use/configure it ?

Sorry im new in Linux and a bit lost now :)


  • Hey there,

    Well in the tutorial you could have made another password as you wanted. However if you didn’t change this you have to

    • Change the database password
    • Change the password in the Teamspeak config

    Change the database password

    Login to your mysql with command

    sudo mysql -u root -p

    Change the teamspeak user password

    SET PASSWORD FOR 'teamspeak3'@'localhost' = PASSWORD('newpassword');


    Change the password in the Teamspeak config

    Open the config file

    sudo nano /opt/teamspeak3-server/ts3db_mariadb.ini

    Change password=PASSWORD to password=newpassword

    After this restart the teamspeak server

    sudo /etc/init.d/ts3 start

    Now with the TS3 server running, where is it ? Shouldnt i have an icon on my GUI/desktop to start a GUI version of the TS3 server and how do i let people into it and how do i use/configure it ?
    Well you just setup the TS3 server. The client you need to download yourself on your client PC. You can download this at the teamspeak website

    Once you have it, go to Connections –> Connect –>
    And use the IP of your droplet to connect to.

    Hope this helps you out!

Could you please add a tutorial on how to insert the NPL licencekey? Or just some instructions.

Starting the TeamSpeak 3 server
TeamSpeak 3 server started, for details please view the log file
root@ubuntu-512mb-nyc1-01:~# 2016-07-21 17:43:56.807569|CRITICAL|ServerLibPriv | | Server() unable to initialize database

2016-07-21 17:53:30.972983|INFO |ServerLibPriv | | TeamSpeak 3 Server (2015-08-18 13:30:34)
2016-07-21 17:53:30.973160|INFO |ServerLibPriv | | SystemInformation: Linux 4.4.0-28-generic #47~14.04.1-Ubuntu SMP Fri Jun 24 16:30:35 UTC 2016 x8664 Binary: 64bit
2016-07-21 17:53:30.973242|INFO |ServerLibPriv | | Using hardware aes
2016-07-21 17:53:30.978651|INFO |DatabaseQuery | | dbPlugin name: MariaDB plugin, ©TeamSpeak Systems GmbH
2016-07-21 17:53:30.978754|INFO |DatabaseQuery | | dbPlugin version: 1
2016-07-21 17:53:30.984100|ERROR |DatabaseQuery | | mysql
real_connect() failed with error: Access denied for user ‘teamspeak3’@'localhost’ (using password: YES)
2016-07-21 17:53:30.984205|CRITICAL|ServerLibPriv | | Server() unable to initialize database

  • Hi,

    This is because you didn’t use the same password in your TS3 server config file as the database user password. Are you sure you are using the same password for both the database and the config file?

    • Yes i think i use the same password , anyway how i can check the config file to see if there is same password?

  • I’m having the same problem. I copied and pasted the commands and file content to avoid any typos.

    i can’t change directory into logs i get permission denied. I tried adding my user name to the teamspeak3-user group and will change permissions to allow me next.

    however when i start the server i get the the server() unable to initialize database

    toonamo@toonamo-Virtual-Machine:/opt/teamspeak3-server$ sudo /etc/init.d/ts3 startStarting the TeamSpeak 3 server
    2016-10-01 00:12:54.486042|CRITICAL|ServerLibPriv |   | Server() unable to initialize database
    TeamSpeak 3 server could not start

    i can however use the same user and password from the ini file to connect to mysql and create a table and drop it.

    Brand new install. Any thoughts?

    • changed user to teamspeak3-user by useing

      sudo su teamspeak3-user

      log stated:

      2016-10-01 00:12:54.481932|INFO    |ServerLibPriv |   | TeamSpeak 3 Server (2015-08-18 13:30:34)
      2016-10-01 00:12:54.482194|INFO    |ServerLibPriv |   | SystemInformation: Linux 4.4.0-36-generic #55-Ubu$
      2016-10-01 00:12:54.482284|INFO    |ServerLibPriv |   | Using hardware aes
      2016-10-01 00:12:54.484632|INFO    |DatabaseQuery |   | dbPlugin name:    MariaDB plugin, (c)TeamSpeak Sy$
      2016-10-01 00:12:54.484744|INFO    |DatabaseQuery |   | dbPlugin version: 1
      2016-10-01 00:12:54.485933|ERROR   |DatabaseQuery |   | mysql_real_connect() failed with error: Can't con$
      2016-10-01 00:12:54.486042|CRITICAL|ServerLibPriv |   | Server() unable to initialize database

      so i added a new user to the database

      CREATE USER 'teamspeak3'@'%' IDENTIFIED BY 'mypass';

      i then granted permisions:

      GRANT ALL ON *.* TO 'myuser'@'localhost';
      GRANT ALL ON *.* TO 'myuser'@'%';

      and changed the ip from to my local ip address and tried to run it.
      log is as follows:

      2016-10-01 00:25:59.987923|INFO    |ServerLibPriv |   | TeamSpeak 3 Server (2015-08-18 13:30:34)
      2016-10-01 00:25:59.988183|INFO    |ServerLibPriv |   | SystemInformation: Linux 4.4.0-36-generic #55-Ubu$
      2016-10-01 00:25:59.988274|INFO    |ServerLibPriv |   | Using hardware aes
      2016-10-01 00:25:59.989917|INFO    |DatabaseQuery |   | dbPlugin name:    MariaDB plugin, (c)TeamSpeak Sy$
      2016-10-01 00:25:59.990019|INFO    |DatabaseQuery |   | dbPlugin version: 1
      2016-10-01 00:25:59.991300|ERROR   |DatabaseQuery |   | mysql_real_connect() failed with error: Can't con$
      2016-10-01 00:25:59.991413|CRITICAL|ServerLibPriv |   | Server() unable to initialize database
      • Hello @toonamo ,

        Try to remove the socket= line at the end of /opt/teamspeak3-server/ts3db_mariadb.ini. This worked for some cases.

        If that doesn’t work try to use a valid socket:

        • still the same error. teamspeak is not able to access the database.

          • Allright, please try the following. I have found MySQL sometimes doesn’t like the use of localhost, so try tonusenthe following:

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

            And if you are using a secure difficult generated password , please try to use a less difficult password. Have seen that passwords with alot of symbolics and high length don’t work.
            Please try these options and give a feedback.

          • it still wasn’t working. so i deleted all users from the table mysql.user
            DELETE FROM mysql.user WHERE user=‘teamspeak3’;

            then droped the users.
            DROP USER 'teamspeak3’@'localhost’;
            DROP USER 'teamspeak3’@’%’;
            DROP USER 'teamspeak3’@'’;

            then i created the user
            CREATE USER 'teamspeak3’@'localhost’ IDENTIFIED BY 'password’;

            granted permission
            GRANT ALL PRIVILEGES ON teamspeak3 . * TO 'teamspeak3’@'localhost’;

            then flushed the database

            i did use a much simpler password as well, and used localhost for the host rather than

            that seemed to allow it to work.

            Thank you for all your help.

Thanks a lot for answer :)

And what if I need to have more admins? I think that it is possible but I don’t know how to do it. Can someone help me, please? :-D

edit: aaaand, I have a problem.. I have removed the ip of my ts3 client from the whitelist and I have restarted the ts3 server, but the *client *connected anyway. How is it possible?

  • @igic This is not really a setup question but I’m happy to help you.
    There are two ways, easiest way is the first;

    • You can assign admins by righ clicking on their name and assigning them a server group.
    • You can create a privilege key inside Permissions –> Privilege keys –> Create and then give them the key You can read alot more about server groups, Teamspeak permissions and security online. For example here

    What do you mean with the second question? What client connected and what are you trying to achieve?

when a do

Now everything should be done, and ready to go. Lets start the Teamspeak3 server for the first time:
sudo /etc/init.d/ts3 start

Nothing happens, No error or anything.

a run Ubuntu 16.10 x64 is that the problem ?

  • @kulaN If it doesn’t return anything the first time you might need to wait a while.
    Try to check if the server is running by /etc/init.d/ts3 status and also try to connect to your Teamspeak server with your client.

    I have recently made a new tutorial using Ubuntu 16.10 x64. Find the latest tutorial on my blog:

I followed the tutorial and I still can’t get the TS to start. I keep getting “bad interperter: No such file or directory when trying to /etc/init.d/ts3 start Any help would be appreciated as I’m installing new head shaped dents into my desk. Thanks in advance for any help.

I’ve followed this tutorial twice for 2 droplets. There weren’t any error messages or logs generated but I’m unable to connect to the server. The logs generated are fine as well.

These are the logs from starting the teamspeak server:
In Teamspeak, when I try connecting, the clients logs are

17/12/2016 15:58:40 ClientUI    Info    Initiating connection: 123.456.78.123:9987 123.456.78.123   
17/12/2016 15:58:41 ClientUI    Info    Connect status: Connecting  
17/12/2016 15:58:45 ClientUI    Info    Connect status: Disconnected    
17/12/2016 15:58:45 ClientUI    Info    Failed to connect to server, want autoreconnect = 0 

Thanks in advance!

  • @SprX if you followed my latest tutorial on the link I gave you last time and the scripts are working this time, then this sounds like a firewall problem.
    Please check if your teamspeak is running with

    netstat -anp | grep 9987

    also check if you have any firewall running with

    ufw status


    iptables -L

    You can also check if your port is open from the outside once you have checked and made all necessary ports open with this tool

Worked perfectly with Ubuntu 16.04 LTS as well. As always, you will need to get the correct path to the current version of Teamspeak 3 from the Teamspeak 3 download page for the wget command.

Hy guys,
To error “2017-08-10 13:06:14.692019|CRITICAL|ServerLibPriv | |Server() unable to initialize database
TeamSpeak 3 server could not start” you can see and try whith “Helpful informations:”, I into command “su - teamspeak3-user ./ start inifile=ts3server.ini” and the server start! :D

great guide, it worked all fine ( 99% copy/paste ^^).
But i have a problem, i started the server, “ts3 status” says “Server is running”, netstat seems ok to me, logs says listenning on, BUT i cant connect from my cliuent and says my port 9987 is closed? i need to create a firewall on my droplet? or, can i change the port?
tnx :)

  • Great to hear! Did you check the answers I gave above? It could be that you have a firewall (ufw/itables).

    You might need to open this, then it should work.
    Try to see if opening some ports on iptables works:

    -A INPUT -p udp --dport 9987 -j ACCEPT
    -A INPUT -p tcp --dport 10011 -j ACCEPT
    -A INPUT -p tcp --dport 30033 -j ACCEPT
    • Thank you!
      I read all messages, but your links doesn’t work and i don’t understand nothing when iptables -L.
      But, your first line worked! Thank you :)
      After opened the port, server says “… server version too old…”, then i downloaded the lastest version and installed like the other version.
      And finally, with the new version you need to accept their license, and i created the file how they says.
      Finally worked!
      Thanks :)

      • Yes sorry, the links don’t work anymore because I took down that website.
        Great you got it working with adding an IPTables rule!

        For explanation: the first line is for connecting threw the client, the other 2 lines are for queries and file transfers.

Have another answer? Share your knowledge.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!