How To Run Team Fortress 2: Source Dedicated Server (TF2 DS) as a Windows Service with FireDaemon
Team Fortress 2 is a first person action game. The dedicated server component can be run as a Windows Service using FireDaemon. FireDaemon will allow you to have the dedicated server start automatically at boot prior to login, allow you to start multiple instances of the dedicated server and so forth. This HOWTO will show you how set it up. You can also use FireDaemon Fusion to manage FireDaemon and other Windows services via a web browser.
TF2 Dedicated Server Setup Under FireDaemon
- First download and extract SteamCMD. The download is small (< 2 MB).
- Download the TF2 server files via Valve’s content servers. First before you can download the files, go to the directory where you installed SteamCMD and create a shortcut to "SteamCMD.exe". Next edit the properties of the shortcut and in the target box, at the end of it (with a space before the following), put:
+login anonymous +force_install_dir "C:\TF2" +app_update 232250 validate +quit
The target box should now look something like:
C:\SteamCMD\steamcmd.exe +login anonymous +force_install_dir "C:\TF2" +app_update 232250 validate +quit
Now click the shortcut you created and let it run (it might take a few hours to update everything). You should also run the shortcut every week or so to grab the latest server updates (stop your server first though).
- Install FireDaemon Pro into the directory of your choice (typically C:\Program Files\FireDaemon). FireDaemon can be downloaded from here.
- TF2 uses 1 configuration file to store it’s settings. By default the configuration file is not included, see the end of this HOWTO for an example.
- At the top of this HOWTO, you can download the service definition file which makes initial setup of your FireDaemon service easier.
- Next start the FireDaemon GUI from the desktop shortcut. Click on the "Create a new service definition" button in the toolbar (or type Ctrl+N) and enter the information into the fields as you see below. Obviously adjust paths to suite your installation. Pay special attention to the Parameters list.
The most important field on the tab is the Parameters. The Parameters define the initial setup of your server.
Here’s the full parameter list you should have:
-console -game tf -secure +map ctf_2fort -autoupdate +log on +maxplayers 24 -port 27015 +ip 220.127.116.11 +exec server.cfg
Below is an example server.cfg file:
- "-console” enables text base server display. The server can only be automatically restarted in text based mode.
- “-game” loads the mod.
- “-secure” enables VAC protection of your server (valve anti cheat). You can remove this command if you do not want to use VAC.
- “+map” loads a specified map on server startup. You can change “ctf_2fort” to whatever map you want. This command should never be removed.
- “-autoupdate” Enables auto update of the server, valve has not implemented this in windows so you will have to manually update SRCDS/TF2 yourself. It’s simply here for the sake of legacy support if valve ever decides to add it.
- “+log on” Displays the output of information on the screen. You can turn optionally it off (+log off), but keeping it on makes it easier to debug any errors you might encounter.
- “maxplayers 24” This controls the maximum of amount of players you want your server to run. You can only control the max players on server startup. This command should never be removed. Team Fortress 2 can only handle up to 24 players, to get 32 players something special needs to be done, more information on this at the end of this tutorial.
- “-port 27015” This is the default server port for SRCDS. You can change it to anywhere from 27015 to 27020. Changing it is generally used when you host multiple servers (as each server has to use its own port when using the same IP). This command should never be removed.
- “+ip” should be the IP of your computer (not 127.0.0.1, go here to get your IP). This command should never be removed.
- “+exec server.cfg” This simply executes your server.cfg file on server startup. If you run multiple servers from the same installation, you can specify other config files (eg. server2.cfg)
- Now click on the Settings tab. If you DON'T want to see your dedicated server running, uncheck the Interact with Desktop check box & select "Hidden" from the "Show Window" dropdown. You can optionally run NS2DS as the user you installed it as. In the Logon Account field type your username (eg. Administrator) and then enter the user's password twice in the Password and Confirm fields. You can change the Process Priority to allocate more CPU time to the dedicated server or specify which CPU or core the dedicated server will run on (in the case of multi-processor, hyperthreaded or multi-core CPUs).
- Now click on the Lifecycle tab. Uncheck Graceful Shutdown as SRCDS doesn't respond to it.
- Now click on the Dependencies tab. Make sure the service depends on the lanmanworkstation (Workstation) service to ensure the TCP/IP and CIFS stacks are both up prior to starting SRCDS.
- Now click on the Install button to install and start tf2!
You can easily generate your own configuration from here.Code:hostname "Team Fortress 2" rcon_password "" fps_max 600 sv_allowdownload 1 sv_allowupload 1 net_maxfilesize 64 pausable "0" // Voice Comm sv_voiceenable "1" sv_alltalk 0 sv_pure 1 sv_allowdownload 1 sv_downloadurl "" sv_filetransfercompression 1 // Quickplay: https://support.steampowered.com/kb_article.php?ref=2825-AFGJ-3513 tf_server_identity_account_id "" tf_server_identity_token "" mp_timelimit 60 mp_friendlyfire 0 mp_tkpunish 1 mp_autokick 1 mp_fadetoblack 1 mp_falldamage 0 mp_logmessages 1 mp_weaponstay 1 sv_region 0 sv_lan 0 // bandwidth rates/settings sv_minrate 0 sv_maxrate 0 sv_minupdaterate 10 sv_maxupdaterate 33 sv_mincmdrate 10 sv_maxcmdrate 33 sv_client_cmdrate_difference 1 sv_client_predict 1 sv_client_interpolate 1 sv_client_min_interp_ratio -1 sv_client_max_interp_ratio -1 //sv_timeout 300 sv_timeout 21600 decalfrequency 60 log on sv_logbans 1 sv_rcon_banpenalty 60 sv_rcon_maxfailures 10 sv_rcon_minfailures 5 sv_rcon_minfailuretime 45 // TF2 Specific tf_playergib 1 tf_stats_track 1 tf_stats_verbose 0 mp_maxrounds 3 mp_enableroundwaittime 1 mp_bonusroundtime 45 mp_stalemate_timelimit 300 mp_idlemaxtime 360 sv_cacheencodedents 1 mp_autoteambalance 1 mp_autoteambalance_delay 60 mp_autoteambalance_warning_delay 30 mp_teams_unbalance_limit 1 mp_chattime 10 // TF2 Clan CVARS // mp_clan_ready_signal "go" //Text that team leader from each team must speak for the match to begin // mp_clan_readyrestart 1 //If non-zero, game will restart once someone from each team gives the ready signal // Exec Configs exec banned.cfg exec banned_ip.cfg exec banned_user.cfg exec listip.cfg mapchangecfgfile server.cfg mapcyclefile mapcycle.txt
Valve recommends that Team Fortress 2 servers be 24 players at maximum. You can host more, but you should be aware that your server will be penalized in the quickplay pool.