How to Install and Use TeamSpeak Server on CentOS 7

TeamSpeak is a VOIP or Voice Over Internet Protocol server. It provides voice communication features which can be used in various fields like online gaming, educational training, business communication etc. TeamSpeak has first released in 2001 since then it is in active development.

In this tutorial, we will install TeamSpeak Server on CentOS 7 server.

Prerequisite

  • Minimal CentOS 7 server
  • Root privileges. This guide is written as the root user, if you are logged in as sudo user, run sudo -i.

Update Base System

Before installing any package it is recommended that you update the packages and repository using the following command.

yum -y update

Once your system is updated, proceed further to install the dependencies required.

Install Dependencies

You will need to install several dependencies for TeamSpeak to work. Install the dependencies by typing:

yum -y install nano wget perl tar net-tools bzip2

Once the dependencies are installed, you can proceed further to add a user for TeamSpeak Server process. This will ensure that the TeamSpeak server is running in user mode and is isolated from other processes of the server.

Run the following command to add a TeamSpeak user.

adduser teamspeak -d /opt/teamspeak

The above command will add the user teamspeak and the home directory will be set to /opt/teamspeak.

Install TeamSpeak

TeamSpeak provides a prebuilt binary archive which supports major Linux platforms. Download the archive by running the following command.

wget http://dl.4players.de/ts/releases/3.0.13.8/teamspeak3-server_linux_amd64-3.0.13.8.tar.bz2

You can always find the link to the latest version of the application by going to TeamSpeak download page. Extract the archive by running the following command.

tar xvf teamspeak3-server_linux_amd64*.tar.bz2

Now move all the files to the home directory of TeamSpeak user by running the following command.

mv teamspeak3-server_linux_amd64/* /opt/teamspeak

Cleanup the installation archive and directory by running:

rm -rf teamspeak3-server_linux_amd64*

Set the ownership of the application files to TeamSpeak user by running:

chown -R teamspeak: /opt/teamspeak

TeamSpeak is now installed on your server, you can proceed further to start TeamSpeak server.

Starting TeamSpeak

TeamSpeak provides an installer script to start and manage TeamSpeak server. To start the TeamSpeak server you can switch to TeamSpeak user and run the following command.

su - teamspeak
./ts3server_startscript.sh start inifile=ts3server.ini

You will see the following output if the server is started successfully.

[teamspeak@centos ~]$ ./ts3server_startscript.sh start inifile=ts3server.ini
Starting the TeamSpeak 3 server
TeamSpeak 3 server started, for details please view the log file
[teamspeak@centos ~]$
------------------------------------------------------------------
                      I M P O R T A N T
------------------------------------------------------------------
               Server Query Admin Account created
         loginname= "serveradmin", password= "4CQJv1kq"
------------------------------------------------------------------

To stop the TeamSpeak server, you can run the following command.

./ts3server_startscript.sh stop

Output:

[teamspeak@centos ~]$ ./ts3server_startscript.sh stop
Stopping the TeamSpeak 3 server done

You can switch to the root user by typing exit command.

Configuring Systemd Service

Although, TeamSpeak server can be easily managed using the commands above, it is recommended to setup a systemd service unit so that you can start and manage the server using the service. This will also ensure that the service is automatically started at boot time.

Create a new systemd service file by running the following command.

nano /lib/systemd/system/teamspeak.service

Populate the file with the following content.

[Unit]
Description=TeamSpeak Server Service
After=network.target

[Service]
Type=forking
WorkingDirectory=/opt/teamspeak/
ExecStart=/opt/teamspeak/ts3server_startscript.sh start inifile=ts3server.ini
ExecStop=/opt/teamspeak/ts3server_startscript.sh stop
User=teamspeak
Group=teamspeak
PIDFile=/opt/teamspeak/ts3server.pid
Restart=always
RestartSec=9
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=teamspeak

[Install]
WantedBy=multi-user.target

Save the file and exit from the editor. Now you can start TeamSpeak using:

systemctl start teamspeak

To configure TeamSpeak to automatically start at boot time, use.

systemctl enable teamspeak

To check if TeamSpeak service is started correctly, you can run the following command to check the status of the TeamSpeak service.

systemctl status teamspeak

Conclusion

In this tutorial, we have learnt how to install TeamSpeak on CentOS 7 Server. The clients can now connect to the server and enjoy the features provided by TeamSpeak.

Share this page:

10 Comment(s)