Team Fortress 2

Team Fortress 2

69 ratings
How to ACTUALLY set up a free Windows Team Fortress 2 Community Server Using WindowsGSM
By EierkuchenHD
This tutorial will guide you through the process of setting up a Team Fortress 2 community server for free using WindowsGSM.
3
4
3
3
3
3
3
2
2
2
2
3
3
2
2
2
2
2
2
2
2
2
2
   
Award
Favorite
Favorited
Unfavorite
Step 1: Turning on UPnP and Port Forwarding in the Router Settings
Enable UPnP and set up port forwarding on your router. UPnP (Universal Plug and Play) allows devices on your network to automatically configure port forwarding, making it easier for applications to connect to the internet. Port forwarding, on the other hand, directs specific incoming traffic to a designated device on your network.

To begin, make sure that you are connected via Ethernet, and that any Proxy or VPN is turned off, or else you cannot connect to your router's web interface.

Next, log into your router's web interface by entering its IP address into your web browser. This address can be found by searching for Terminal in your Windows Search, opening it up, and typing ipconfig. Under Standardgateaway, you will find the local IP address of your router that you need to enter into your webbrowser's search.



Then, enter your router’s password (and username if needed), which are often found on a sticker on the router itself.

Once logged in, look for the UPnP settings, typically found under advanced or network settings. Ensure UPnP is enabled.

Next, navigate to the port forwarding section. Here, you need to add new rules for the following ports:

  • TCP: 27015-27015
  • UDP: 27015-27015

Enter these port ranges and direct them to the local IP address of the computer that will run the server. Your local IP address can be found by looking for IPv4-Address after typing ipconfig in your Terminal. Save your changes and name the gateways something recognizable, such as Source Dedicated Server.

If you do not have access to your router's web interface, an alternative method is using UPnP PortMapper.
Step 2: Using UPnP PortMapper to Port Forward
Download UPnP Portmapper[github.com] from the official GitHub repository. This tool simplifies the port forwarding process by utilizing UPnP capabilities. Note that UPnP PortMapper requires Java to run. You need to have AdoptOpenJDK installed, with a minimum version of 11.3. You can download it from the AdoptOpenJDK website[adoptium.net]. Once Java is installed, open UPnP PortMapper with it by right clicking on the jar. file. Again, make sure you are not running a VPN.



In the UPnP PortMapper interface, click on Connect. It will then automatically search for routers in the network.



If it was unsuccessful in finding routers, you may need to click on PortMapper Settings... and change the UPnP Library to either SBBIRouterFactory or WeUPnPRouterFactory. Then, apply these settings and click on Connect.

If UPnP PortMapper was unsuccessful in finding your router, skip this step entirely and enable a fake IP (see Step 6).

Then, on the right, click on Create... in order to add port mappings.



Under Description, add a recognizable name, such as Source Dedicated Server. Under Internal Client, paste in your local IPv4 address. Then click on Add and add new rules for the following ports:

  • TCP: 27015-27015
  • UDP: 27015-27015

Enter these port ranges and hit save. Lastly, select your portmapping preset and click on Use.
Step 3: Installing WindowsGSM and Running "Install GameServer"
Download WindowsGSM[windowsgsm.com] from its official website and install it. WindowsGSM is a powerful tool equipped with a graphical user interface for users to install, start, and automate multiple servers.

After installing WindowsGSM, open the application and click on "Servers" on the top left, then hit "Install GameServer". From there, choose Team Fortress 2 Dedicated Server. This will download and set up the necessary SteamCMD files required to install and manage your TF2 server.



With WindowsGSM downloaded, set up Sourcemod[www.sourcemod.net] and Metamod:Source[www.sourcemm.net]. SourceMod and Metamod:Source are server modifications that add extra functionality to your TF2 server. SourceMod provides a powerful scripting platform for custom plugins, while Metamod:Source is a plugin interface that SourceMod relies on.

Download the latest versions of SourceMod and Metamod:Source from their official websites. Do not download it through WindowsGSM directly, as it does not work.



IMPORTANT: If your antivirus software flags these files as potential threats, you may need to temporarily disable it during the extraction process to avoid interruptions. This is also the reason you may not want to install it directly through WindowsGSM, as this might prevent the server from starting up. This is currently not the case anymore!

Extract the contents of both archives into your TF2 dedicated server directory, specifically under \tf\addons.



With SourceMod and Metamod:Source installed, admin permissions for the server need to be configured.

IMPORTANT: WindowsGSM currently only runs TF2 servers in 32bit mode. If you want to run it with 64bit, consider using my Python script FortressForge[github.com]. FortressForge is a user-friendly graphical interface designed to simplify the process of creating and managing a Team Fortress 2 server.
Step 4: Changing the admins.cfg File
Navigate to the tf\addons\sourcemod\configs directory and open the admins.cfg file. This file allows you to define server administrators and their permissions.

"Admins" { "RECOGNIZABLE NAME" { "auth" "steam" "identity" "steamID" "immunity" "0" "flags" "z" } }

Replace "RECOGNIZABLE NAME" with a name of your choice, preferably the name of your Steam account, and "steamID" with your steamID, which you can find by pasting your Steam URL here[steamid.xyz]. This setup grants you full administrative permissions on the server.

Alternatively, you can use KVManager[forums.alliedmods.net] to facilitate the admin creation process. This GUI lets you add Steam users and groups in order to create an admins.cfg file.
Step 5: Creating a custom server.cfg File
Open your web browser and navigate to https://cfg.tf/server/. Follow the instructions on the website to configure a server.cfg file for your server. This configuration file is essential for customizing your server's settings, such as enabling "alltalk" (which allows all players to communicate via voice chat regardless of their team), permitting sprays, enabling voting, and more.

After setting up your desired configurations, download the generated server.cfg file. Paste this file into the \tf\cfg directory of your server. This ensures that your server will start with these specific settings every time it runs.

Example of how a server.cfg could look like:


Additional commands that your server could use:
  • mp_disable_respawn_times 1: Disables the respawn time after dying.
  • tf_force_holiday 2: Enables Halloween mode, which allows Halloween restricted cosmetics and changes the way health packs look like
  • sv_region 255: Sets the server region to All
  • sv_stats 1: Enables collection of CPU usage stats
  • sv_vote_issue_restart_game_allowed 1: Allows players to start a vote on restarting the current game
  • sv_vote_issue_scramble_teams_allowed 1: Allows players to start a vote on immediately scrambling all teams

IMPORTANT: If you want your server to be indexable through the public Internet search in Community Servers, you need to add tags to your server by using the sv_tags command in your servers.cfg. For example, your server tags could look like these for a European Hightower server:

sv_tags EU,Europe,Hightower,[EU] Hightower Server

Make sure to also add the full server name of your server as a tag.
Step 6: Setting up a Game Server Login Token (GSLT)
A Game Server Login Token (GSLT) ensures that your server remains in users' favorites list even if your IP/port changes or if you switch to a different hosting provider.

To obtain a GSLT, your Steam account must meet the following criteria:
  • Your Steam account must not be currently community banned or locked.
  • Your Steam account must not be limited.
  • Your Steam account must have a qualifying registered phone.
  • Your Steam account must own the game for which you are creating a game server account. (In this case, your account must own Team Fortress 2)

Visit the Steam Game Server Account Management page and log in if you are not automatically logged in through your Steam client.

On the bottom of the website, enter 440 as the App ID of the base game, and add a Memo, such as TF2 Dedicated Server. Once filled out, click on Create.



Your new token will be displayed in the list after the page refreshed. Copy this token to your clipboard.
It is important to note that this token must not be shared with anyone else, and a GSLT that goes unused for a long period of time will expire.

Then, click on EDIT CONFIG inside of WindowsGSM.



A window should then appear on the right side. Enter your GSLT under Server GSLT.


(Optional) Step 7: Running the Server with the -enablefakeip Parameter
To run the server, click on EDIT CONFIG and set the server start parameters to include -enablefakeip.



Then, click on SAVE.

This parameter makes the server use a fake IP address by utilizing Steam Datagram rather than your actual local one, preventing others from detecting your personal IP and using it for potential malicious purposes. However, using -enablefakeip can introduce some latency, and the server cannot be favorited by other players

Before starting the server, make sure that Embed Console is enabled. This allows the srcds.exe to be embedded inside of WindowsGSM, rather than being a separate popup.



Start the server from WindowsGSM by clicking on START. The server console will open, showing various messages as the server initializes.
Step 8: Connecting to the Server
In the server console, you’ll see the server’s IP address. Copy this fake IP address. Open Team Fortress 2, and in the console, type connect [IP-ADDRESS], replacing [IP-ADDRESS] with the copied IP. This command will connect you directly to your server.



The console can be opened up by going to Settings, then Advanced, and then Enable Developer Console. Then, click the ~ key on your keyboard (granted you have a QWERTY keyboard, otherwise you have to rebind it in the settings) and a console window should show up.

(Optional) Step 9: Adding Workshop Maps
To add custom workshop maps to your server, open the desired map in the Steam Workshop either through the Steam client or your web browser. Copy the portion of the URL that appears after id=. This is the unique identifier for the map. For example, if you want to add plr_highertower to your server, you need to copy this ID:



Open the mapcycle.txt file located in the \tf\cfg directory on your server. Add a new line in this file with the format workshop/IDHERE, replacing IDHERE with the unique identifier you copied in step 2. This tells the server to include this workshop map in its map rotation.

To change to the new workshop map while on the server, admins can use the Sourcemod command !map workshop/IDHERE in the chat or type map workshop/IDHERE directly into the server console. Replace IDHERE with the unique identifier for the specific map.
(Optional) Step 10: Installling SourceMod Plugins
In order to install custom plugins for your server, go to the SourceMod Plugins page[www.sourcemod.net] and search or select the plugins you want to add to your server.



Then, follow the download instructions as outlined inside the post.

Some notable TF2 plugins include:
22 Comments
Most MASCULINE man EVER 5 Sep @ 11:24am 
How will this affect lebrons legacy
EierkuchenHD  [author] 20 Apr @ 3:47am 
@mojo Did you use a FakeIP? If so, you cannot add a server to your favorites if it is using a FakeIP. And if you are not being shown as an admin, try downloading Metamod:Source and SourceMod manually instead of through WindowsGSM.
mojo 19 Apr @ 9:54pm 
Server is up, showing on browser but not showing up in people's favourites tab after restarting and Im not being shown as an admin
EierkuchenHD  [author] 9 Jun, 2024 @ 3:27am 
@Flpstrike No problem!
Flpstrike 5 Jun, 2024 @ 7:36pm 
Since my IPS forces NAT, only "-enablefakeip" can help me host servers properly... thanks for the help
EierkuchenHD  [author] 5 Jun, 2024 @ 12:52pm 
@aeyde Yes, Windows, an operating system, is not the same as a server. However, servers need to run on an operating system. Therefore, a windows server is a thing, just as much as a Linux server is a thing.
aeyde 5 Jun, 2024 @ 11:37am 
windows ≠ server
ɢ ᴜ ᴇ ꜱ ᴛ 4 Jun, 2024 @ 1:59am 
this should help a lot with my v script map testing
PlagueDoctor118 2 Jun, 2024 @ 5:06am 
thank you dude before this guide i was single, lonely and ugly with no friends, but now after this nothing has changed but at least now i know how to make a tf2 server
Thespikedballofdoom 30 May, 2024 @ 10:18pm 
should really mention enablefakeip somewhere, 90% of the reason most people don't try this is because they don't own their own network.