Do you have a VPS or dedicated server and want to install game servers on it? For example, a Team Fortress 2 Dedicated Server? Then you’re in the right place! Below, we’ll explain step by step how to install a service like this on your server.
You’ll need SteamCMD to set up a Team Fortress 2 server. SteamCMD is the command-line version of the Steam client. With this tool, you can quickly and easily download the dedicated server applications for popular Steam games. You can find SteamCMD on the official Valve Developer Community website: https://developer.valvesoftware.com/wiki/SteamCMD.
Next, download SteamCMD. The download includes the steamcmd.zip file, which you’ll need to extract first. We recommend creating a separate folder to extract the file into. When it’s done, you should see steamcmd.exe. Launch it and wait for the installation process to finish.
Once the message Loading Steam API.... OK appears, the process has completed successfully, and you can start installing the Team Fortress 2 server.
After the installation, you should be able to run commands in the Steam command line (steamcmd.exe). You’ll need to log in there using the anonymous user. Run the following command: login anonymous
The next step is to install the server. Run the command app_update 232250. The App ID 232250 is for the Team Fortress 2 Dedicated Server application.
Please wait for the download to finish. This can take a while for larger games. Once it’s complete, a success message will appear.
To make the server visible and accessible from outside your network, you need to allow or forward the server ports in the firewall. To do this, open the Windows Firewall settings.
You’ll need to add additional rules in the settings. Click the inbound and outbound rules as described below and add rules for the following ports: 27015-27020 for the TCP/UDP protocols.
You’ve now completed the basic installation of your Team Fortress 2 server. You can configure additional server settings by editing the configuration file. To do this, go to your root directory, navigate to the cfg folder, and open the server.cfg file. You can adjust server options here.
../steamapps/common/tf2-ds/tf2/tf/cfg/server.cfg
For other players to join your server, you need to generate and add a Game Server Login Token (GSLT). This token authenticates your server with Steam. To create a GSLT, visit http://steamcommunity.com/dev/managegameservers and generate a token using Game ID 232250, which is for Team Fortress 2.
Once you have the token, add it to your server launch parameters using +sv_setsteamaccount <TOKEN>.
Now it’s time to start your server. Go to the game’s main directory and run the following startup command:
start srcds.exe -console -game tf -secure +maxplayers 22 +map de_dust +sv_setsteamaccount XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
You should now see logs in the command-line window indicating that the server started successfully. Keep in mind that the first startup may take a little longer while everything is set up. Alternatively, you can connect directly by using the search box at the bottom of the server list and searching for [your_ip_address]:27015.