Ts3soundboardbot /Sinusbot - more instances [for Ubuntu]

Qraktzyl

Retired Staff
Contributor
Nov 2, 2015
997
723
161
*Tutorial restored from by browser cache* :)

For 0.9.8 (sinusbot), video tutorial made by @Joxiii :
https://r4p3.net/threads/have-more-...h-docker-containers-on-ubuntu.1080/#post-8692

Hello R4P3 community,

Today i'll be explaining you guys how to run more than 6 instances with the ts3soundboard. Please note that this setup is not optimal, because you will have several admin panels (eg.http://yourip:8087, http://yourip:8088, http://yourip:8089, etc). A crack would be way better. I recommend using the old ts3bot version (0.9.5) as the creator doesn't seem to be limiting the number of instances by ip and don't know if he'll actually do it in the newest versions cause let's be honest here, he only wants your money. In this tutorial, I'll be referring to "ts3bot" and "sinusbot", the ts3bot version being the one with maximum 6 instances (0.9.5) and sinusbot version being the one with maximum 2 instances (0.9.8+). I'm not sure if i'll be releasing the script for 0.9.8.
We will be running all those bots on 1 VPS with docker containers. Experienced users only. Make sure you have enough ram and processing power. I won't be explaining how to install docker on your distribution, just check to those link here :

What is a docker?
How to install docker

I am assuming that you correctly installed docker and that your permissions are correctly assigned to your user.
YOU NEED TO HAVE A KERNEL OF VERSION 3.10+! DOCKER WILL NOT WORK OTHERWISE!
Code:
uname -r


examples:
2.6.32-42-pve WILL NOT WORK!
3.19.0-33-generic WILL WORK!


I also recommend installing shipyard as this will give you a webinterface to manage your docker containers and easily deploy your docker image.

Credits for my docker scripts goes to a guy called jtanderson. Those scripts have been modified to fit my needs, as the original script didn't support youtube-dl and needed it to download from youtube.

You need to create a user, add him to the docker group.:
Code:
adduser tsbot
sudo usermod -aG docker tsbot


Then change to this user:
Code:
su tsbot

1- Create a folder called "mydockerscript"

Code:
mkdir mydockerscript

2- Go inside that folder. Create a file called "dockerfile" and paste this script inside of it:
TESTED ON UBUNTU.
Code:
FROM ubuntu

#VOLUME ["/tsmusic"]

ENV TSBOT_URL https://frie.se/ts3bot/ts3soundboardbot-0.9.5.tar.bz2
ENV TEAMSPEAK_URL http://dl.4players.de/ts/releases/3.0.18.2/TeamSpeak3-Client-linux_amd64-3.0.18.2.run

# Download TS3 file and extract it into /opt.
ADD ${TSBOT_URL} /opt/
RUN cd /opt && tar -xf /opt/ts3soundboardbot*.tar.bz2

ADD ${TEAMSPEAK_URL} /opt/ts3soundboard/
RUN cd /opt/ts3soundboard && chmod 0755 TeamSpeak3-Client-linux_amd64-3.0.18.2.run
RUN sed -i 's/^MS_PrintLicense$//' /opt/ts3soundboard/TeamSpeak3-Client-linux_amd64-3.0.18.2.run
RUN cd /opt/ts3soundboard && ./TeamSpeak3-Client-linux_amd64-3.0.18.2.run

# Install prerequisites
RUN apt-get -y update && apt-get -y upgrade
RUN apt-get -y install x11vnc xinit xvfb libxcursor1 libglib2.0-0 xorg openbox wget
RUN wget -O "/usr/local/bin/youtube-dl" "https://yt-dl.org/downloads/latest/youtube-dl" && \
chmod a+rx "/usr/local/bin/youtube-dl" && \
locale-gen --purge en_US.UTF-8 && \
echo LC_ALL=en_US.UTF-8 >> /etc/default/locale && \
echo LANG=en_US.UTF-8 >> /etc/default/locale && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
groupadd -g 3000 -r "ts3soundboard" && \
useradd -u 3000 -r -g "ts3soundboard" -d "/opt/ts3soundboard" "ts3soundboard"

# Copy the plugin into the client and update the bot
RUN cp /opt/ts3soundboard/libsoundbot_plugin.so /opt/ts3soundboard/TeamSpeak3-Client-linux_amd64/plugins
RUN chown -R ts3soundboard /opt/ts3soundboard && \
chmod 755 /opt/ts3soundboard/ts3bot
RUN /opt/ts3soundboard/ts3bot -update

# Add a startup script
ADD run.sh /run.sh
RUN chmod 755 /*.sh

EXPOSE 8087
CMD ["/run.sh"]

3 - Create a script file called "run.sh" and paste this inside of it:
#!/bin/bash

rm -rf /tmp/.X*
rm -f /tmp/TS3*

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

Make it executable :
Code:
chmod +x run.sh

4- We build the image

Code:
docker build -t ts3soundboard095 pathofmydockerscriptfolder
pathofmydockerscriptfolder being the path of your "mydockerscript" folder created in step 1. You should also already be in that folder, so you can get the path by doing "pwd".

5- Run the first docker container from the image we just created ("ts3soundboard095")
Code:
docker run --restart=always -d --name bot1 -p 8087:8087 ts3soundboard095
You will now be able to access your first ts3soundboard panel by going to http://yourip:8087

6- Run more docker containers from our "ts3soundboard095" image.
Code:
docker run --restart=always -d --name bot2 -p 8088:8087 ts3soundboard095
You will now be able to access your second ts3soundboard panel by going to http://yourip:8088

Change 8088 to 8089 if you want a third container running... Also change the name of the container to bot3. And so on...
Code:
docker run --restart=always -d --name bot3 -p 8089:8087 ts3soundboard095
 
Last edited:

Joxiii

Discord hater!
Feb 2, 2016
271
182
92
REUPLOAD

78 % CPU utilization and 970 MB RAM utilization :D
It Works ! xD
2CLkksC.png
 
Last edited:

kingston

Contributor
Feb 10, 2016
243
151
128
This seems cool but docker isn't either free or even cheap software. What do we do after 30 days of trial? :)
 

Qraktzyl

Retired Staff
Contributor
Nov 2, 2015
997
723
161
This seems cool but docker isn't either free or even cheap software. What do we do after 30 days of trial? :)
Docker is open-source, I know there is a company version of some sort but the one i'm referring to is open source. (Free)
 

kingston

Contributor
Feb 10, 2016
243
151
128
Yes it is open source but i have never found out about it being free and unlimited at the same time. It doesn't say like that on their website and all you can download is a 30-days trial. I would suspect that open source version is limited in many ways. Correct me if i'm wrong. What will happen after 30 days? I'm confused because a free software usually says that clearly and this is not happening in this case. Are you on trial edition, too?

I'm even more interested to know if Joxiii setup all those containers with open source or trial?

Well. Just found out that it needs kernel 3.1+ anyway. Not a solution for me to consider at this time but still great to see that such interesting solutions begin to surface and of course thanks alot for sharing this.
 
Last edited:

kingston

Contributor
Feb 10, 2016
243
151
128
People who don't understand even basics behind this and need spoon feeding shouldn't really be using this solution. Jesus. How long does it take to google what docker is and what platforms are supported and what the conditions are?

Anyway this isn't for most servers as it requires lots of memory and some cpu power. Unless you run on dedicated there aren't many chances of taking this live with many bots. Not on cheap VPS at least that usually has up to 512MB of ram and of which most is eaten up by TS itself. And not to mention the need for 3.1+ kernel (unless the VPS provider runs it you can't have it in your openvz VPS - and those are the most common and cheapest these days).
 

cROWN

Member
Sep 25, 2015
142
54
63
People who don't understand even basics behind this and need spoon feeding shouldn't really be using this solution. Jesus. How long does it take to google what docker is and what platforms are supported and what the conditions are?

Anyway this isn't for most servers as it requires lots of memory and some cpu power. Unless you run on dedicated there aren't many chances of taking this live with many bots. Not on cheap VPS at least that usually has up to 512MB of ram and of which most is eaten up by TS itself. And not to mention the need for 3.1+ kernel (unless the VPS provider runs it you can't have it in your openvz VPS - and those are the most common and cheapest these days).
Already installed docker, just got a Question what to do with the txt file in point 2? I saved it as dockerfile.txt and what should i do with it then?
 

Qraktzyl

Retired Staff
Contributor
Nov 2, 2015
997
723
161
Already installed docker, just got a Question what to do with the txt file in point 2? I saved it as dockerfile.txt and what should i do with it then?
It's only dockerfile not dockerfile.txt. File with no extension.
 

0vert1m3

Active Member
Oct 4, 2015
216
175
91
I have a problem, i have installed all without any errors but the bot cant joint any teamspeak server and the error log is empty .
 
Top