keepcalculator

06 Numbers and Powers

Run a TeamSpeak Server in Docker on a VPS

Card No. 06·71338 · Updated · Standard formula, shown below

This guide walks you through deploying a TeamSpeak 3 server inside a Docker container on a VPS. You’ll get a fully functional voice server with persistent data, automatic restarts, and easy updates—all without installing TeamSpeak directly on the host system. You’ll need a VPS with a public IP, SSH access, and Docker installed.

What You’ll Need

  • A VPS running Linux (Ubuntu 22.04 or Debian 11/12 recommended) with root or sudo access.
  • SSH client (like PuTTY on Windows or Terminal on macOS/Linux).
  • Docker and Docker Compose installed on the VPS. If not installed, the guide includes commands to install them.
  • A domain name (optional, but useful for a clean connection URL).
  • Open UDP and TCP ports 9987 (voice), 10011 (server query), and 30033 (file transfer) in your VPS firewall.

Step-by-Step

  1. Connect to your VPS via SSH: ssh user@your_server_ip. Update the system packages: sudo apt update && sudo apt upgrade -y (for Debian/Ubuntu).
  2. Install Docker if not present. Use the official convenience script: curl -fsSL https://get.docker.com -o get-docker.sh && sudo sh get-docker.sh. Verify with docker --version.
  3. Install Docker Compose plugin (if not included): sudo apt install docker-compose-plugin. Check with docker compose version.
  4. Create a directory for TeamSpeak data: mkdir -p ~/teamspeak && cd ~/teamspeak.
  5. Create a docker-compose.yml file using a text editor: nano docker-compose.yml. Paste the following configuration:
    version: "3.8"
    services:
      teamspeak:
        image: teamspeak:latest
        restart: unless-stopped
        ports:
          - "9987:9987/udp"
          - "10011:10011"
          - "30033:30033"
        environment:
          TS3SERVER_LICENSE: accept
        volumes:
          - ./teamspeak-data:/var/ts3server
        

    Save and exit (Ctrl+X, Y, Enter).

  6. Start the container: sudo docker compose up -d. Docker will pull the official TeamSpeak image and start it.
  7. Check the logs to get the server admin token and the server query admin password: sudo docker compose logs teamspeak. Look for lines like ServerAdmin privilege key created and ServerQuery Admin Account created. Save these credentials securely.
  8. Open the required ports in your firewall. For UFW: sudo ufw allow 9987/udp && sudo ufw allow 10011/tcp && sudo ufw allow 30033/tcp. If using a cloud provider’s firewall, add rules in their console.
  9. Test the server by connecting from the TeamSpeak client. Use your VPS IP address as the server address and the default port 9987. Enter the server admin token when prompted to gain admin rights.
  10. Optional: Set up a reverse proxy or DNS if you have a domain. Point an A record to your VPS IP and use that hostname in the client.

Common Mistakes

  • Forgetting to accept the license: The environment variable TS3SERVER_LICENSE: accept is mandatory. Without it, the container exits immediately.
  • Blocked ports: Many VPS providers have a firewall by default. You must explicitly allow UDP 9987 and TCP 10011/30033 both in the OS firewall and in the provider’s control panel.
  • Using the wrong protocol: Port 9987 is UDP, not TCP. If you forward TCP only, clients cannot connect.
  • Not persisting data: If you don’t mount a volume, all settings and user data are lost when the container is recreated. Always mount ./teamspeak-data:/var/ts3server.
  • Running as root without sudo: Docker commands often require root privileges. Use sudo or add your user to the docker group.

Tips

  • Use a named volume instead of a bind mount for better portability: volumes: - teamspeak-data:/var/ts3server and then declare volumes: teamspeak-data: at the bottom of the compose file.
  • Back up your data regularly by copying the teamspeak-data folder or the named volume. You can use docker run --rm -v teamspeak-data:/data -v $(pwd):/backup alpine tar czf /backup/teamspeak-backup.tar.gz -C /data .
  • Update the server by running sudo docker compose pull and then sudo docker compose up -d. Your data persists.
  • Set a server password in the TeamSpeak client after logging in with admin token, under Server Permissions.
  • Use a firewall rule that only allows your friends’ IPs if you want extra security, but be careful not to lock yourself out.

Troubleshooting

Container exits immediately: Check logs with sudo docker compose logs. Most likely you forgot the license acceptance. Add the environment variable and restart.

Can’t connect to the server: Verify the container is running (sudo docker ps). Check that the ports are listening: sudo ss -tulpn | grep -E '9987|10011|30033'. If not, your firewall is blocking. Also ensure your VPS provider allows these ports in its security group.

Server admin token not shown in logs: If you already started the container before, the token is generated only the first time. You can reset it by stopping the container, deleting the teamspeak-data volume (careful, this erases all settings), and restarting. Alternatively, use the server query to create a new token.

High latency or voice issues: Ensure UDP 9987 is open and not throttled. Some VPS providers throttle UDP; consider a provider that doesn’t. Also check your client’s voice activation settings.

Permission denied when running Docker commands: Add your user to the docker group: sudo usermod -aG docker $USER, then log out and back in.

Frequently Asked Questions

Q: How do I get the admin token if I lost it?
A: You can reset the server by deleting the teamspeak-data folder and restarting the container. This generates a new token but also resets all settings. To avoid this, back up the folder regularly.

Q: Can I run multiple TeamSpeak servers on one VPS?
A: Yes, by running multiple containers with different ports (e.g., 9988/udp, 10012/tcp). Use different port mappings in the compose file.

Q: How do I update the TeamSpeak server?
A: Run sudo docker compose pull to get the latest image, then sudo docker compose up -d. Your data remains intact.

Q: Is it safe to expose the server query port (10011) to the internet?
A: It is not recommended. The server query allows full control. Restrict access to your IP using firewall rules, or use a VPN.

Q: Can I use a domain name instead of an IP?
A: Yes, point an A record to your VPS IP and use that domain in the TeamSpeak client. You may also want to set up a SRV record, but it’s optional.

Q: What are the system requirements for a small TeamSpeak server?
A: A single vCPU and 1GB RAM is enough for up to 20 concurrent users. Disk space is minimal (a few hundred MB).

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.

More cards in this drawer

The whole Numbers and Powers drawer →