Howto install TeamSpeak 3 server on Ubuntu 10.04 (Lucid)
May 15, 2010
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
:
#! /bin/sh
### BEGIN INIT INFO
# Provides: teamspeak
# Required-Start: networking
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: S 0 1 6
# Short-Description: TeamSpeak Server Daemon
# Description: Starts/Stops/Restarts the TeamSpeak Server Daemon
### END INIT INFO
set -e
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DESC="TeamSpeak Server"
NAME=teamspeak
USER=teamspeak
DIR=/opt/ts3
DAEMON=$DIR/ts3server_startscript.sh
#PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME
# Gracefully exit if the package has been removed.
test -x $DAEMON || exit 0
cd $DIR
sudo -u teamspeak ./ts3server_startscript.sh $1
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:
# netstat -lnp | grep ts3
tcp 0 0 0.0.0.0:10011 0.0.0.0:* LISTEN 30232/ts3server_lin
tcp 0 0 0.0.0.0:30033 0.0.0.0:* LISTEN 30232/ts3server_lin
udp 0 0 0.0.0.0:9987 0.0.0.0:* 30232/ts3server_lin
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=”)
76 Comments »
RSS feed for comments on this post. TrackBack URI
Leave a comment
Powered by WordPress
Entries and comments feeds.
Valid XHTML and CSS.
37 queries. 0.150 seconds.
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!
Comment by Bearfight — August 7, 2012 #
Grammar fixing is no problem, as English is not my native language. 😉
Comment by robert — August 7, 2012 #
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
Comment by Quoward — August 20, 2012 #
Take a look at comment 14 … it maybe helps you. The other possibility is that Teamspeak is trying to start and it doesn’t work, for this look into the teamspeak logs.
Comment by robert — August 21, 2012 #
Thank you very much for this guide. Worked perfectly for me!
Comment by Brian — September 19, 2012 #
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.
Comment by Jeroen — September 26, 2012 #
Awesome write-up! I had this working on my server in under 5 minutes.
This line is a little confusing though:
“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 😀
Comment by isoprene — October 7, 2012 #
I’ve followed exactly up to this part.
cat > /etc/init.d/teamspeak
but I get this error:
-bash: /etc/init.d/teamspeak: Permission denied
Thoughts?
Comment by helwoe — October 22, 2012 #
you need to do this as superuser … sudo cat > /etc/init.d/teamspeak
or sudo bash before to set the whole shell in superuser mode
Comment by robert — October 22, 2012 #
Thanks Robert!
This worked for me.
sudo bash
ENTER
sudo cat > /etc/init.d/teamspeak
ENTER
(copy & paste code)
Ctrl+D
Comment by helwoe — October 23, 2012 #
Thank you so much for this easy to follow guide. It worked flawlessly for my setup on Ubuntu 12.04!
Comment by Mat Collins — November 19, 2012 #
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 🙂
Comment by KRG-23 — November 22, 2012 #
With “su -m user” or “su -p user” as root you can login as a user that can not login normally.
Comment by robert — November 22, 2012 #
[…] Credit: Robert Penz Blog […]
Pingback by Installing Teamspeak 3 Server in Ubuntu Server 10.04LTS Environment | blysshosting.com — January 13, 2013 #
This was a fantastic tutorial. After following the instructions the server started and was added to the startup scripts perfectly! Thank you so very much.
Comment by Mike — February 6, 2013 #
[…] http://robert.penz.name/296/howto-install-teamspeak-3-server-on-ubuntu-10-04-lucid/ […]
Pingback by Teamspeak 3 en Ubuntu Server | iKindred's Notes — July 27, 2013 #
[…] if you are looking for a guide to get started with installing Teamspeak, this guide worked for […]
Pingback by Updating Teamspeak Server on Ubuntu 12.04 Linux | Mark Broadhead — September 10, 2013 #
perfect guide and spot on, bloody brilliant my friend, Thank you for this piece of GOLD!
Comment by Tom — September 14, 2013 #
I was wondering if you would post an update solution? We are now at version 3.10 for the server, and was wondering if there was anything feature for the server that can do an automatic upgrade?
thanks
Comment by Philippe — October 2, 2013 #
I have followed step by step in this tutorial, everything is describe, how to install and configure TeamSpeak3 server with MySQL – MariaDB on Debian/Ubuntu.
http://terminal28.com/how-to-install-and-configure-teamspeak3-server-linux-debian-ubuntu/
Comment by datas — January 25, 2015 #
Recent updates to my Debian server has required the line that says:
mv teamspeak3-server_linux-amd64 /opt/ts3
To be changed into:
mv teamspeak3-server_linux-amd64/* /opt/ts3
Comment by Patrick — May 11, 2015 #
[…] Howto install TeamSpeak 3 server on Ubuntu 10.04 (Lucid … – Howto install TeamSpeak … /usr/sbin:/usr/bin DESC="TeamSpeak Server" NAME=teamspeak USER … it is enough just to write “sudo apt-get install teamspeak … […]
Pingback by How To Install Teamspeak On Godaddy – Cyber Sun — September 29, 2015 #
[…] Howto install TeamSpeak 3 server on Ubuntu 10.04 (Lucid … – Howto install TeamSpeak 3 server on Ubuntu 10.04 (Lucid) May 15, 2010. It has been a long time since my last post – I’m sorry for that but I didn’t have the time. […]
Pingback by Godaddy Teamspeak Server – Cyber Sun — November 14, 2015 #
Is there any way of logging to syslog?
Comment by DreamDemon — November 14, 2015 #
Didn’t try it but it maybe possible to create a fifo pipe as the logfile and send it to syslog. This only works if Teamspeak does not seek within the file.
Comment by robert — November 14, 2015 #
hi, i made some changes so i could make ts2 and ts3 co-exist on the same server
heres my version of the above
#! /bin/sh
### BEGIN INIT INFO
# Provides: teamspeak
# Required-Start: networking
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: S 0 1 6
# Short-Description: TeamSpeak Server Daemon
# Description: Starts/Stops/Restarts the TeamSpeak Server Daemon
### END INIT INFO
set -e
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DESC=”TeamSpeak 3 Server”
NAME=teamspeak3
USER=teamspeak3
DIR=/opt/ts3
DAEMON=$DIR/ts3server_startscript.sh
#PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME
# Gracefully exit if the package has been removed.
test -x $DAEMON || exit 0
cd $DIR
sudo -u $USER ./$DAEMON $1
Comment by dez — January 15, 2016 #