Team Fortress 2 – Dedicated Server
Ok, in this short tutorial I will show you how to set up a TF2 dedicated server on a windows machine.
- Download the HLDS Update Tool from the Steam site.
- Run the tool to get it installed.
- Create a directory for steam, the game files will be created in this directory.
- Run the hldsupdatetool executable: (I ran a windows installation, but linux will be similar)
Windows command:
HldsUpdateTool.exe -command update -game tf -dir <directory name created in step 3, surround with quotes if spaces are in it>Linux command:
./steam -command update -game tf -dir <directory name created in step 3, surround with quotes if spaces are in it>
You can use the same command when you need to update your server to the latest version.
- This will take some time, grab a beer, a cup of coffee, or something else that will help you relax.
- Don’t relax too much! You might get some ‘Connection reset by peer’ exceptions. Don’t worry, just rerun the same command again and again and again and again until finally you have received all files.
- Create a server.cfg file in the orangebox/tf/cfg directory.
- Fill it with some basic info. See a small example below.
- Create a shortcut to the srcds.exe executable in the /orangebox directory
- Edit the shortcut and change the startup command to look like something like this
- Start the server by running the shortcut
// The name of your server shown in the server browser hostname "TF2 Server" // Server e-mail contact sv_contact youremail@here.com // Password used for remote console access rcon_password "asillypassword" // If you are having trouble connecting with rcon try enabling the rcon_address line. // Also make sure your ports are forwarded (tcp: 27000-27020) // rcon_address "your_ip_address" // 1 for private LAN, 0 for internet play sv_lan 1 // Region that the server is located in // U.S. East - sv_region 0 // U.S. West - sv_region 1 // South America - sv_region 2 // Europe - sv_region 3 // Asia - sv_region 4 // Australia - sv_region 5 // Middle East - sv_region 6 // Africa - sv_region 7 // Rest of the World - sv_region 255 sv_region 3 // Network settings sv_mincmdrate 30 sv_minupdaterate 20 sv_maxcmdrate 100 sv_maxupdaterate 100 sv_maxrate 100000 sv_minrate 1000 //sv_unlag 1 Unknown Command // Enforces fair and optimal settings sv_client_predict 1 sv_client_interpolate 1 sv_client_min_interp_ratio 1.0 sv_client_max_interp_ratio 2.0 sv_client_cmdrate_difference 30 // External download server // sv_downloadurl "http://yoursite.com/cstrike" // Max download size of 100 MB net_maxfilesize 100 // mp_capstyle (Sets the style of capture points used. 0 = Fixed players required to cap. 1 = More players cap faster, but longer cap times) // mp_respawnwavetime (Time between respawn waves) // mp_capdeteriorate_time 90.0 (Time it takes for a full capture point to deteriorate) // mp_teams_unbalance_limit (Teams are unbalanced when one team has this many more players than the other team. (0 disables check)) // mp_bonusroundtime (Time after round win until round restarts) // mp_winlimit (Max number of rounds one team can win before server changes maps) // mp_stalemate_timelimit (Timelimit (in seconds) of the stalemate round.) // mp_switchteams (Switch teams and restart the game) // mp_scrambleteams (Scramble the teams and restart the game) // mp_forcerespawnplayers (Force all players to respawn.) // mp_disable_respawn_times (Disable respawn timer) // mp_timelimit (Set timelimit for map) // mp_maxrounds (Set number of rounds before reset. Mutually exclusive with mp_timelimit. So if this is enabled disable the mp_timelimit) // mp_tournament (Enable or Disable tournament mode) // tf_weapon_criticals (Enable or disable weapon crits) // tf_flag_caps_per_round (Number of flag caps before round ends)
"C:\Program Files\Valve\HLServer\orangebox\srcds.exe" -game tf -console +exec server.cfg +maxplayers 24 +map ctf_2fort
This will make the server run the TF2 game, with console enabled and it will execute the server.cfg file we created. Next to that it will set the player limit to 24 and load the map ctf_2fort at startup.
Please note that you can also create custom map cfg files which will run automatically when a mapchange occurs. Eg: If you have the map cp_dustbowl you could create a custom cp_dustbowl.cfg file and place it in the cfg directory and it will be auto-executed when the level is loaded. This will enable you to use settings that are map specific.
The next part in this tutorial will describe how to install MetaMod:Source and SourceMod on your (TF2) dedicated server.
MetaMod and SourceMod are plugin API’s/frameworks that will allow you to run custom administration/game plugins on your server.
Visit this link to see what mods are available for SourceMod.
- Visit this page and follow the directives there. Be sure to download the a version >= 1.6 of MetaMod:Source.
- Go to the SourceMod site and download the latest release. Then follow the directives found here.
If you got SourceMod running you can install any plugins you like. Have fun!
I can’t get past step 4. I did what you said but it won’t get past the “Checking bootstrapper version … “. Please help.
Can you supply me with a little more information?
- Which OS?
- Which dirs did you create?
- What commands did you run?
- Are you behind a firewall?
Normally the hlds tool checks if an auto-update is needed after checking the bootstrapper version.
Have any idea, how can i make my server non-steam for LAN purpouse’s ???
THX for any help:)
You can use the sv_lan var to do that. Make the clients connect to steam in offline mode if you don’t have internet present at your LAN.
// 1 for private LAN, 0 for internet play
sv_lan 1
unfortunetly that dosent work… when i put sv_lan to 1 my friend’s from other city can’t connect…
Any other ideas??:)
That must be quite some LAN you have there.
LAN games are limited to class C networks. So using VPN tools like hamachi won’t do you any good. You could also opt for a internet server with a password on it so only your friends can join. ( use sv_password to set it )
server that i’m administrating has public adres, it’s my private server and i would like to invite to play my friends from another city… I’m wondering, is there a possibility to play on this server with no steam?
I want to try before i’ll buy
big Thx
cat_anonim
I know it is possible but it’s not quite legal.
So I am not going to give any directions towards this.
I personally think the game is worth the buy. I would recommended buying the Orange Box which gives good value for money. It’s too bad you just missed the TF2 weekend where you would have been able to play TF2 for free.
thanks for help
i guess i have to figure it out myself
bye bye
Hi,
Do any ports needed to be forwarded for this to work?
Thanks.
Just noticed this is said in the server.cfg bit…DOH!
And are 27000-27020 the only ones you need to forward?
As far as I know of those are the only ports that you need to forward. I think I will update the tutorial in the future to show some more info about the ports used.
Wytze, although the game may be worth the money, consider people in my circumstance. I have 4 kids, myself, and a wife that want to do some gaming this summer. That’s about $300 if we want to play it legit, and although it would be fun, we won’t get $300 worth of use from it. I have absolutely no problem with buying games, but since they don’t have any sort of licensing that makes it affordable for a family to play, sometimes other methods of connection are better.
buy the game, install it on multiple comps…its perfectaly legal as long as each comp has a diff steam account on it. and they r all free, u just need to buy the game
Thanks for very good and to the point tips and comments. With that, I have few questions that you maybe want to comment or reply to.
1) Is it necessary to include “+server.cfg” in starting SRCDS, and why?
2) Could you post here some short and interesting sample of standard (pure) or custom *_map*.cfg?
3) Would you know why Rcon kicks me out of console, before map/match ends, despite the fact that I’m acknowledged with Rcon password and console confirms that auto kick is disabled for my userid=me=admin
Thanks in advance.
1) Not necessary the server will look for this file automatically. But to be certain it will be loaded I just force it by using the ‘+exec server.cfg’
2) Let’s say you hate ctf_2fort and you want it to end as soon as possible. You could create a config file called ctf_2fort.cfg and add the following line to it:
tf_flag_caps_per_round 1
This would limit the flag caps to one before the round ends. This way you can create some custom rules per map. Respawn times, map timelimit etc. See the example config in the tutorial for some possible values.
3) Don’t know. Will have a look at it tonight. Haven’t used the Rcon so far.
1) I assumed that “+server.cfg or +exec server.cfg” was not required. In my case it’s “srcds_run, because it runs on Linux:)
2) The reason why I asked for a sample of some_map.cfg was that SRCDS start up complained about missing map.cfg files. But, the server.cfg itself has general settings for all maps, so I did not want to configure each map.cfg file separately. I’m just running pure map rotation server
I solved the issue by placing all the map’s cfg files with no content in it. But, I get the point about tweaking each and individual map.cfg. It’s handy for serving special or custom map conf.
3) I think that my Rcon issues have to do with some settings in server.cfg and TCP/UDP port configuration, on the server’s side. Though, I have 27000-27035 TCP/UDP ports open. There is so much conflicting info in the cyberspace about “howto dedicated TF2 server”, and other topic too, it makes me dizzy
Keep’n plugging any good tips, suggestions or experiences with Source-2007 server engine
Regards,
GeoNao
Hey!
I’ve made a custom map in Source SDK Hammer World Editor called CP_Assault, and placed it into srcds\tf\maps\. When I run the server with official maps it works perfectly, but now it says there’s a server.cfg and a cp_assault.cfg missing. I made the server.cfg and now it doesn’t say it’s missing, but I can’t figure out how to make the cp_assault.cfg. Anybody who can assist me?
never mind I worked it out. But now there’s another problem: As soon as I open srcds there’s a message: “unable to load manifest file ‘scripts/surfaceproperties_manifest.txt’” Anybody who could help me?
Twice I have made it to 99.99% and both times it failed with the “connection reset by peer” message. there HAS to be another way to do this besides the update tool. And I don’t mean installing steam just for a dedicated server. It is not reliable if it keeps failing over and over again.
is there not a download somewhere out there with all the files included?
I don’t know anything about complete packages to download.
I hope you will get it up and running.
I would personally stick to the hlds update tool even if it drives you nuts at times. It is a good tool to keep your server up-to-date.
Getting stuck at 99.99% is a pain in the butt.
Hi i past all the steps but when someone wants to join i get: failed to connect after 4 retries.
Plz help!
Firewall/Router problem perhaps?
See this line in the config:
// Also make sure your ports are forwarded (tcp: 27000-27020)
You could try to forward or unblock those ports on your server.
Its works for like 2 days.
Now it is still working but since this morning the server is not showt on the serverlist anymore. My friends can join with the IP and with steam friends, but the server can not be find in the serverlist. First it was.
Can you help me plz?
Did you update your server to the last version? Your server might not be in the list because it isn’t updated to the current version. (See step 4 in the tut. how to update)
It works now because i needs to run it without my router because that blocks it.
Now i have the next problem: how to use plugins?
I now how to use plugins but now i have that problem again that my server isn’t displayed in the server list. I updated the server and there were no newer versions. Can you help me plz?
I assume you want to run an internet server?
// 1 for private LAN, 0 for internet play
sv_lan 1
Make sure this setting is set ok. It might take a while before your server is in the list because it has to broadcast to the Steam network. If your still having trouble getting connected my best guess is that your ports are somehow blocked by a firewall.
Also note that if you run custom plugins your server might not show in the default server list but in the custom server list.
Yeah i was in the custom server list!!!!!!
THX but the taq behind the server was increased max players.
But i have 32 now.
how can i have 32 players but notbeing showed in the custom server list?
Google is your friend.
I found this page which shows how to set the limit to 32 players:
http://www.usefulzero.com/2007/10/12/32-player-team-fortress-2/
My server keeps showing up in the servers under LAN, and my friends get “Server not responding” when they attempt to connect.
Have a closer look at the config settings:
// 1 for private LAN, 0 for internet play
sv_lan 1
To set up an internet server change it to sv_lan 0.
Did you also forward/opened the required ports on your router/firewall?
( tcp: 27000-27020 )
Ok, I’m a noob. I can’t get the command in step 4 working. What exactly do i have to run in that step.
Thanks
nvm got that to work but now it says that it cannot open blob archive file: CMultiFieldBlob ugh…
I will update the post and place the command inside a code block so that it is better readable. Strange error btw. Is that CMultiFieldBlob on your machine?
Seems like that was an error with my machine, but now its fixed. I have the server running but it won’t show up on the internet only on lan. I forwarded all ports, set sv_lan to 0, but it still only shows on lan. I get this http://img501.imageshack.us/img501/7974/73934682sz1.jpg
Have you tried adding/connecting the server with your internet-ip?
According to your image everything is working fine. So it is strange it doesn’t show in the list. I don’t know if icmp requests need to be enabled on the server so it might show up on the list. It is something I will have a look at.
hi all,
i made my own custom map but i have a serious problem with it: when round finish red stays red and blue stays blu, map dont switch teams.. how can i do this but not with a cfg for the map, i wanna do it in hammer so when i compile the map the switch team mod will be inside the .bsp..
tx for hel cya
hi, i have decided to host a part-time tf2 server for me and some friends to play on. ive managed to install it, configure all the ports correctly (i think).
so i go to run it with the command line:
‘e:\steamsvr\temp\orangebox\srcds.exe -console -game tf +hostport 27015 +maxplayers 10 +map cp_dustbowl -autoupdate’
so the console opens and it says: (i typed all of the following becuase the sevrer is on a diffrent conputer)
console initilized:
game.dll loaded for “tf2″
particles: missing ‘particles/error.pcf’
maxplayers set to 10
network: ip 192.168.0.4, mode MP, decdicated Yes, ports 27015 sv / 27005 Cl
executing dedicated server config file
then i get a whole load of ‘spawnpoint errors’ they look a bit like this:
‘spawnpoint at <2472.00 -1616.00 -124.00? is not clear’
im not sure if thats normal and can be ignored..
after it carries on and says:
addimg master server 69.28.151.162:27011
adding master server 68.142.72.250:27011
connection to steam severs successful.
VAC secure mode is activated.
so everytihng looks like its worked… but when i go the check my server @ http://www.game-monitor.com. it doesnt come up.
so i then tryed to join my game using my laptop. it shows up under ‘internet’ and ‘Lan’ (in my server.cfg file i have sv_lan = 0). i can join the server from my laptop, but when i look at the console on the server, it has thrown up even more ‘spawnpoint’ errors…and eventually i get kicked by the console..
intrestingly under server ‘tags’ it says ‘cp,norespawntime,respawntime’ im not sure what that means, but i certainly didnt set it up to do that.
just a note, i have opened ports 27015, 27020, 27005 tcp and upd, and forwarded all incomming traffic to my internal server ip address.
and another note, i havnt got a static ip, but thats ok cos i only plan to use the server when me and friends want to play, not to host a game full-time.
i am thorougly stuck, and any help would be very gratefull. thanks.
ok made some progress. i asked a friend to look for my server, he couldnt find it in the list. but i had an idea, i joined the server, then he joined the server through the ‘friends’ tab. and it worked?! so what going on? once he was in the sever everything was fine..? btw the server is called ‘BAKEDBEANS TEST SERVER!!!’ and it’ll either be running goldrush, badwater or dustbowl. if you see it could u plz join then leave just so as i can test the server more, thanks.
Where do I need to pack up the Meta Mod?
I tried everything and my server still appears under LAN and my friends cant join because it says “Server is not responding”. Could the problem be that my IP starts with 192.168.1 because i’ve had a lot of trouble in the past with this IP.
@Minibono: Just follow the guidelines on the MetaMod page. It’s in the howto.
@Ace: Yes this is your local ip. If your friends want to connect you need to forward the ports from your router to this pc. To find out the ip assigned to you by your isp you can visit one of the dozen pages on the internet. (google on something like this: find out your ip)
Good luck.
I did forward my ports…
I forwarded 27015 UDP and 27000-27020 TCP to my static IP.. Is this right? Or am i suppost to forward them to my LAN IP or to my ISP?
I just tried again on my other computer and its the exact same problem. So i’ obviously doing something wrong. Anyone got any ideas? please help D=
Can someone please tell me which IP i forward these port to!
You need to forward the ports to your local ip. (192.168.1.?)
When your friends want to connect they will need the ip you got from your isp. Also make sure sv_lan is set to 0. Maybe you want to set a password on your gameserver to prevent other people from entering it.
it’s probably something stupid that I’m missing. I’ve setup the server, forwarded my ports, I can see the server in the steam servers list, but when I try to connect to it I get the message stating that the server is not responding. on the pop-up that says server not responding, it shows my external IP address plus the port 27015, so I thought I missed a port forward somewhere, but when I go back and double-check, everything is forwarded properly…
You might want to add +hostip xxx.xxx.xxx.xxx and +ip xxx.xxx.xxx.xxx to your startup script. Where +hostip points to your WAN address and +ip to your internal LAN address.