How To Install Sinusbot For Teamspeak 3 On Debian

Published on: Thu, Jan 7, 2016 at 5:54 am EST
Debian Game Servers Server Apps

Teamspeak is VoIP software for voice chatting with friends, but you can also listen and play music directly to its channels. This tutorial will explain how to create a music bot with Sinusbot. Sinusbot is a music bot for TS3 with a web-interface. You can configure it and play and upload songs through your web browser.

Requirements

  • Debian 8 VPS with 64-bit (amd64) architecture.
  • Open port 8087.
  • 5-10 minutes.
  • The bot uses about 30 MB of RAM and 10 MB of HDD, the remainder of the space can be used for songs.

Installing Sinusbot

If you meet the requirements, you can follow these steps to download and install the Sinusbot program.

apt-get update
apt-get install x11vnc xinit xvfb libxcursor1 ca-certificates bzip2 curl libglib2.0-0 nano sudo screen

Since it is dangerous to run the program as root, create a user exclusively for Sinusbot and give it a password:

adduser --disabled-login ts3bot
passwd ts3bot

Make a directory for the program, I recommend /opt/ts3soundboard. Give ownership to the ts3bot user:

mkdir -p /opt/ts3soundboard
chown ts3bot:ts3bot /opt/ts3soundboard

Going forward, we will be working with the ts3bot user. Let's give permissions to run some required commands as root:

visudo

You will see a file similar to the following appear in a text editor:

#
# This file MUST be edited with the 'visudo' command as root.
#
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
#
# See the man page for details on how to write a sudoers file.
#
Defaults        env_reset
Defaults        mail_badpass
Defaults        secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:$

# Host alias specification

# User alias specification

# Cmnd alias specification

# User privilege specification

At the end of the file, add the following line:

ts3bot    ALL=(ALL:ALL) ALL

Now, save your changes with Ctrl+O and Enter, then Ctrl+X and Enter. Then, login as ts3bot with following command:

su ts3bot
cd /opt/ts3soundboard

We are now in the directory where we will install Sinusbot and Teamspeak, so let's start with Sinusbot:

curl -O https://frie.se/ts3bot/sinusbot-0.9.8.tar.bz2
tar -xjf sinusbot-0.9.8.tar.bz2 
cp config.ini.dist config.ini

Done. Continue to the next section for Teamspeak.

Installing Teamspeak and Youtube-DL

As we are setting up a music bot for Teamspeak 3, we also need the Teamspeak 3 application and youtube-dl to play the music to server. Download both and give them permissions to run the set-up:

wget https://yt-dl.org/downloads/latest/youtube-dl -O /usr/local/bin/youtube-dl
wget http://dl.4players.de/ts/releases/3.0.18.2/TeamSpeak3-Client-linux_amd64-3.0.18.2.run
sudo chmod 755 TeamSpeak3-Client-linux_amd64-3.0.18.2.run
sudo chmod a+rx /usr/local/bin/youtube-dl

Run the TS installer:

./TeamSpeak3-Client-linux_amd64-3.0.18.2.run

Final configuration

Now, we have all we need for running the bot, let's configure it to run properly:

nano config.ini

Update the config.ini file to include the directories of Teamspeak3 and youtube-dl:

TS3Path = "/opt/ts3soundboard/TeamSpeak3-Client-linux_amd64/ts3client_linux_amd64"

YoutubeDLPath = "/usr/local/bin/youtube-dl"

Save the file and exit nano. Move a music-playing plugin to the Teamspeak directory:

cp plugin/libsoundbot_plugin.so /opt/ts3soundboard/TeamSpeak3-Client-linux_amd64/plugins

Edit permissions for the Sinusbot program and check for updates:

sudo chmod 755 ts3bot
./ts3bot -update

You can start the program and play music now, but it will close after closing your SSH client. You may run it in a screen session to prevent it from closing when you quit your SSH session.

su root
screen
su ts3bot

Run the following command to start Sinusbot:

xinit /opt/ts3soundboard/ts3bot -- /usr/bin/Xvfb :1 -screen 0 800x600x16 -ac

You will see the program output some start-up information. At this point, it's running. You can now access the web-interface with your browser, where you can upload and play songs. Navigate to:

http://your-server-ip:8087/

The default login for the web interface is admin as the user, and foobar for the password. Newer versions of Sinusbot do not use the foobar password, instead they print a random password to the console on the first startup. Remember to change the password immediately.

Enjoy your music bot!

Want to contribute ?

You could earn up to $300 by adding new articles