A Comprehensive Guide to Setting Up a TeamSpeak Server in Docker on Ubuntu

When it comes to self-hosted voice communication, TeamSpeak stands out as a preferred choice for those who prioritize control over their channels compared to mainstream platforms like Discord. This article will walk you through the process of deploying a TeamSpeak server using Docker on an Ubuntu Server, making it easy to manage and scale.

Installing Docker on Ubuntu Server

To run a TeamSpeak server container on Ubuntu, you’ll first need to install Docker. Follow these straightforward steps:

  1. Open a Terminal: Start by accessing the terminal on your Ubuntu Server.

  2. Install Required Packages: Use the following command to install necessary packages that will facilitate Docker installation:

    sudo apt install apt-transport-https ca-certificates curl software-properties-common
  3. Add Docker’s GPG Key: Next, you’ll need to download the GPG key necessary for accessing Docker’s software repository. Execute this command:

    curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
  4. Add Docker Repository: After adding the GPG key, you should add Docker’s official repository to your system:

    sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
  5. Update Package Index: Refresh your package data with:

    sudo apt update
  6. Install Docker: Finally, install Docker CE (Community Edition) with the following command:

    sudo apt install docker-ce

Creating Your TeamSpeak Docker Compose File

Using Docker Compose allows for easy deployment and management of multi-container applications like TeamSpeak. Here’s how to set it up:

  1. Create a New File: In your terminal, create a docker-compose.yml file:

    touch docker-compose.yml
  2. Open File for Editing: Launch the file in the Nano text editor:

    nano -w docker-compose.yml
  3. Insert Configuration: Copy and paste the following configuration into your docker-compose.yml file:

    version: '3.1'
    services:
     teamspeak:
       image: teamspeak
       restart: always
       ports:
         - 9987:9987/udp
         - 10011:10011
         - 30033:30033
       environment:
         TS3SERVER_DB_PLUGIN: ts3db_mariadb
         TS3SERVER_DB_SQLCREATEPATH: create_mariadb
         TS3SERVER_DB_HOST: db
         TS3SERVER_DB_USER: root
         TS3SERVER_DB_PASSWORD: example
         TS3SERVER_DB_NAME: teamspeak
         TS3SERVER_DB_WAITUNTILREADY: 30
         TS3SERVER_LICENSE: accept
     db:
       image: mariadb
       restart: always
       environment:
         MYSQL_ROOT_PASSWORD: example
         MYSQL_DATABASE: teamspeak
  4. Update Passwords: It is crucial to change both TS3SERVER_DB_PASSWORD and MYSQL_ROOT_PASSWORD from "example" to secure, memorable passwords to protect your server.

  5. Save and Exit: Save your changes by pressing Ctrl + O, followed by Ctrl + X to exit the editor.

Deploying Your TeamSpeak Server on Linux

After setting up your docker-compose.yml file, it’s time to deploy your TeamSpeak server:

  1. Gain Root Access: Use one of the following commands to get root privileges in your terminal:

    su

    or

    sudo -s
  2. Start the Server: Run the following command to deploy your TeamSpeak server in the background:

    docker compose up -d

    Docker will download the necessary images, configure settings, and start your TeamSpeak server, a process that may take a few minutes.

  3. Verify Deployment: To check if everything is running smoothly, type:

    docker ps

    This command will list all active Docker containers, including your new TeamSpeak server.

Connecting to Your TeamSpeak Server

To access your newly deployed TeamSpeak server, you’ll need to ensure you have the following:

  • IP Address or Hostname: Obtain the IP address or hostname of your TeamSpeak server.
  • Port Forwarding: Set up the appropriate port forwarding to allow external connections. For optimal results, you may consider using Tailscale.
  • TeamSpeak Client: Download the TeamSpeak client compatible with your operating system, whether it’s Linux, macOS, Windows, or mobile.

Once equipped with these components, you’ll be ready to enjoy seamless communication via your self-hosted TeamSpeak server.


This guide not only empowers you to host your communication solutions but also offers a rewarding experience in managing your server environment. Stay connected and leverage TeamSpeak for an enhanced interaction in your gaming or professional endeavors!

By Alex Reynolds

Tech journalist and digital trends analyst, Alex Reynolds has a passion for emerging technologies, AI, and cybersecurity. With years of experience in the industry, he delivers in-depth insights and engaging articles for tech enthusiasts and professionals alike.