In my previous article on How to run Teamspeak3 onDigital Ocean the instructions have you create a teamspeak3 user and change ownership of the files. I noticed in some of the comments over there that people noticed it was running as root, not the greatest thing for security.
I noticed my server was also running as root, here’s how to fix it if you used my instructions:
Shut down Teamspeak:
sudo service teamspeak3 stop
Remove the /etc/init.d/teamspeak3 soft link:
sudo rm /etc/init.d/teamspeak3
Now edit /etc/init.d/teamspeak3 and set the contents to this:
#!/bin/sh
su -c "/usr/local/teamspeak3/ts3server_startscript.sh [email protected]" teamspeak3
Set the file to be executable:
sudo chmod u+x /etc/init.d/teamspeak3
Fix permissions, many of the Teamspeak files are probably owned by root now which would prevent the server from starting:
Digital Ocean provides a Virtual Private Server for just $5 a month. It also happens to be perfect to run a Teamspeak 3 server on. Teamspeak is a great way to chat with friends while playing games or pair programming.
This how-to assumes you’re running Ubuntu 12.04 (or something close to it) and that you already have your server spun up and ready to SSH into. Visit the Community section of Digital Ocean if you need further help.
Step 1 – Get TeamSpeak 3
Our first step is to download the TeamSpeak 3 server from teamspeak.com. Make sure you’re in a directory you own and then execute the following command:
And then give the user we created permission to our new directory:
sudo chown -R teamspeak3 /usr/local/teamspeak3
Step 5 – Have TeamSpeak 3 Start on Droplet Boot Up
The TeamSpeak software package comes with an init script that we have to run as a the teamspeak3 user.
Create and set the content of the /etc/init.d/teamspeak3 file to this:
#!/bin/sh
su -c "/usr/local/teamspeak3/ts3server_startscript.sh [email protected]" teamspeak3
Set the file to be executable:
sudo chmod u+x /etc/init.d/teamspeak3
And then tell the server to start TeamSpeak when the Droplet starts
sudo update-rc.d teamspeak3 defaults
For the first time we will start it by hand:
sudo service teamspeak3 start
You should see the output similar to the following:
Copy the output from this step and save it somewhere safe, you will need it in a later step.
Step 6 – Open the Firewall Port
If you’re running a firewall on your droplet you will have to open the TeamSpeak 3 server port, 9987. Here’s how to allow that port using UFW – Uncomplicated Firewall: