Since the server will likely not have a UI, so the download must be done with a command
The command to download teamspeak (Find the most recent version and download instead):
wget -O teamspeak-server.tar.bz2 http://dl.4players.de/ts/releases/3.0.13.8/teamspeak3-server_linux_amd64-3.0.13.8.tar.bz2
Now we extract teamspeak using the following command:
tar -xvf teamspeak-server.tar.bz2 --one-top-level=teamspeak-server --strip-components=1
This should leave you with a nice structure like this (generated with tree -L 1 teamspeak-server
):
teamspeak-server
├── CHANGELOG
├── doc
├── libts3db_mariadb.so
├── libts3db_sqlite3.so
├── LICENSE
├── redist
├── serverquerydocs
├── sql
├── ts3server
├── ts3server_minimal_runscript.sh
├── ts3server_startscript.sh
└── tsdns
You will need a teamspeak user that can be used to run teamspeak
sudo adduser --disabled-login teamspeak
Now we copy the teamspeak-server folder to the home directory of teamspeak user
sudo mv teamspeak-server/ /home/teamspeak/
Make sure everything in the teamspeak-server folder is owned by teamspeak. Use this command just in case:
sudo chown -R teamspeak:teamspeak /home/teamspeak
sudo -u teamspeak touch /home/teamspeak/teamspeak-server/.ts3server_license_accepted
sudo ln -s /home/teamspeak/teamspeak-server/ts3server_startscript.sh /etc/init.d/teamspeak
sudo update-rc.d teamspeak defaults
sudo service teamspeak start
sudo service teamspeak status
The first line must be done to tell teamspeak that you have accepted the license, otherwise running the server will fail.
The other lines use systemd to start teamspeak.
The first time the server starts, it will give you some server details that look like:
Jun 01 06:12:01 ip-172-31-81-106 teamspeak[4319]: loginname= "serveradmin", password= "L5LG4NuF"
Jun 01 06:12:01 ip-172-31-81-106 teamspeak[4319]: ------------------------------------------------------------------
Jun 01 06:12:02 ip-172-31-81-106 teamspeak[4319]: ------------------------------------------------------------------
Jun 01 06:12:02 ip-172-31-81-106 teamspeak[4319]: I M P O R T A N T
Jun 01 06:12:02 ip-172-31-81-106 teamspeak[4319]: ------------------------------------------------------------------
Jun 01 06:12:02 ip-172-31-81-106 teamspeak[4319]: ServerAdmin privilege key created, please use it to gain
Jun 01 06:12:02 ip-172-31-81-106 teamspeak[4319]: serveradmin rights for your virtualserver. please
Jun 01 06:12:02 ip-172-31-81-106 teamspeak[4319]: also check the doc/privilegekey_guide.txt for details.
Jun 01 06:12:02 ip-172-31-81-106 teamspeak[4319]: token=BVRU+58gUKIDBwxO5vC4Q1EFdyOYwFY97Zds4a7D
Jun 01 06:12:02 ip-172-31-81-106 teamspeak[4319]: ------------------------------------------------------------------
Copy this information and use it to log into the teamspeak server.
What we did above will work as long as nothing goes wrong and we don't restart our machine. To have teamspeak automatically start at boot, we need to implement a more sophisticated mechanism for running it.
Create this file: /etc/systemd/system/teamspeak.service
[Unit]
Description=Run the Teamspeak Server
After=network.target network-online.target
Requires=network-online.target
[Service]
Type=forking
User=teamspeak
Group=teamspeak
PIDFile=/home/teamspeak/teamspeak-server/ts3server.pid
ExecStartPre=/bin/rm -f /home/teamspeak/teamspeak-server/ts3server.pid
ExecStart=/home/teamspeak/teamspeak-server/ts3server_startscript.sh start inifile=/home/teamspeak/ts3server.ini
ExecStop=/home/teamspeak/teamspeak-server/ts3server_startscript.sh stop
ExecReload=/home/teamspeak/teamspeak-server/ts3server_startscript.sh restart inifile=/home/teamspeak/ts3server.ini
Restart=on-abort
RestartSec=5
[Install]
WantedBy=multi-user.target
You will notice the above commands in the Service
section makes mention of a ts3server.ini
file.
This will be your configuration file for teamspeak. You can choose to create one or copy the one I have
below into /home/teamspeak/ts3server.ini
.
machine_id=
default_voice_port=9987
voice_ip=
licensepath=
filetransfer_port=13337
filetransfer_ip=
query_port=10011
query_ip=0.0.0.0, ::
query_ip_whitelist=query_ip_whitelist.txt
query_ip_blacklist=query_ip_blacklist.txt
dbplugin=ts3db_sqlite3
dbpluginparameter=
dbsqlpath=sql/
dbsqlcreatepath=create_sqlite/
dbconnections=10
logpath=/home/teamspeak/teamspeak-logs
logquerycommands=0
dbclientkeepdays=30
To have the server create one for you, consult for the command teamspeak-server/doc/server_quickstart.txt
sudo systemctl daemon-reload
sudo service teamspeak restart
An excerpt from the docs
ATTENTION! In some cases, the server process terminates on startup and the error message reads “Server() error while starting servermanager, error: instance check error”.
As long as you do not use a license key we make sure you only run exactly one instance of the TS3 server free unregistered version. We use shared memory to facilitate the communication to detect other running instances, which requires tmpfs to be mounted at
/dev/shm
.If you (for whatever reason) do not have this mounted, the above error will occur. To fix this problem, the following commands or file edits need to be done as root user (or using something like sudo). This is a temporary fix until your next reboot.
mount -t tmpfs tmpfs /dev/shm
Now, to make sure this mount is done automatically upon reboot edit the file
/etc/fstab
and add the line:tmpfs /dev/shm tmpfs defaults 0 0