It has been a long time since my last post – I’m sorry for that but I didn’t have the time. Anyway I just installed TeamSpeak 3 on a Ubuntu 10.04 for a friend and want to share that info. Getting TeamSpeak running is mostly not the problem but you don’t want to start it after every boot by hand or run it as root. This Howto shows what I did. I assume that all user actions shown in this howto are performed as root or after executing sudo bash.

First you need to create a user under which the TeamSpeak server should run by executing following command:

adduser --disabled-login teamspeak

Now we need to get the software (64bit in my case)

wget http://ftp.4players.de/pub/hosted/ts3/releases/beta-22/teamspeak3-server_linux-amd64-3.0.0-beta22.tar.gz (Take also a look if a new version is out when you install your server)

and extract it

tar xzf teamspeak3-server_linux-amd64-3.0.0-beta22.tar.gz

We move it to a nice place with

mv teamspeak3-server_linux-amd64 /opt/ts3

and give it to the user teamspeak

chown -R teamspeak /opt/ts3

If you take a look into the /opt/ts3 directory you’ll see that there is a already a start/stop script (ts3server_startscript.sh), we will utilize it. Create a init.d file with pasting the content after executing cat > /etc/init.d/teamspeak :

Now press ENTER and CTRL-D and you’ve inserted the content into the file. Set the permission correctly with

chmod 755 /etc/init.d/teamspeak

and now you can try it out by calling

/etc/init.d/teamspeak start

Take note of the login and token as you will need them later. You can also look for them in the log files in /opt/ts3/logs/. The last thing you need to do now is to make sure the init script is executed at boot time by using following command:

update-rc.d teamspeak defaults

At last if you’ve a firewall running on your system you need to make sure that you open all your ports. To find out which ports are used by teamspeak use following command:

I hope this howto helped someone and write a comment if you found an error or a better way to do something. Now you just need to point your TeamSpeak client to the server and go to the menu entry “permissions | use token” and copy and past the token from above into the edit box. (only insert the chars behind “token=”)

i deleted old logs, rebooted and ‘less /opt/ts3/log/…’ looks like everything is fine. trying to connect to the server works at last. i have no idea what deleting old logs has to do with starting up the service, but i don’t care any longer

You can check if there is any traffic going to a port by using this command

tcpdump -n -i eth0 port 30033 (or the other ports) .. if you don’t see anything when the clients tries to connect there is someone filtering between clients and server. eth0 is the interface you’re using, can also be something like venet0 or bond0 depending on your server setup. check with ifconfig.

Hey, I’m having the same problem as Ryan (first comment above). The server runs fine when I execute /etc/init.d/teamspeak start. However, during startup, the server will shut itself down in exactly 5 minutes. I’ve opened all the necessary ports. Here is an example of the log:

hmmm .. the log entry TS3ANetwork::ResolveHostName failed error: -2 (Name or service not known) seems to tell us that the system is not able to resolve the name of some host. If that resolution is possible if you login in and start it by hand you seem to be right with your guess.

I wrote that Howto for the latest LTS Version (10.04) .. are you trying it with 10.10?

Is your server connected via Ethernet to the Internet or do you need to open a ppp connection or something like this? If you have something like this you need to make sure the server is started after the ppp connection is established.

In the standard ethernet case, I would first try to set it back in the runlevel stuff:

update-rc.d -f teamspeak remove
update-rc.d teamspeak defaults 99

If that doesn’t work. I would try following hack

update-rc.d -f teamspeak remove

and

add to /etc/rc.local

sudo -u teamspeak ./ts3server_startscript.sh restart (or maybe start, did not check if restart works also when no prior process is running)

I followed uour guide and everything works fine while im on my LAN. Connecting externally is not working so good. Tried a tcpdump -n -i wlan0 port 9987 and the traffic goes through when i try to connect but the client still said “failed to connect to server” Im running it on Ubuntu 10.10.
Any Ideas?

Newer tried teamspeak over a NAT/PAT. I don’t know if the protocol supports that – ask the teamspeak guys. Make your linux system the DSL/Cable router and try it again if it does not work with a NAT/PAT.

Thank you for this tutorial. My TS3 server was up quickly and worked fine. Now I am using a wifi connection and I have the same problem than Ray. It works only 5 mn with same log file.
I am using this file for lunching the wifi when starting the computer :
/etc/network/interfaces:
auto lo
iface lo inet loopback

Hello! Thank you Robert, for this awesome tutorial.. But I was wondering.. Can you make a un-install tutorial too? Or an update procedure (if un-install is not needed to update)..?! I think I’m using Ubuntu 10.10, but I’m not sure.. But it works great anyhow..

GREAT guide! when I followed it to the letter, it worked wonderfully. and by the way, yes, it has that 5 minute shutdown problem, but that code you mentioned later DOES solve the problem:

update-rc.d -f teamspeak remove
update-rc.d teamspeak defaults 99

There is but one problem I am having. The server booted up just fine, and I was able to connect. The server gave me a server admin token to use, so i pasted it on the “use privelege key” option. now I’m a server admin. In theory, I should have ultimate power, right?

Well that’s not exactly the case. When I go into permissions >> server groups, and attempt to change Guest’s permissions (let’s try something simple like allowing them to send text messages to the channel). I get an error that says “Not all permissions could be applied”, and the server console says “insufficient permission modify power”. nothing shows up in the log file about it. I’ve been having problems like this since 10.04, and up until now I’ve just been giving up on it. any forum I’ve googled about it so far mentions having to edit a database file with some other program for permissions… That seems asinine to me, which means I’ve done something wrong somewhere and didn’t know it lol. have any of you had this problem? is it something easy to fix?

When I enter update-rc.d teamspeak defaults as per your instructions I get this: update-rc.d: warning: teamspeak stop runlevel arguments (0 1 6) do not match LSB Default-Stop values (S 0 1 6) It seems to work, but what does this warning mean?

@Antonio: LSB is the Linux Standard Base which writes some guidelines down to make all distribution similar. And the warning just shows that the defaults of Ubuntu are not the default for LSB. Just ignore it

Thanks for additional explanation/clarification and a very helpful tutorial in the first place! It works perfectly on Ubuntu 10.10 headless server connected to the internet with Cisco cable modem and a Linksys WRT54GL router with DD-WRT firmware!

dit have the same problem as many here with a router, but the onw thing i did think of later was i also have a firewall running (UFW)
added :
ufw enable
ufw default deny
ufw allow 9987/udp
ufw allow 10011/tcp
ufw allow 30033/tcp
(remember add you home network also)

So I followed it exactly, everything looks like it’s working, But, I can join to it Locally but people cant’ join it. Firewalls set up, nothings bouncing off, is there a way i can tell it somewhere to read from an INI file??? maybe in /etc/init.d/teamspeak??? cause i’ve heard that when the ip reads as 0.0.0.0 sometimes people have problems connecting

Great post. I am using the init script you wrote and it is working well. One issue I had though, was that the server would not start on boot up. I traced it back to the sudo command not having the ability to run without a tty terminal. I needed to add a line to my sudoers file “Defaults:root !requiretty”. Once that was added the script would start up. I knew this was required as the console was giving an error that sudo needed a tty terminal to run.

My question though, is the service does not seem to shut down properly on reboot. I do not see any errors on the terminal, but when the system boots up I am told the pid already existed, meaning the service was terminated and not shut down properly. Do you have any ideas?

Still works great on Ubuntu 12. If you are brand new to Linux as I was, here are a couple things that would have saved me a little frustration and a lot of time:
Connect to your server using SSH! Install OpenSSH when you install Ubuntu, or add it if you didn’t. The ability to copy and paste into the Ubuntu console from a Windows machine is super-useful. Please find and follow a guide to setting up SSH securely if you decide to use it.

Also, as another commenter mentioned, the grammar surrounding the init.d script instructions can be confusing for Linux newbies, especially those not familiar with the ‘cat’ (concatenate) command. Cat is primarily intended to merge the content of multiple files into one, but it is used here as a relatively simple way to create a new file and add startup code to it. Once I understood what ‘cat’ does and how it is being used here, the whole thing made perfect sense. For those who may still be having trouble, try reading that possibly-confusing sentence this way:

“Create an init.d file by pasting the following content, after executing this command: cat > /etc/init.d/teamspeak”

Now, if you’re a super-newbie like I was, here’s the Super Duper Micromanager’s Hand-Holding Edition with new improved formula and 25% extra explaining! This assumes you’ve followed the guide up through changing permissions for the teamspeak user and are now stuck setting up the init.d script:
1: Type cat > /etc/init.d/teamspeak into the console and hit ENTER. The console will advance one row and display a blank line with cursor. Basically, we have just told cat to create a blank file called ‘teamspeak’ in the init.d directory. If the file already existed, cat would use the existing file.
2: Now copy the OP’s init.d code from above, starting with #! /bin/sh. Paste it into the linux console. The pasted text appears on screen. Once you are sure all the code is there and correct, hit ENTER. We have just pasted the code into to the teamspeak file that was created.
3. Now hit Ctrl-D. This will close cat and return us to the prompt. The startup script is created and saved. Move to the next step.

Note: I don’t mean to insult the OP on his very own blog by rewriting instructions and fixing grammar!. I only hope to save someone the same frustration I experienced by providing this “for dummies” version of the init.d step, which I initially found to be confusing. Best of luck!

Extremely new to linux so bear with me please. I followed the guide here and I can call on the server using the /etc/init.d/teamspeak start command but when I restart it doesn’t seem to auto start the server. Any help would for thew newbie would be greatly appreciated. Thanks

Hi, I followed this guide and everything works perfectly. You might want to address the issue that if you have a TS license, you also have to allow port 2008 (TCP) in your firewall. If you don’t, TeamSpeak will not start – the log will simply log that it cannot connect to the accounting server and the process will terminate. You only have to allow port 2008 for accounting.teamspeak.com.

“If you take a look into the /opt/ts3 directory you’ll see that there is a already a start/stop script (ts3server_startscript.sh), we will utilize it. Create a init.d file with pasting the content after executing cat > /etc/init.d/teamspeak ”

The first time I read that I assumed I was to paste in the text from ts3server_startscript.sh

Hello,
the way you chown’d the teamspeak folder prevent my sudo user from reading the log files. What turn around solution shoud I follow in order to do so? My teamspeak user does not have any password and I cannot su with it.
It’s obvious that I am not at all familiar with linux as a whole. Thanks for your help