annotate content/Coding/031-setting-up-a-teamspeak-3-server-on-ubuntu-14.04.rst @ 23:e4f02a31925d

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