Jamillia Feb 10, 2015 @ 4:15pm
2
How To Create A TF2 (MvM) Server
This guide can also be used to create a regular TF2 Server.

Table of Contents:
(the bare minimum)
I. Installing SteamCMD
II. Installing your TF2 MvM Server
III. Port Forwarding

(optional)
IV. Customizing your server
V. Installing Metamod and Sourcemod
VI. Installing Plugins

Read the first comment to see what I did for I. Installing SteamCMD and II. Installing your TF2 MvM Server.


I. Installing SteamCMD
  • Downloading SteamCMD
    1. Go to this website and go to where it says "1 Downloading SteamCMD".
    2. Depending on your operating system, you will either choose Windows, Linux, or OS X
      Note: I will only be writing this guide to support Windows users.
    3. Download SteamCMD where it says https://steamcdn-a.akamaihd.net/client/installer/steamcmd.zip

  • Creating a SteamCMD folder and Installing SteamCMD
    1. Anywhere on your computer, create a new folder for SteamCMD. You can name it anything you want to.
      • You'll most likely want to put this on your desktop or your (C:) Drive.
    2. Extract the contents of the SteamCMD.zip that you downloaded into this new folder.
    3. Run SteamCMD once and then close it when it finishes downloading everything.

II. Installing your TF2 MvM Server
  • Installing your server
    1. Create another folder somewhere on your computer and name it anything you want.
      • You'll most likely want this to be in the same place as your SteamCMD folder or inside of it.
    2. Open SteamCMD again and wait for it to load everything that it wants to.
    3. Type in the following:
      1. login anonymous
      2. force_install_dir C:\[the file path to get to the new folder]
      3. app_update 232250 validate
      4. exit
    4. Wait for SteamCMD to download the server files into the new folder.
      Note: this process could take from 10 minutes to 2 hours or more depending on your internet speed

  • Automating your server for updates
    1. Go to your SteamCMD folder and create a new notepad document.
    2. Type the following into the .txt file:

      login anonymous force_install_dir C:\[the file path of your new folder] app_update 232250 validate exit
      Notice how it's the same as what you typed into SteamCMD?

    3. Save the file (ctrl + s) and name it anything you want.
    4. Create a new notepad document on your desktop.
    5. Put the following contents into it:

      cd C:\[your file path to the SteamCMD folder]\SteamCMD steamcmd +runscript [whatever you named the text doc].txt

    6. Go to the top right of the document to where it says "File"
    7. Click "Save as" and click "any file type" as the file type.
    8. Name the file anything you want, but add the extension ".bat" to the end of it (without the quotation marks).
    9. Double click on the new .bat file on your desktop to see if it works (it should look exactly the same as when you did it in SteamCMD).

III. Port Forwarding
I can't really help much on this section. You may have to go to some website to help you figure out how to port forward.
Here is one video that may help you figure it out..
https://www.youtube.com/watch?v=Kp-R-eHiQco
  • The default way to get onto your router is to open command prompt and type in ipconfig.
  • Look for "Default Gateway". This will most likely be 192.168.1.1.
  • Then type in the default gateway number into the url of a web browser. This will then open up a window asking for a username and password.
  • The username and password, by default, are admin and password.
  • After getting onto your router, navigate your way to the port forwarding section of it and fill in all the necessary information:
    • IP Address
    • Start and End Ports
    • Port Name
    • Port Type
To find your IP address, go to command prompt (Start button > type in cmd) and type in ipconfig.
Look for your ipv4, which will most likely be 192.168.1.#.

The default port for a TF2 Server is 27015, so your input and output; Start and End; inbound and outbound; should all be 27015
For protocol, you can leave the option as both.


After that, you basically have your own server.
There's just one thing left to do: opening your server.
  1. To open your server, you must navigate to your TF2 server folder.
  2. Search for a program called "srcds.exe" or just "srcds".
  3. Right click on that program and "Create A Shortcut"
  4. Right click on the new shortcut and go to properties.
  5. Look for where it says "target" and go to the end of the line of text that follows it.
  6. Type in the following after putting in a space after the text:
    • +ip 0.0.0.0 -maxplayers 32 -game tf -console
  7. Click apply and done.
You now have yourself a working TF2 server - if you port forwarded correctly.
Note: MvM will only work on a server if the max players are set to 32.

Opening the shortcut that you made will create a command prompt-like window with details about your TF2 server. To interact with your server, you must know some RCON/CVAR commands. Some of the basic commands you can do are:
  • sv_cheats [0/1]
  • changelevel [map name here]
  • hostname [new name of server here]
  • sv_password [new password here]
    Note: if you enter in "" as the new password, then you remove any password on the server.
  • rcon_password [new password here]
    Note: you should make this one something secure. If people know the RCON password, then they can do remote commands and cheat on your server or completely destroy it.
To view all of the different RCON and CVAR commands you can put in, take a look at this page.

Note: the rest of this guide is completely optional.
IV. Customizing your server.
  • MoTD (Message of the Day)
    • After SteamCMD is done installing your server, you may want to change, add, or remove a couple things from it, starting with the MoTD.
    • The MoTD is the first thing that anyone sees when they join a server. It's that thing that people always skip to get right into the game.
    • To add custom text to the MoTD, simply do the following:
      1. Navigate to your TF2 server folder.
      2. Go inside the "tf" folder.
      3. Create a new text document named "motd" (without quotation marks).
    • Anything you put inside of that .txt file will be what comes up when you first join your server.

  • Map Cycle
    • To change the map cycle to something other than the default map cycle (basically all of the maps), navigate to your server folder.
    • Go inside the "tf" folder and create a new text document named "mapcycle" (without quotation marks).
    • Inside the file, put the names of the maps that you want the server to cycle through.
      Note: the map must also come with the prefix, such as mvm_decoy or koth_harvest_event.
An example of a MvM Server map cycle would be:

mvm_decoy mvm_coaltown mvm_mannworks mvm_bigrock mvm_mannhattan mvm_rottenburg
  • Server.cfg
    • The server.cfg file is the most important file to customize. This file will determine how your server behaves in the game.
    • It can range from controlling the name of the server, the type of server, the voting methods, all of the sv_cheat commands, and much more.
Here is an example of a default server.cfg which I highly recommend using for your MvM Server.
You should also look through it to fill in any personal server details, like the hostname.
// General MVM Settings // tf_mm_servermode 1 //puts the server into mvm matchmaking tf_mm_strict 0 //allows players to join through matchmaking and server browsing tf_mm_match_size_mvm 6 //minimum players needed in matchmaking before connecting tf_mvm_min_players_to_start 1 //default 3 tf_mvm_respec_enabled 1 //allow refunds tf_mvm_respec_limit 0 //total allowed refunds; 0 - unlimited tf_mvm_respec_credit_goal 2000 //if respec_limit is not 0, then the total number of credits needed to earn a refund tf_mvm_skill 3 // 1 - easy; 3 - medium (default); 5 - hard tf_mvm_disconnect_on_victory 0 //disconnect players on victory tf_mvm_victory_reset_time 60 //seconds to wait after victory before changing map // Hostname for server. hostname <servername> //Change the name // Set to lock per-frame time elapse host_framerate 0 // Set the pause state of the server setpause 0 // Control where the client gets content from // 0 = anywhere, 1 = anywhere listed in white list, 2 = steam official content only sv_pure 2 // Is the server pausable sv_pausable 0 // Type of server 0=internet 1=lan sv_lan 0 // Whether the server enforces file consistency for critical files sv_consistency 1 // Collect CPU usage stats sv_stats 1 //Tags //sv_tags <your Tags> //Server Player Password // NOTE: if you have a password, your MvM server will not be allowed in Match Making. //sv_password <your server password> // Execute Banned Users // exec banned_user.cfg exec banned_ip.cfg writeid writeip // Contact & Region // // Contact email for server sysop //sv_contact <your email>@gmail.com // The region of the world to report this server in. // -1 is the world, 0 is USA east coast, 1 is USA west coast // 2 south america, 3 europe, 4 asia, 5 australia, 6 middle east, 7 africa //sv_region num // Rcon Settings // // Password for rcon authentication rcon_password <your RCON Password> // Fill in the rcon password // Number of minutes to ban users who fail rcon authentication sv_rcon_banpenalty 1440 // Max number of times a user can fail rcon authentication before being banned sv_rcon_maxfailures 5 // Log Settings // // Enables logging to file, console, and udp < on | off >. log on // Log server information to only one file. sv_log_onefile 1 // Log server information in the log file. sv_logfile 1 // Log server bans in the server logs. sv_logbans 1 // Echo log information to the console. sv_logecho 1 // Rate Settings // // Frame rate limiter fps_max 600 // Min bandwidth rate allowed on server, 0 == unlimited sv_minrate 0 // Max bandwidth rate allowed on server, 0 == unlimited sv_maxrate 20000 // Minimum updates per second that the server will allow sv_minupdaterate 10 // Maximum updates per second that the server will allow sv_maxupdaterate 66 // Download Settings // // Allow clients to upload customizations files sv_allowupload 1 // Allow clients to download files sv_allowdownload 1 // Maximum allowed file size for uploading in MB net_maxfilesize 64 //VOTING!// sv_allow_votes 1 sv_vote_allow_spectators 0 sv_vote_failure_timer 120 //(default 300 = 5 minutes) // REGULAR GAME VOTES // //Enable Scramble Vote sv_vote_issue_scramble_teams_allowed 0 //Enable Restart Game sv_vote_issue_restart_game_allowed 1 //Enable NextLevel Vote sv_vote_issue_nextlevel_allowed 1 //Enable Kick vote sv_vote_issue_kick_allowed 1 //Kick Duration (0 for no ban time, non-0 for minutes to ban) sv_vote_kick_ban_duration 10 // MVM VOTES // //Enable Kick vote sv_vote_issue_kick_allowed_mvm 1 //Enable changelevel vote sv_vote_issue_changelevel_allowed_mvm 1 //Enable restart map vote sv_vote_issue_restart_game_allowed_mvm 1 //Enable classlimits vote sv_vote_issue_classlimits_allowed_mvm 0 //Enable classlimit max count vote sv_vote_issue_classlimits_max_mvm 2 //(default 2) //Enable kick players that haven't connected yet but passed certain time threshold sv_vote_issue_kick_min_connect_time_mvm 0 //(default 0 is enabled) //Vote timer cooldown sv_vote_failure_timer_mvm 120 //(default 120 = 2 minutes) //Allow change difficulty vote sv_vote_issue_mvm_challenge_allowed 1 // Round and Game Times // //Wait for Players mp_waitingforplayers_cancel 1 // Enable timers to wait between rounds. WARNING: Setting this to 0 has been known to cause a bug with setup times lasting 5:20 (5 minutes 20 seconds) on some servers! mp_enableroundwaittime 1 // Time after round win until round restarts mp_bonusroundtime 10 // If non-zero, the current round will restart in the specified number of seconds mp_restartround 0 //Enable sudden death mp_stalemate_enable 0 // Timelimit (in seconds) of the stalemate round. mp_stalemate_timelimit 300 // game time per map in minutes mp_timelimit 60 //Max Round Wins mp_winlimit 0 //Disable Respawn Times mp_disable_respawn_times 0 //(default 0; 1 allows near instant respawns) // Overrides the max players reported to prospective clients sv_visiblemaxplayers 6 // Maximum number of rounds to play before server changes maps mp_maxrounds 0 // Client CVARS // // Restricts spectator modes for dead players mp_forcecamera 1 // toggles whether the server allows spectator mode or not mp_allowspectators 1 // toggles footstep sounds mp_footsteps 1 // toggles game cheats sv_cheats 0 // After this many seconds without a message from a client, the client is dropped sv_timeout 900 // Maximum time a player is allowed to be idle (in minutes), made this and sv_timeout equal same time? mp_idlemaxtime 9 // Deals with idle players 1=send to spectator 2=kick mp_idledealmethod 1 // time (seconds) between decal sprays decalfrequency 10 //Overtime Nagging tf_overtime_nag 1 // Communications // // enable voice communications sv_voiceenable 1 // Players can hear all other players, no team restrictions 0=off 1=on sv_alltalk 0 // amount of time players can chat after the game is over mp_chattime 10 // enable holiday modes: 0none,1birthday,2halloween,3birthday //tf_forced_holiday 0

V. Installing Sourcemod and Metamod
Sourcemod is a program used to operate custom plugins on your server, such as RTD and infinite cash or ammo.
Now you may be asking yourself, "Why do I need to get both of them if Sourcemod is the one that allows me to use plugins?"
The answer is because Sourcemod depends on Metamod to actually work.
To download Metamod go here[www.sourcemm.net].
To download Sourcemod go here[www.sourcemod.net].
  • When you download Metamod and Souremod, extract the two folders into your "tf" folder inside of your server folder.
  • Metamod and half of Sourcemod should go into a folder called "addons".
  • The addons folder is where you will do most of your customization.

VI. Installing Plugins
To download custom plugins to put into your server go here[www.sourcemod.net].
  • After selecting the plugins that you want, it is important to copy down the CVARS that come with the plugin.
    Note: if there are no CVARS for the plugin, or you want the plugin to keep its default CVARs, then you don't need to do the following steps.
  • The CVARs that come with the plugin are very important and customizable.
  • For each plugin, you must enter a new entry of CVARs into your server.cfg file.
Example (at the bottom of your server.cfg):
// Plugins // //Advanced Infinite Ammo sm_aia_enabled 1 sm_aia_all 0 sm_aia_version //Leave any CVARs that include a version blank //Rate of Fire sm_rof_enabled 1 sm_rof_version sm_rof_huntsman 0 //Roll The Dice sm_rtd_version sm_rtd_chance 0.8 sm_rtd_enabled 1 sm_rtd_command "rtd,!rtd,/rtd,.rtd"
  • Each plugin comes with a list of commands as well.
Example:
() ~ optional [] ~ required AiA commands: sm_aia (name) [0/1] sm_aia @me [0/1] sm_aia @blu [0/1] ROF Commands: sm_rof (name) [1-10] Mann to Machine Commands: sm_machine (name) sm_mann (name) sm_giant (name)
  • To actually install a plugin to use on your server, download the .smx file provided in a download link.
  • Navigate to your plugins folder (TF2 Folder\tf\addons\sourcemod\plugins)
  • Place the .smx file into the plugins folder.
    Note: if there are custom files or instructions on the plugin page, you must also follow those steps in order for the plugin to work.

Credits:
This guide was highly inspired by A Very Patient Player. Most of its contents are actually taken from his guide.
I just felt like creating a TF2 Server guide to get it out there.

Post down below if you have any questions. I'll try to help out as much as possible, but I can do very little to help with port forwarding.
If you want to know how to cheat on your server without any plugins, I can also help somewhat.

Also leave any feedback - which may include anything you think I should add to the guide or edit/remove.
--------------------------------------------------------------------------------------------------------------
Edit 1: Fixed spelling/grammar errors and formatting issues.
Edit 2: Updated link in part 1. Fixed spelling/grammar errors.
Edit 3: Changed some formatting. Fixed spelling/grammar errors.
Edit 4: Edited the server.cfg example code for current TF2 settings.
Edit 5: Edited Part 3 Port Forwarding (removed videos that are now privated).
Edit 6: Fixed links to metamod and sourcemod
Edit 7: Fixed spelling mistakes and updated how srcds works.
Last edited by Jamillia; Oct 23, 2022 @ 4:37pm
< >
Showing 1-15 of 69 comments
Jamillia Feb 10, 2015 @ 5:06pm 
For the SteamCMD folder, I named mine SteamCMD and placed it inside of my (C:) drive.
For the server folder, I named mine TF2 and place it inside of my (C:) drive, but outside of the SteamCMD folder.
Doing these two things makes the automating part of the guide easier:
For the .txt file inside of the SteamCMD folder (which I named tf2)
login anonymous force_install_dir C:\TF2 app_update 232250 validate exit

For the .bat file on your desktop (which I named auto)
cd C:\SteamCMD steamcmd +runscript tf2.txt

To locate your (C:) Drive, go to the Start button (bottom left) and click on computer. Then look for an icon with the name of (C:).
Last edited by Jamillia; Oct 23, 2022 @ 4:40pm
Patient Feb 11, 2015 @ 2:07pm 
Looking through your guide, it looks like you did a great job of finishing what I left off (the full guide)! Funny enough, it looks like I just so happened to find all of this on the first day back on steam since last year!

I mentioned in a YouTube description and pretty much my profile Summary that I wouldn't continue this with any certainty that I would come back to it. Hopefully the community took this message with understanding and not malice.

In any case, to all of you aspiring server Admins:

GOOD LUCK!
Last edited by Patient; Feb 11, 2015 @ 2:08pm
AnAkIn Dec 30, 2015 @ 2:18am 
Do you know how to install the 10 player plugin . I cant get it to work .
Jamillia Dec 30, 2015 @ 11:01am 
@alinthegreat
Well, I think if you just put the .smx file into your /addons/Sourcemod/plugins folder, and then start your server, it should work. When 6 people are in your server and you connect through console, it should automatically put you into red team. If it doesn't, try using the command sm_mvmred. If that doesn't work, then I don't know how to fix it.
The plugin is very old. Old plugins tend to break as the game advances with updates.
Last edited by Jamillia; Dec 30, 2015 @ 11:01am
KOR_Simple Dec 31, 2015 @ 6:45pm 
godd
Jamillia Jan 23, 2016 @ 10:33pm 
If you want to put your internal ip, you can. It makes no difference. I just put 0.0.0.0 in the guide because most people don't know their ip's.
Kritz Jan 23, 2016 @ 10:37pm 
"D:\steamcmd\steamapps\common\Team Fortress 2 Dedicated Server\srcds.exe"
should i leave the quote or erase it ?
since, i did this in the other guide. but im confused with this quotes
Jamillia Jan 23, 2016 @ 10:38pm 
Always remove quotes. They are almost never needed when scripting with a computer.

I think you're putting this in the SteamCMD console? It doesn't like it when you use quotes.
Last edited by Jamillia; Jan 23, 2016 @ 10:39pm
Kritz Jan 23, 2016 @ 11:08pm 
No, its in the scrds shortcut target.
Jamillia Jan 24, 2016 @ 9:22am 
You still don't use quotes anyways.
Ramen Jul 18, 2016 @ 1:52pm 
YEAH, am i the only one who has the trouble of their scrds shortcut being a blackscreen, but somehow players still join me, but i cant install plugins or change he server :(
Jamillia Jul 19, 2016 @ 1:29pm 
Here is a temporary fix to the black window scrds screen.[mega.nz]
This goes into your TF2 Server bin and platform folder, so I highly suggest you make backups of those folders before using this fix.
Last edited by Jamillia; Jul 19, 2016 @ 1:30pm
Ramen Jul 19, 2016 @ 3:16pm 
Originally posted by Jamillia:
Here is a temporary fix to the black window scrds screen.[mega.nz]
This goes into your TF2 Server bin and platform folder, so I highly suggest you make backups of those folders before using this fix.
mmmm... still black :(
Jamillia Jul 19, 2016 @ 4:32pm 
You placed the files above in your (tf2server location)/tf2 ?
That's where you put the new bin and platform folders.
Ramen Jul 19, 2016 @ 7:11pm 
Originally posted by Jamillia:
You placed the files above in your (tf2server location)/tf2 ?
That's where you put the new bin and platform folders.
so i place it in the same file as my bin and platform folders? ill try it
< >
Showing 1-15 of 69 comments
Per page: 1530 50

Date Posted: Feb 10, 2015 @ 4:15pm
Posts: 69