Running a Teeworlds Dedicated Server on Linux
Download the Teeworlds server binary on Linux, install required 32-bit libraries, configure autoexec.cfg, and set up a systemd service for automatic startup and crash recovery.
Teeworlds Dedicated Server on Linux
Step 1 — Download the Server Binary
mkdir ~/teeworlds-server && cd ~/teeworlds-server
wget https://downloads.teeworlds.com/teeworlds-0.7.5-linux_x86_64.tar.gz
tar -xzf teeworlds-0.7.5-linux_x86_64.tar.gz --strip-components=1
The archive contains teeworlds_srv and the data/ directory.
Step 2 — Install 32-bit Libraries
The Teeworlds server binary is 32-bit only, even on 64-bit Linux. Without the 32-bit compatibility libraries, teeworlds_srv will fail with No such file or directory or Exec format error.
Ubuntu / Debian:
sudo dpkg --add-architecture i386
sudo apt update
sudo apt install -y libc6:i386 libstdc++6:i386
CentOS / RHEL / Fedora:
sudo yum install glibc.i686 libstdc++.i686
Verify the binary runs:
./teeworlds_srv -v
Step 3 — Create autoexec.cfg
cat > ~/teeworlds-server/autoexec.cfg << 'EOF'
sv_name My Linux Teeworlds Server
sv_port 8303
sv_max_clients 12
sv_map dm1
sv_gametype dm
sv_register 1
sv_rcon_password changeme
sv_maprotation dm1 dm2 dm6 dm7
sv_rounds_per_map 3
EOF
Step 4 — Open the Firewall Port
sudo ufw allow 8303/udp
sudo ufw reload
Step 5 — Set Up a systemd Service
Create /etc/systemd/system/teeworlds.service:
[Unit]
Description=Teeworlds Dedicated Server
After=network.target
[Service]
Type=simple
User=teeworlds
WorkingDirectory=/home/teeworlds/server
ExecStart=/home/teeworlds/server/teeworlds_srv
Restart=on-failure
RestartSec=10
StandardOutput=journal
StandardError=journal
SyslogIdentifier=teeworlds
[Install]
WantedBy=multi-user.target
Create the service user and set permissions:
sudo useradd -m -s /bin/bash teeworlds
sudo mkdir -p /home/teeworlds/server
sudo cp -r ~/teeworlds-server/* /home/teeworlds/server/
sudo chown -R teeworlds:teeworlds /home/teeworlds/server
Enable and start:
sudo systemctl daemon-reload
sudo systemctl enable teeworlds
sudo systemctl start teeworlds
sudo systemctl status teeworlds
View logs:
journalctl -u teeworlds -f
Multiple Servers with -f Flag
Run separate instances with different config files:
./teeworlds_srv -f dm_server.cfg &
./teeworlds_srv -f ctf_server.cfg &
Each config file specifies a different sv_port. Create a separate systemd service unit for each instance.
Alternative: LinuxGSM
LinuxGSM provides a management wrapper for Teeworlds with install scripts, update commands, and start/stop/restart helpers:
curl -Lo linuxgsm.sh https://linuxgsm.sh && chmod +x linuxgsm.sh
bash linuxgsm.sh twserver
./twserver install
LinuxGSM handles the 32-bit library check, directory layout, and basic systemd integration automatically.
Config File Location
autoexec.cfg can be placed in:
- The server binary directory (recommended)
~/.teeworlds/for the user running the server