本教程适用于Ubuntu

开始安装,设置密码,其他信息可以随便填写

sudo adduser teamspeak

输入刚刚设置的密码,进行登录

su teamspeak

返回根目录

cd

开始git,自行替换链接,去官网获取对应的版本下载地址,强烈建议转存到其他对象存储服务器中,国内大概率git失败,也可以使用我的镜像地址https://xxx.im-xg.cn/s%2Facgpan%2F23%2FXqcg96WZ_teamspeak3-server_linux_amd64-3.13.3.tar.bz2

wget https://files.teamspeak-services.com/releases/server/3.13.3/teamspeak3-server_linux_amd64-3.13.3.tar.bz2

解压刚刚下载的文件,文件名可能略有不同,请按实际情况修改

tar xvf teamspeak3-server_linux_amd64-3.13.3.tar.bz2

移动解压的文件到home/TeamSpeak文件夹

cd teamspeak3-server_linux_amd64 && mv * /home/teamspeak && cd .. && rm -rf teamspeak3*

登录管理员账户,输入ssh链接的账户密码登录

su root

接受许可

touch /home/teamspeak/.ts3server_license_accepted

调整ts文件的用户权限

chown -R teamspeak:teamspeak /home/teamspeak

编辑teamspeak.service文件,i键开始编辑,esc退出编辑,:wq保存并退出

vi /lib/systemd/system/teamspeak.service

下方内容复制粘贴进去,并保存

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

[Service]
WorkingDirectory=/home/teamspeak/
User=teamspeak
Group=teamspeak
Type=forking
ExecStart=/home/teamspeak/ts3server_startscript.sh start inifile=ts3server.ini
ExecStop=/home/teamspeak/ts3server_startscript.sh stop
PIDFile=/home/teamspeak/ts3server.pid
RestartSec=15
Restart=always

[Install]
WantedBy=multi-user.target
systemctl --system daemon-reload
systemctl enable teamspeak.service
systemctl start teamspeak.service
systemctl status teamspeak.service

开放端口

iptables -A INPUT -p udp --dport 9987 -j ACCEPT
iptables -A INPUT -p udp --sport 9987 -j ACCEPT
iptables -A INPUT -p tcp --dport 30033 -j ACCEPT
iptables -A INPUT -p tcp --sport 30033 -j ACCEPT
iptables -A INPUT -p tcp --dport 10011 -j ACCEPT
iptables -A INPUT -p tcp --sport 10011 -j ACCEPT

首次连接需要输入密钥token,使用下方指令获取

cat /home/teamspeak/logs/ts3server_*

有不懂的可以留言