comparison content/Coding/031-setting-up-a-teamspeak-3-server-on-ubuntu-14.04.rst @ 19:d6221e37c59e

New blog post on setting up Teamspeak 3 on Ubuntu.
author Brian Neal <bgneal@gmail.com>
date Sun, 08 Nov 2015 22:40:09 -0600
parents
children
comparison
equal deleted inserted replaced
18:a2907243a98a 19:d6221e37c59e
1 Setting Up a Teamspeak 3 Server on Ubuntu 14.04
2 ###############################################
3
4 :date: 2015-11-08 22:32
5 :tags: teamspeak,ubuntu
6 :slug: setting-up-a-teamspeak-3-server-on-ubuntu-14.04
7 :author: Brian Neal
8
9 Here is a quick guide for setting up a `Teamspeak 3`_ server on Ubuntu 14.04.
10
11 First you need to obtain the latest version of the Teamspeak 3 server software.
12 You can see what they have available on the `Teamspeak downloads page`_. At the
13 time of this writing, the server software is found on a "server" tab. You'll
14 want to pick either the 32 or 64-bit version depending on your Ubuntu
15 installation. You can either download the package to your local computer and
16 copy it to your server, or get it directly from your server. I used this
17 command on my server::
18
19 $ wget http://dl.4players.de/ts/releases/3.0.11.4/teamspeak3-server_linux-amd64-3.0.11.4.tar.gz
20
21 You can poke around on the downloads page using a web browser to find the URL
22 for the latest verison by visiting http://dl.4players.de/ts/releases/.
23
24 Next, unpack the archive file::
25
26 $ tar xvfz teamspeak3-server_linux-amd64-3.0.11.4.tar.gz
27
28 A good place to install it is `/usr/local/`, so let's do that::
29
30 $ sudo mv teamspeak3-server_linux-amd64 /usr/local/teamspeak
31
32 It's a very good idea to create a new user to run the Teamspeak service. We'll
33 create a system user called ``teamspeak`` that can't login with this command::
34
35 $ sudo adduser --system --group --disabled-login --no-create-home teamspeak
36
37 Now we'll ensure this new user owns all the files::
38
39 $ sudo chown -R teamspeak:teamspeak /usr/local/teamspeak
40
41 Next we'll create the infrastructure needed to launch the Teamspeak service on
42 server startup. The server files we downloaded include a suitable startup
43 script already. We'll just have to make sure our new ``teamspeak`` user runs this
44 script. Use your favorite editor to create a new file::
45
46 $ sudo vi /etc/init.d/teamspeak
47
48 This new file will simply ``sudo`` to the new ``teamspeak`` user and then run the
49 startup script. Your new ``/etc/init.d/teamspeak`` file should contain the
50 following::
51
52 #!/bin/sh
53 sudo --user=teamspeak /usr/local/teamspeak/ts3server_startscript.sh $@
54
55 Notice the trailing ``$@``. This is important for forwarding the usual arguments
56 like ``stop``, ``start``, and ``restart`` to the Teamspeak script.
57
58 Now we'll finish the process of ensuring our script can be run at server
59 startup and shutdown::
60
61 $ sudo chmod u+x /etc/init.d/teamspeak
62 $ sudo update-rc.d teamspeak defaults
63
64 Now we can run the Teamspeak service for the very first time::
65
66 $ sudo service teamspeak start
67
68 You should see some console output, including a long string of the form
69 ``token=blahblahblah``. Make sure you copy the text after the ``token=`` part.
70 This magic string will allow you to obtain server admin privileges the first
71 time you connect to your server with a Teamspeak client. See this `article`_
72 for more information.
73
74 Finally, if you are running a firewall, you'll have to open some ports
75 before you can connect with your client. You should refer to the Teamspeak
76 article "`Which ports does the Teamspeak 3 server use?`_". At the
77 time of this writing, I used the following rules for `iptables`_::
78
79 # Allow ports for Teamspeak3
80 -A INPUT -p udp --dport 9987 -j ACCEPT
81 -A INPUT -p tcp --dport 30033 -j ACCEPT
82 -A INPUT -p tcp --dport 10011 -j ACCEPT
83 -A INPUT -p tcp --dport 41144 -j ACCEPT
84
85 If you use `ufw`_ to manage your firewall, I think the following commands will
86 suffice::
87
88 $ sudo ufw allow 9987/udp
89 $ sudo ufw allow 30033/tcp
90 $ sudo ufw allow 10011/tcp
91 $ sudo ufw allow 41144/tcp
92
93 Enjoy your new Teamspeak 3 server!
94
95 .. _Teamspeak 3: http://www.teamspeak.com/
96 .. _Teamspeak downloads page: http://www.teamspeak.com/downloads
97 .. _article: https://support.teamspeakusa.com/index.php?/Knowledgebase/Article/View/40/0/how-do-i-make-myself-and-then-someone-else-a-server-admin
98 .. _Which ports does the Teamspeak 3 server use?: https://support.teamspeakusa.com/index.php?/Knowledgebase/Article/View/44/16/which-ports-does-the-teamspeak-3-server-use
99 .. _iptables: https://help.ubuntu.com/community/IptablesHowTo
100 .. _ufw: https://help.ubuntu.com/community/UFW