bgneal@19: Setting Up a Teamspeak 3 Server on Ubuntu 14.04 bgneal@19: ############################################### bgneal@19: bgneal@19: :date: 2015-11-08 22:32 bgneal@19: :tags: teamspeak,ubuntu bgneal@19: :slug: setting-up-a-teamspeak-3-server-on-ubuntu-14.04 bgneal@19: :author: Brian Neal bgneal@19: bgneal@19: Here is a quick guide for setting up a `Teamspeak 3`_ server on Ubuntu 14.04. bgneal@19: bgneal@19: First you need to obtain the latest version of the Teamspeak 3 server software. bgneal@19: You can see what they have available on the `Teamspeak downloads page`_. At the bgneal@19: time of this writing, the server software is found on a "server" tab. You'll bgneal@19: want to pick either the 32 or 64-bit version depending on your Ubuntu bgneal@19: installation. You can either download the package to your local computer and bgneal@19: copy it to your server, or get it directly from your server. I used this bgneal@19: command on my server:: bgneal@19: bgneal@19: $ wget http://dl.4players.de/ts/releases/3.0.11.4/teamspeak3-server_linux-amd64-3.0.11.4.tar.gz bgneal@19: bgneal@19: You can poke around on the downloads page using a web browser to find the URL bgneal@19: for the latest verison by visiting http://dl.4players.de/ts/releases/. bgneal@19: bgneal@19: Next, unpack the archive file:: bgneal@19: bgneal@19: $ tar xvfz teamspeak3-server_linux-amd64-3.0.11.4.tar.gz bgneal@19: bgneal@19: A good place to install it is `/usr/local/`, so let's do that:: bgneal@19: bgneal@19: $ sudo mv teamspeak3-server_linux-amd64 /usr/local/teamspeak bgneal@19: bgneal@19: It's a very good idea to create a new user to run the Teamspeak service. We'll bgneal@19: create a system user called ``teamspeak`` that can't login with this command:: bgneal@19: bgneal@19: $ sudo adduser --system --group --disabled-login --no-create-home teamspeak bgneal@19: bgneal@19: Now we'll ensure this new user owns all the files:: bgneal@19: bgneal@19: $ sudo chown -R teamspeak:teamspeak /usr/local/teamspeak bgneal@19: bgneal@19: Next we'll create the infrastructure needed to launch the Teamspeak service on bgneal@19: server startup. The server files we downloaded include a suitable startup bgneal@19: script already. We'll just have to make sure our new ``teamspeak`` user runs this bgneal@19: script. Use your favorite editor to create a new file:: bgneal@19: bgneal@19: $ sudo vi /etc/init.d/teamspeak bgneal@19: bgneal@19: This new file will simply ``sudo`` to the new ``teamspeak`` user and then run the bgneal@19: startup script. Your new ``/etc/init.d/teamspeak`` file should contain the bgneal@19: following:: bgneal@19: bgneal@19: #!/bin/sh bgneal@19: sudo --user=teamspeak /usr/local/teamspeak/ts3server_startscript.sh $@ bgneal@19: bgneal@19: Notice the trailing ``$@``. This is important for forwarding the usual arguments bgneal@19: like ``stop``, ``start``, and ``restart`` to the Teamspeak script. bgneal@19: bgneal@19: Now we'll finish the process of ensuring our script can be run at server bgneal@19: startup and shutdown:: bgneal@19: bgneal@19: $ sudo chmod u+x /etc/init.d/teamspeak bgneal@19: $ sudo update-rc.d teamspeak defaults bgneal@19: bgneal@19: Now we can run the Teamspeak service for the very first time:: bgneal@19: bgneal@19: $ sudo service teamspeak start bgneal@19: bgneal@19: You should see some console output, including a long string of the form bgneal@19: ``token=blahblahblah``. Make sure you copy the text after the ``token=`` part. bgneal@19: This magic string will allow you to obtain server admin privileges the first bgneal@19: time you connect to your server with a Teamspeak client. See this `article`_ bgneal@19: for more information. bgneal@19: bgneal@19: Finally, if you are running a firewall, you'll have to open some ports bgneal@19: before you can connect with your client. You should refer to the Teamspeak bgneal@19: article "`Which ports does the Teamspeak 3 server use?`_". At the bgneal@19: time of this writing, I used the following rules for `iptables`_:: bgneal@19: bgneal@19: # Allow ports for Teamspeak3 bgneal@19: -A INPUT -p udp --dport 9987 -j ACCEPT bgneal@19: -A INPUT -p tcp --dport 30033 -j ACCEPT bgneal@19: -A INPUT -p tcp --dport 10011 -j ACCEPT bgneal@19: -A INPUT -p tcp --dport 41144 -j ACCEPT bgneal@19: bgneal@19: If you use `ufw`_ to manage your firewall, I think the following commands will bgneal@19: suffice:: bgneal@19: bgneal@19: $ sudo ufw allow 9987/udp bgneal@19: $ sudo ufw allow 30033/tcp bgneal@19: $ sudo ufw allow 10011/tcp bgneal@19: $ sudo ufw allow 41144/tcp bgneal@19: bgneal@19: Enjoy your new Teamspeak 3 server! bgneal@19: bgneal@19: .. _Teamspeak 3: http://www.teamspeak.com/ bgneal@19: .. _Teamspeak downloads page: http://www.teamspeak.com/downloads bgneal@19: .. _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: .. _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: .. _iptables: https://help.ubuntu.com/community/IptablesHowTo bgneal@19: .. _ufw: https://help.ubuntu.com/community/UFW