System & Automation Architect
Someone asked me to write a tutorial about how to setup a teamspeak server on Ubuntu 15.04. If you got any problems after using this tutorial, please make a comment. I made this tutorial in a way I think is the best, if you got any improvements or want to use something else please tell me.
Prerequisites
What we will do
Install MariaDB MariaDB is a replacement for MySQL with a better performance. The database will hold all users/settings etc. of the Teamspeak server instead of SQLlite. Inside your droplet use the following command:
sudo apt-get install mariadb-client mariadb-server
Once the install process is finished, you have to firstly setup your MariaDB install with new root password (default is blank). Issue this command:
/usr/bin/mysql_secure_installation
Enter current password for root (enter for none): Enter
Set root password? [Y/n] Y
Remove anonymous users? [Y/n] y
Disallow root login remotely? [Y/n] Depends on what you want
Remove test database and access to it? [Y/n] y
Reload privilege tables now? [Y/n] y
Now the MariaDB service should be running with a new root password.
Lets configure the database now. We will create a new user and database for the Teamspeak server. Create the database with your own password:
sudo mysql -u root -p
create database teamspeak3;
GRANT ALL PRIVILEGES ON teamspeak3.* TO teamspeak3@localhost IDENTIFIED BY 'PASSWORD';
flush privileges;
quit
Install Teamspeak First we will create a new user with its own directory in /opt/. Then we will download the latest teamspeak server and unpack it.
sudo useradd -d /opt/teamspeak3-server -m teamspeak3-user
Now download, extract, move and change permissions of the teamspeak server files:
sudo wget http://dl.4players.de/ts/releases/3.0.11.4/teamspeak3-server_linux-amd64-3.0.11.4.tar.gz
sudo tar -zxvf teamspeak3-server_linux-amd64-3.0.11.4.tar.gz
sudo mv teamspeak3-server_linux-amd64/* /opt/teamspeak3-server
sudo chown teamspeak3-user:teamspeak3-user /opt/teamspeak3-server -R
sudo rm -fr teamspeak3-server_linux-amd64-3.0.11.4.tar.gz teamspeak3-server_linux-amd64
Symlink library libmariadb.so.2 from /redist folder to TeamSpeak3 server directory.
sudo ln -s /opt/teamspeak3-server/redist/libmariadb.so.2 /opt/teamspeak3-server/libmariadb.so.2
Run ldd to prints the shared libraries required by TeamSpeak3 server.
sudo ldd /opt/teamspeak3-server/libts3db_mariadb.so
If libmariadb.so.2 ==> not found shows, use the following command:
sudo apt-get install libmariadb2
Configure Teamspeak We are going to configure TeamSpeak3 server with the MySQL-MariaDB database, We have to manually create configfiles:
Create blacklist configfile.
sudo touch /opt/teamspeak3-server/query_ip_blacklist.txt
Create whitelist configfile.
sudo cat << EOT > /opt/teamspeak3-server/query_ip_whitelist.txt
127.0.0.1
EOT
Create configfile with MySQL-MariaDB database option.
sudo nano /opt/teamspeak3-server/ts3server.ini
With the following inside of it:
machine_id=
default_voice_port=9987
voice_ip=0.0.0.0
licensepath=
filetransfer_port=30033
filetransfer_ip=0.0.0.0
query_port=10011
query_ip=0.0.0.0
query_ip_whitelist=query_ip_whitelist.txt
query_ip_blacklist=query_ip_blacklist.txt
dbsqlpath=sql/
dbplugin=ts3db_mariadb
dbsqlcreatepath=create_mariadb/
dbpluginparameter=ts3db_mariadb.ini
dbconnections=10
logpath=logs
logquerycommands=0
dbclientkeepdays=30
logappend=0
query_skipbruteforcecheck=0
Create the configfile for the database for the TeamSpeak3 server. Change PASSWORD the same password you have created configuring MySQL database.
sudo nano /opt/teamspeak3-server/ts3db_mariadb.ini
Input:
[config]
host=127.0.0.1
port=3306
username=teamspeak3
password=PASSWORD
database=teamspeak3
socket=
Now you need to change permissions of the new config files:
sudo chown teamspeak3-user:teamspeak3-user /opt/teamspeak3-server -R
Now the configuration is done.
Create ts3 init script of TeamSpeak3 server (autostart)
sudo nano /etc/init.d/ts3
With:
#! /bin/sh
### BEGIN INIT INFO
# Provides: ts3
# Required-Start: $network mysql
# Required-Stop: $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: TeamSpeak3 Server Daemon
# Description: Starts/Stops/Restarts the TeamSpeak Server Daemon
### END INIT INFO
set -e
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DESC="TeamSpeak3 Server"
NAME=teamspeak3-server
USER=teamspeak3-user
DIR=/opt/teamspeak3-server
OPTIONS=inifile=ts3server.ini
DAEMON=$DIR/ts3server_startscript.sh
#PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME
# Gracefully exit if the package has been removed.
test -x $DAEMON || exit 0
sleep 2
sudo -u $USER $DAEMON $1 $OPTIONS
Now change permissions for the scripts:
sudo chmod a+x /etc/init.d/ts3
sudo chmod a+x /opt/teamspeak3-server/ts3server_startscript.sh
sudo chmod a+x /opt/teamspeak3-server/ts3server_minimal_runscript.sh
sudo update-rc.d ts3 defaults
Now everything should be done, and ready to go. Lets start the Teamspeak3 server for the first time:
sudo /etc/init.d/ts3 start
You will first see the serveradmin password and token key. Make sure you save the serveradmin password somewhere save. With this you can query inside your teamspeak server. For the token key, you can also look in the logs:
/opt/teamspeak3-server/logs
Hit enter, and its all running.
Hope this worked for you. Please do not comment or answer if it has got nothing to do with this.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
sudo mysql -u root -p create database teamspeak3; GRANT ALL PRIVILEGES ON teamspeak3.* TO teamspeak3@localhost IDENTIFIED BY ‘PASSWORD’; flush privileges; quit
This should read: sudo mysql -u root -p create database teamspeak3; GRANT ALL PRIVILEGES ON teamspeak3.* TO ‘teamspeak3’@‘localhost’ IDENTIFIED BY ‘PASSWORD’; flush privileges; quit
Hy guys, To error “2017-08-10 13:06:14.692019|CRITICAL|ServerLibPriv | |Server() unable to initialize database TeamSpeak 3 server could not start” you can see http://terminal28.com/how-to-install-and-configure-teamspeak3-server-linux-debian-ubuntu/ and try whith “Helpful informations:”, I into command “su - teamspeak3-user ./ts3server_minimal_runscript.sh start inifile=ts3server.ini” and the server start! :D
Could you please add a tutorial on how to insert the NPL licencekey? Or just some instructions.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.