Skip to content

Team Fortress 2: Server Commands

The essential console commands for your Team Fortress 2 server: change maps, kick and ban players, adjust game rules, and manage bots.

30 November 20264 min read0 Views0 helpful

Don't have your own server yet? Host your Team Fortress 2 server with ZAP-Hosting from €4.49 / month.Or try 3 days from €0.81

Introduction

Use server commands to control your Team Fortress 2 server while it’s running: change the map, kick or ban players, adjust rules, or add bots. In this guide, we’ll show you where to enter commands and which ones you’re most likely to need.

Where to enter commands

In ZapX, open your server’s Console tab. Enter each command there without a slash, then press Enter to run it. The server’s response appears directly in the console.

Commands that change a setting (for example, mp_timelimit 20) only apply until the next restart. To make a setting permanent, add it to the custom.cfg file in the tf/cfg folder. Server Configuration explains how.

Info

Your server resets the server name and password to the values in the Startup Parameters in the Configuration tab every time it starts. So hostname and sv_password in the console are only suitable for temporary changes.

To control your server remotely without opening the panel, use RCON.

Get information

CommandDescription
statusShows connected players, their user IDs, and connection information
usersShows user information for the connected players
versionShows the server’s version information
statsShows basic server performance statistics
find <suchtext>Searches for console commands and variables whose name or description matches the search text
Tip

You can find a player’s user ID, which you need for kick or banid, in the output of status.

Change maps

CommandDescription
changelevel <kartenname>Switches to the specified map without restarting the server process
map <kartenname>Restarts the specified map and loads it as the current server map
maps [filter]Lists available maps, optionally filtered by search text, for example, maps pl_
nextlevel [kartenname]Shows or sets the map for the next map change
mapcyclefile [dateiname]Shows or sets the map cycle file in use

Set the map your server starts with using Starting Map in the startup parameters. For custom maps and Workshop maps, see Install Mods.

Manage players

CommandDescription
kick <spielername|userid> [grund]Removes a player from the server
banid <minuten> <userid> [kick]Bans the user ID for the specified duration. Use kick to remove the player immediately
removeid <steamid>Removes the ban for the specified Steam ID
listidShows saved bans by user ID
writeidSaves bans by user ID to the ban file
addip <minuten> <ip-adresse>Bans the specified IP address for the specified duration
removeip <ip-adresse>Removes the ban for the specified IP address
listipShows saved IP bans
writeipSaves IP bans to the ban file
say <nachricht>Sends a message from the server to all players
Important

After banid or addip, also run writeid or writeip, respectively. The ban is only added to the ban file after you do this.

Adjust game rules

CommandDescription
mp_timelimit [minuten]Time limit per map in minutes
mp_maxrounds [runden]Maximum number of rounds per map
mp_winlimit [runden]Number of round wins a team needs to end the map
mp_restartgame <sekunden>Restarts the game after the specified delay
mp_autoteambalance [0|1]Automatically balances teams
mp_teams_unbalance_limit [anzahl]Permitted difference in the number of players on each team
mp_friendlyfire [0|1]Allows damage to teammates
mp_allowspectators [0|1]Allows spectators
mp_forcecamera [0|1|2]Determines which players a dead player can spectate
mp_disable_respawn_times [0|1]Disables respawn delays
mp_respawnwavetime [sekunden]Respawn wave time
mp_waitingforplayers_time [sekunden]Duration of the waiting period before the game starts
mp_stalemate_enable [0|1]Sudden-death phase in the event of a tie
tf_weapon_criticals [0|1]Random critical hits
tf_damage_disablespread [0|1]Disables random weapon damage spread
sv_gravity [wert]Gravity on the server
sv_alltalk [0|1]Voice chat across teams
sv_voiceenable [0|1]Voice chat on the server

If you enter one of these commands without a value, the console shows you its current value.

Bots

CommandDescription
tf_bot_quota [anzahl]Target number of bots
tf_bot_quota_mode [normal|fill|match]Mode used to manage the number of bots
tf_bot_difficulty [0|1|2|3]Bot difficulty, from 0 (easy) to 3 (expert)

To learn how to configure bots permanently, see Add Bots.

Administration

CommandDescription
hostname [servername]Shows or sets the server name until the next restart
sv_password [passwort]Shows or sets the server password until the next restart; an empty value removes it
sv_cheats [0|1]Allows cheat commands; useful for testing only
exec <dateiname>Runs the commands in a configuration file, for example, exec custom.cfg
Warning

Don’t set sv_lan to 1. Your server will only be visible on the local network and won’t be accessible over the internet.

Conclusion

You now know the most important commands for controlling your Team Fortress 2 server while it’s running. For added convenience, such as an in-game admin menu, you can use SourceMod. See Become an Admin. If you have any other questions, our support team is available every day! 🙂

Free tools

Team Fortress 2 Tools

View all

Feedback

Was this article helpful?

Your feedback helps us prioritize and improve content.

0 of 0 people found this article helpful.

Personal support

Need more help than the guide provides?

Our ZAP-Hosting support team knows your product — briefly describe your issue and we'll help you personally.

Zappy knows this guide and answers you right in the chat.