Setting up TeamSpeak 3 with Docker on DigitalOcean
Setting up TeamSpeak 3 on DigitalOcean with Docker is incredibly easy. This provides a cheap ($5/month) dedicated server for gamers. There are some amazing benefits to using DigitalOcean such as the ability to quickly create a droplet and use of their floating IP addresses. The default TeamSpeak 3 license will allow for 32 slots and 1 virtual server.
Custom DNS to Point to TeamSpeak Server
Using custom DNS will allow you to create a subdomain on your domain name and have it point to the TeamSpeak server. It’s easier to remember (teamspeak.milsimgroup.com) than an IP address. Plus, if you change your TeamSpeak server IP address you can update it in one place as opposed to having everyone else connect to a new IP address.
You can either point the DNS “A” record to the droplet’s IP address or use a floating IP address. In this demo, I will use the floating IP address.
Assuming I own this domain (milsimgroup.com), I would have the ability to manage it’s DNS. Once I’ve accessed my domain name in GoDaddy, I will see an option to “Manage DNS”. At the bottom right of the Manage DNS screen, there is an “Add” button. Click that.
“A Records” allow me to create a subdomain and point that to any IP address.
DigitalOcean’s Floating IP Address
If you use a floating IP address and have to recreate the droplet then you can instantly point it the floating IP address to the new droplet’s IP address. Otherwise, you will have to change the DNS record on the domain name to update the IP address. That will also include time for the DNS to propagate.
Docker: Running TeamSpeak
It’s important to use the Droplet’s IP Address and not the floating IP address. If you mistakenly use the floating IP address in the terminal you will get an error message saying there may be a man in the middle attack.
Droplet IP Address: 18.104.22.168
Floating IP Address: 22.214.171.124
Once you’ve successfully SSH’ed into the box you need to run these commands below.
Create a directory that will be mapped into the TeamSpeak container.
mkdir -p /var/tc3server
Now, you can spin up the Docker container for TeamSpeak.
# pull the teamspeak image
docker pull teamspeak
# run the teamspeak container
docker run -d --name teamspeak -p 9987:9987/udp -p 10011:10011 -p 30033:30033 -v /var/ts3server/:/var/ts3server/ -e TS3SERVER_LICENSE=accept teamspeak
TeamSpeak: Privilege Key
Since we are running the container in a detached state (-d flag) then we will need to get the logs to find the privilege key, admin and password.
docker logs teamspeak
Alternatively, you can access these logs in the host machine. They are located at /var/ts3server/logs
Accessing the Container
If you need to get into the TeamSpeak container then use this command to gain shell access:
docker exec -it teamspeak sh
Connecting to TeamSpeak
I will connect using the DNS name (teamspeak.milsimgroup.com) or the droplet’s floating IP address (126.96.36.199). Preferably, we should use the DNS name. If that hasn’t propagated then use the IP address.
In the logs it mentions that TeamSpeak’s VirtualServer is listening on port: 9987
Note: We also are using Docker so it’s important to make sure that port is mapped to the host machine and that the firewall allows this connection.
Gaining Administrator Privileges
Once you log in it states that administrator privileges have not been claimed. You can claim these using the privilege key we retrieved out of the docker logs.
It’s all set up. You can begin using your TeamSpeak 3 server now.