If you have never heard of Teamspeak, it is an application that allows you to have voice communications with other people over a network. It is really handy for playing video games, as you can avoid having stop to type all the time to communicate with your friends. I recently had an need to run a Teamspeak server for myself and a few friends, but I didn't want to rent a server to run it. This article will detail how I set up Teamspeak, configured the server, and configured my firewall to allow connections.
There is nothing really special about the box. It is a an old Dell Pentium 3 workstation running FreeBSD 6.1-stable. You may remember this machine from my webcam article.
There isn't a whole lot to installing the software. The entire install took me about 5 minutes.
# cd /usr/ports/audio/teamspeak_server # make install clean
Before we start the server, we need to add a line to the rc.conf file to tell it to automatically start the server at boot. You can start the server without this, but the script wants the line there and we might as well do it now before we forget. Add the following line to your /etc/rc.conf file:
teamspeak_enable="YES"
Now we can use the supplied rc.d script to start the server.
# /usr/local/etc/rc.d/teamspeak-server.sh start Starting teamspeak.
The server is now running, and all that is left to do is configure it.
The Teamspeak Server runs a web interface to allow configuration of the server. By default this service runs on port 14534. In order to log into the web interface for the first time you will need the admin or superadmin password. These passwords are randomly generated when the server starts. After starting the server, look at the server.log file, which is generated in the same location that the executable is stored.
# cat /usr/local/lib/teamspeak_server/server.log --------------------------------------------------------------- -------------- log started at 11-06-06 01:00 ------------- --------------------------------------------------------------- 11-06-06 01:00:15,ALL,Info,server, Server init initialized 11-06-06 01:00:15,ALL,Info,server, Server version: 2.0.20.1 Linux 11-06-06 01:00:15,WARNING,Info,SQL, created table ts2_servers 11-06-06 01:00:15,WARNING,Info,SQL, created table ts2_server_privileges 11-06-06 01:00:15,WARNING,Info,SQL, created table ts2_channels 11-06-06 01:00:15,WARNING,Info,SQL, created table ts2_channel_privileges 11-06-06 01:00:15,WARNING,Info,SQL, created table ts2_clients 11-06-06 01:00:15,WARNING,Info,SQL, created table ts2_bans 11-06-06 01:00:16,ALL,Info,server, Starting VirtualServer id:1 with port:8767 11-06-06 01:00:16,WARNING,Info,SERVER, Default VirtualServer created 11-06-06 01:00:16,WARNING,Info,SERVER, admin account info: username: admin password: xxxxxx 11-06-06 01:00:16,WARNING,Info,SERVER, superadmin account info: username: superadmin password: xxxxxx 11-06-06 01:00:17,ALL,Info,server, Server init finished 11-06-06 01:00:17,WARNING,Info,server, TeamSpeak Server daemon activated 11-06-06 13:39:19,ALL,Info,server, Server shutdown initialized 11-06-06 13:39:21,ALL,Info,server, Server shutdown finished --------------------------------------------------------------- --------------- log ended at 11-06-06 13:39 -------------- --------------------------------------------------------------- --------------------------------------------------------------- -------------- log started at 11-06-06 13:39 ------------- --------------------------------------------------------------- 11-06-06 13:39:26,ALL,Info,server, Server init initialized 11-06-06 13:39:26,ALL,Info,server, Server version: 2.0.20.1 Linux 11-06-06 13:39:26,ALL,Info,server, Starting VirtualServer id:1 with port:8767 11-06-06 13:39:27,ALL,Info,server, Server init finished 11-06-06 13:39:27,WARNING,Info,server, TeamSpeak Server daemon activated
Where I have xxxxxx you will find your passwords. All that is left to do now is connect to the web interface and set up the server to your liking. Open a browser and navigate to the address of your server on port 14534. You should see a page that looks like the one in the image below. We will want to initially log in a superadmin to configure the server, so click the superadmin login link below the form. Why they made you go to a seperate form to log in as superadmin is beyond me, but it was far from intuitive the first time I used the interface.
Once you are logged in, you will first want to click "SuperAdmin Manager" on the left and add a user for yourself. Once that is completed, click "Servers" on the left, and then click the "Select" button at the far right to choose your server (you should only have one).
Now we are getting to the settings that control how your server operates. Choose the "Server settings" link on the left. This section has the global settings for your server, including the server name, welcome message, password, codecs, and a few other settings. For my server, I chose to use a password so not everyone who stumbled across the server could connect. I also disabled most of the codecs since I rarely use any except Speex 24.6k. Once you are done on this page click "Save".
Next, click "User manager" on the left and add an admin user for yourself. This is the user that you will log in to the server with. You want to log in as an admin user in case you want to create channels, edit the existing channels, or manage users while in the server.
That is pretty much all there is to setting up the server. Browse around the rest of the settings that are available to see what's there, but this is all you really need to configure to get up and running. If you want to view the HTML manual locally, and have Apache running on the Teamspeak host, simple do the following.
# ln -s /usr/local/lib/teamspeak_server/Manual/ /usr/local/www/data/tsmanual
Then point your browser to http://yourserver/tsmanual/default.htm.
Now for the fun part, testing the server. Head on over to www.goteamspeak.com in your browser and download the latest client application for your platform. I am going to use the Win32 client, since that is what I use on my gaming machine. At the time of this writing, the latest client is Teamspeak 2 RC2 version 2.0.32.60. One you have installed and started the application, right click on "Servers" and click "Add Server". Give your server a name to identify it, then fill in the login information to the right. Make sure to choose "Registered" so you can enter the admin login information you added.
Once you have everything filled out, click "Connect". If you get a window similar to the following, all that's left is to get a friend to connect to test the server!
Now that the server is running and you can connect locally, you will probably want to allow your friends to connect. Since they will be outside of your firewall, you will need to add some rules to pass traffic to the host running Teamspeak. I run OpenBSD's PF firewall software, so if you run something different it is up to you to figure out how to pass the traffic in with your firewall. In my case I added the following to my pf.conf file, and reloaded the config.
rdr on $ext_if proto udp from any to $ext_if port 8767 -> $ts_server port 8767 ... pass in log quick on $ext_if inet proto udp from any to $ts_server port 8767
Once you have the appropriate rules added to your firewall, have a friend try and connect to your public IP address. If all goes well, they should connect in to your Teamspeak server and you should be ready to talk to each other.
Setting up a Teamspeak server is far from difficult. If you have a need for voice communications, Teamspeak can provide a fast, free, and easy solution. Configuring the client can be harder than setting up the server, as many people have problems configuring their microphone. For all questions concerning the client, I would recommend going to the Teamspeak website at www.goteamspeak.com.