Creating Teamspeak server on Ubuntu

Hello,

I am attempting a Teamspeak server on Ubuntu22.04. The problem that I’m having, is when I create the System file to have the server start when the system boots up, it will not run. Even when I start the server using the start script, it still won’t let me connect. I have all the ports open that I read should be open.

I host servers, and I’ve had a teamspeak server I hosted before, and now I want it back.

I am not sure where I am going wrong here.

Hi,

which guide did you follow for the installation, and what exact steps did you do so far?

Also, what happens when you start the server manually with the start script? Does it show any errors? Could you post the console output when the server starts?

It would also help to see your systemd service file (the system file you created) and maybe the server log files. That makes it much easier to see where the problem is.

Since you mentioned ports: did you only open them in the firewall, or also check if the server is actually listening on them (netstat / ss)?

Hello,

I am using this tutorial, which has helped me the last two times I did this.

I know the last time I tried, the journal command I ran said something about an error 202.php. Will upload the service file in my next reply. My initial thought that the thing about ExecStart and the inifile being on the same line might have had something to do with it. When I start it with the script, it just says not to run the server under the root user. In theory, when using the start script, it looks like it’s running, but the service file won’t start it, and I put all the contents of the service file that was described by the tutorial linked above.

So, I ran journalctl, -u teamspeak, and this is what it gave me on my last run. One thing was I didn’t have the license file in the right place, so I fixed it. The command gave me this, which I’m having difficulty understanding.

Feb 21 06:07:40 intheeyehosting.info systemd[1]: teamspeak.service: Control process exited, code=exited, status=4/NOPER

</blockquote.

Here are the contents of my service file.

[Service]

Description=TeamSpeak 3 server

After=network.target
[Service]
WorkingDirectory=/home/teamspeak/teamspeak3-server_linux_amd64
User=teamspeak
Group=teamspeak
Type=forking
ExecStart=/home/teamspeak/teamspeak3-server_linux_amd64/ts3server_startscript.sh start inifile=ts3server.ini
ExecStop=/home/teamspeak/teamspeak3-server_linux_amd64/ts3server_startscript.sh stop
PIDFile=/home/teamspeak/teamspeak3-server_linux_amd64/ts3server.pid
RestartSec=15
Restart=always
[Install]
WantedBy=multi-user.target

Last reply, this time around. I am replying as I remember the information you asked for.

I did the steps set forth in tht tutorial I linked in a previous reply. I created the teamspeak user, then I downloaded the server with wget. Then I extracted the contents of the tar file, and removed the .tar.bz2 archive. Then I nabigate into the directory that resulted from the extracted archive, and created the file to accept the license terms. Then I create the system file. Last night I started it with the script, and did the step to retrieve the privelige key, and it let me do it. But when I put in my server’s hostname to start working on the server, it wouldn’t connect.

If I forgot anything you asked for, please let me know
@vinookie

it seems like you try to start the server with a user wich does not have the proper rights or something i guess?

maybe this will help for you as it did for some of my friends:
sudo -i
apt update
apt -y upgrade
apt -y install wget bzip2 tar ca-certificates

adduser --disabled-login --gecos “” teamspeak
mkdir -p /opt/teamspeak
chown teamspeak:teamspeak /opt/teamspeak

TSVER=“3.13.7”
cd /tmp
wget -O “ts3server_${TSVER}.tar.bz2” “https://files.teamspeak-services.com/releases/server/${TSVER}/teamspeak3-server_linux_amd64-${TSVER}.tar.bz2”

tar -xjf “ts3server_${TSVER}.tar.bz2” -C /opt/teamspeak --strip-components=1
chown -R teamspeak:teamspeak /opt/teamspeak

sudo -u teamspeak touch /opt/teamspeak/.ts3server_license_accepted

sudo -u teamspeak /opt/teamspeak/ts3server_startscript.sh start serveradmin_password=‘DEIN_STARKES_PASSWORT’

THIS IS NEEDED TO GET SERVER ADMIN ACESS TOKEN :
sudo -u teamspeak tail -n 80 /opt/teamspeak/logs/ts3server_*.log

sudo -u teamspeak /opt/teamspeak/ts3server_startscript.sh stop

apt -y install ufw
ufw allow 22/tcp
ufw allow 9987/udp
ufw allow 30033/tcp

ufw allow 10011/tcp
ufw --force enable
ufw status verbose

one print - >

_______________________________________________________

cat > /etc/systemd/system/teamspeak.service <<‘EOF’
[Unit]
Description=TeamSpeak 3 Server
After=network-online.target
Wants=network-online.target

[Service]
Type=simple
User=teamspeak
Group=teamspeak
WorkingDirectory=/opt/teamspeak

ExecStart=/opt/teamspeak/ts3server_minimal_runscript.sh
ExecStop=/bin/kill -SIGTERM $MAINPID

Restart=on-failure
RestartSec=5s
StartLimitIntervalSec=60
StartLimitBurst=10

LimitNOFILE=100000

NoNewPrivileges=true
PrivateTmp=true
ProtectSystem=full
ProtectHome=true
ReadWritePaths=/opt/teamspeak

[Install]
WantedBy=multi-user.target
EOF

______________________________

systemctl daemon-reload
systemctl enable --now teamspeak.service
systemctl status teamspeak.service --no-pager

ss -lntup | grep -E ‘(:9987|:30033|:10011)’