Introduction

Installation and configuration of the Teamspeak server software and setup of a service so that the software can be run in the background.

Requirements

  • A Linux or Windows server (Dedicated, KVM or LCX)
  • Root / Administrator rights on the system
  • A systemd compatible Linux

Step 1 - Preparations

Steps for Linux Systems

Create a new user in whose context the Teamspeak server should be executed later.

root@your_host:~# useradd -m -s /bin/false ts

Steps for Windows Systems

Installing NSSM (Non-Sucking Service Manager) will later register the Teamspeak server as a Windows service.

The latest version of NSSM can be downloaded here. (Latest release) https://nssm.cc/download

Then simply open the downloaded ZIP file and navigate to the folder with the appropriate architecture of your server.

Here you can easily copy nssm.exe to C:\Windows\System32\

This completes the installation of NSSM.

Step 2 - Installing the Teamspeak software

Steps for Linux Systems

Copy link of the appropriate Teamspeak software to the clipboard (second button) https://teamspeak.com/en/downloads/#server

For installation, the following steps must be performed on the system

Download Teamspeak software (use the link copied above)

root@your_host:~# su --shell /bin/bash ts
ts@your_host:~$ wget -P /tmp/ https://files.teamspeak-services.com/releases/server/3.6.1/teamspeak3-server_linux_amd64-3.6.1.tar.bz2

Unpack the downloaded archive

ts@your_host:~$ tar xjf /tmp/teamspeak3-server_linux_amd64-3.6.1.tar.bz2 -C /home/ts

Accept Teamspeak license agreement

ts@your_host:~$ touch /home/ts/.ts3server_license_accepted

(optional) There are also other options available to accept the license agreement.

Please set the environment variable TS3SERVER_LICENSE to "accept" in order to accept the license agreement.

Alternatively, create a file named ".ts3server_license_accepted" in the working directory or start the server with the command line parameter "license_accepted=1".

To view the license agreement set TS3SERVER_LICENSE to "view" in order to print the license to the console.

Alternatively view the file "LICENSE" in your favorite text viewer yourself.

Change the file permissions

ts@your_host:~$ chmod +x /home/ts/ts3server_startscript.sh
ts@your_host:~$ chmod +x /home/ts/ts3server_minimal_runscript.sh
ts@your_host:~$ chmod +x /home/ts/ts3server

First start of the server (this data should be saved)

ts@your_host:~$ /home/ts/ts3server_minimal_runscript.sh

2019-03-16 19:30:44.119638|INFO |SQL | db_CreateTables() tables created

------------------------------------------------------------------
                      I M P O R T A N T                           
------------------------------------------------------------------
               Server Query Admin Account created                 
         loginname= "serveradmin", password= "DC+sOsIL"
------------------------------------------------------------------
^
2019-03-16 19:30:45.093089|WARNING |VirtualServer |1  |

------------------------------------------------------------------
                      I M P O R T A N T                           
------------------------------------------------------------------
      ServerAdmin privilege key created, please use it to gain 
      serveradmin rights for your virtualserver. please
      also check the doc/privilegekey_guide.txt for details.

       token=q20aDScWvOLg+XL5PpWXUPumhPFaDkStVKE9BpSZ
------------------------------------------------------------------

2019-03-16 19:30:45.093331|INFO |Query |listening for query on 0.0.0.0:10011, [::]:10011

Steps for Windows Systems

Download the Teamspeak software from: https://teamspeak.com/de/downloads/#server

Unpack the archive into a folder. (e.g. C:\teamspeak)

First start of the server

  • Accept license agreement
  • Save server query data
  • End server via the tray icon

Step 3 - Setting up the service

In order for Teamspeak to be able to run as a background process without an active login, a service must be created.

Steps for Linux Systems

Create the service:

  • Create the systemd service

    root@your_host:~# nano /etc/systemd/system/ts.service
  • The following must be inserted into the file

    [Unit]
    Description=TeamSpeak 3 Server
    After=network.service
    
    [Service]
    User=ts
    Group=ts
    Type=forking
    WorkingDirectory=/home/ts/teamspeak3-server_linux_amd64/
    ExecStart=/home/ts/teamspeak3-server_linux_amd64/ts3server_startscript.sh start
    ExecStop=/home/ts/teamspeak3-server_linux_amd64/ts3server_startscript.sh stop
    PIDFile=/home/ts/teamspeak3-server_linux_amd64/ts3server.pid
    RestartSec=15
    Restart=always
    
    [Install]
    WantedBy=multi-user.target

Register the service:

  • Load new service entries and changes

    root@your_host:~# systemctl daemon-reload
  • Activate service (will be started automatically after a reboot)

    root@your_host:~# systemctl enable ts.service

The following command can be used to manage the service.

root@your_host:~# systemctl start/stop/restart ts.service

Steps for Windows Systems

Start NSSM via CMD (parameter is the service name)

C:\Users\Administrator>nssm install teamspeak

In the "Application" tab, on "Path" the Teamspeak Server application path must be specified. (e.g. C:\Users\Administrator\teamspeak\ts3server.exe)

On "Startup directory" you have to specify the whole application folder. (in this case C:\Users\Administrator\teamspeak\ )

All other settings are optional. If you want to change something afterwards, you can edit the service with the command nssm edit teamspeak.

Afterwards the Teamspeak server can be used normally as a Windows service.

Conclusion

This article has shown what steps are necessary to install a Teamspeak 3 server on Windows or Linux systems and register the Teamspeak software as a service.

Was this answer helpful? 0 Users Found This Useful (0 Votes)