Team Fortress 2

Team Fortress 2

58 ratings
How to rent servers by the hour, and save money!
By Kered13
Renting a normal server can be expensive, especially when you only use it for a few hours a week. This guide will show you how to rent servers by the hour, potentially saving enormously on server fees!
   
Award
Favorite
Favorited
Unfavorite
Who is this guide for?
This guide describes how to rent a dedicated cloud server that you will share with other people for a short time. This is ideal for teams who want a server to practice on, for league matches, or for any other temporary events. However, cloud servers are more expensive to run continuously, and typically do not have permanent IP addresses. Since cloud service providers do not specialize in game servers, they also take more work to initially set up, this guide will take you through those steps. Once set up however, they are very easy to run and manage.

If you want a server just for yourself, use a listen server. These run on your local machine, so they cost nothing and are totally unrestricted. You can create one with the "+" button on the main menu (next to "Browse Servers"), or by typing "map <map name>" in the console. These can work well for small LANs as well, but are poor for internet play.

If you want to run a permanent or semi-permanent server, like a public server, consider renting a server from a standard game server provider. They offer better prices for a server that will be running almost continuously and they have specialized features to make managing your server more convenient. They also typically have permanent IP address, which makes them easier for users to add to their favorites.

This guide will assume some basic familiarity with Linux, however it is not strictly necessary. It is also possible to run cloud servers on Windows, however this guide was written for Linux. Regardless of what cloud OS you choose, you can run and manage your cloud server from any computer.

It is also helpful to have some previous experience running servers, but this is also not necessary. I had never run a server before I started this adventure.
Why pay? Reserve a server for free on serveme.tf!
{LINK REMOVED} and {LINK REMOVED} are sites that all you to reserve servers by the hour, totally for free. This is a great service and should be your first stop when looking for a temporary server. To reserve a server, simply sign on with Steam, choose a server, and click "Book this server". Then specify your start and end times, a password, rcon password (used to run commands on the server remotely), and other configurations. Save your settings and when your reservation time comes simply connect with your password!

The downside is that since you do not own the server, you are limited in your ability to configure the server. Serveme servers come with maps and configs for all EU and NA leagues and allow you to run remote console commands, but if you need something more exotic then you will have to ask the serveme admins to add it to their servers.

Additionally, there is a limit to the number of servers available. Currently, there are approximately 48 EU servers and 10 NA servers. Usually there is an available server, but at peak hours they can book up. If this happens, then you will have to look elsewhere.
Choosing a cloud provider
So you've decided you need a temporary server, but serveme won't work. Where do you get one? There are three cloud server providers that I have researched: Amazon Web Services, Google Compute Engine, and Rackspace. There are probably others as well, don't feel you have to limit yourself to these.

Here is a short rundown of some of the features for each:

Amazon:
  • {LINK REMOVED}
    • $0.11 to $0.15 per hour.
    • $0.12 per GB of bandwidth out*
    • $0.10 per GB/month storage*
  • Locations: Oregon, California, Virginia, Ireland, Sydney, Singapore, Tokyo, Sao Paulo.
  • *Free tier available (for first year).
    • Free micro instance.
    • 15 GB/month bandwidth out.
    • 30 GB storage.
  • Spot requests (see below).

Google:
  • {LINK REMOVED}
    • $0.10 to $0.13 per hour.
    • $0.12 per GB bandwidth out.
    • $0.04 per GB/month storage.
  • Locations: Iowa, Belgium?
  • Charges by the minutes (minimum 10 minutes).

Rackspace:
  • {LINK REMOVED}
    • $0.08 to $0.016 per hour.
    • $0.12 per GB bandwidth out.
    • $0.10 per GB/month.
  • Locations: Chicago, Dallas, Virginia, London, Sydney, Hong Kong.

For this guide I have experimented with Amazon and Google, so I will provide some more detailed instruction for these. Other services should be pretty similar.
Setting up your server
One you've chosen a provider, you'll have to register an account and provide billing and contact information. This is all straightforward. If you are using AWS, at some point you will be given a private key (a .pem file). It is important that you save this file, you will need it to connect to your server.

On AWS you will have to choose an AMI. I recommend choosing the Ubuntu AMI to get started, and the rest of this guide will assume you are using Ubunutu. But you can use any Linux distro you like, or Windows if you prefer. On GCE you have fewer options, I recommend using Debian.

Enable Connections:

The first thing you need to do is allow the necessary connections to run a TF2 server. On AWS this is done through the Security Groups page, edit the default security group or create a new group for the TF2 server and then edit the inbound rules with ports below. On GCE this is done on the Networks page, edit the default network or create a new one and then create new firewall rules with the ports below. These are the connections we need to allow:

tcp: 22 (allow SSH)
tcp: 27000-27015 (for the TF2 server)
udp: 27000-27015 (for the TF2 server)
icmp: echo request (optional, but allows you to ping the server with the from the command prompt)


SSH and SFTP:

To manage the server effectively, you're going to need two tools: SSH, and SFTP. SSH allows you to login to the server remotely and manipulate it with the command prompt. This is necessary to install and run the TF2 server. SFTP allow you to transfer files from your computer, this makes installing maps, configs, and plugins much easier. On Windows, I recommend {LINK REMOVED} for SSH, and {LINK REMOVED} for SFTP.

To SSH into your server you will need to create a public/private key pair with PuttyGen. This is slightly different for each server, follow these instructions:
-{LINK REMOVED}
-{LINK REMOVED} (For username, use your Windows username)

Now to connect to your server. Start Putty and in the Host Name field, enter <username>:<IP address>, then set the port to 22. Now go to Connection > SSH > Auth, and select the private key you saved (a .ppk file). Before connecting, save this session so you can reuse it. The IP address will change every time you start a server, but the authentication settings will remain the same.

To transfer files you need to run WinSCP. To connect you can import saved sessions from Putty with Tools > Import Sites. Import your saved session, update the IP address if necessary, then connect. Once connected you can navigate the server's file system and drag and drop files from your computer to the server.


When you are done with the server:

On AWS select the instance and choose "Stop". All your changes will be saved, the your server will be ready to go the next time you start it. If you want to create a different type of instance with the same configuration, then select your instance and select "Create Image". This will create an AMI, then when you launch a new instance you can select your AMI under "My AMIs".

On GCE click the server and click "delete" at the bottom. Do not delete the persistent disk. When you launch your next server, you can launch it with the previous persistent disk to carry over all of your configurations.
Which instance type to use
The instance type you choose will depend on what you plan to do. Any instance will do for maintenance, but you'll need a more resources to actually use a server. The more players you plan to have on your server, the more resources you will need.

You should experiment to find what instance type is right for your needs. Here are some AWS instance types, and what I have done with them:

  • t1.micro: Free for the first year, and very cheap afterwards. This is ideal for setting up the server or testing by yourself or with just a couple people. This might also work for bball or ultiduo, but I have not tried it.
  • m3.medium: $0.113/hour, I have successfully run 6's matches on this server. It may be able to handle highlander as well, but I have not tested it.
  • c3.large: $0.15/hour, I have successfully run 6's and Highlander matches on this server.

On GCE, I have successfully run a 6's match on an n1-standard-1 instance ($0.10/hour), but have not tried anything else.

You can see the specs of these instances on the pricing pages, and use that information to find a comparable instance from your cloud provider. Different providers use different "computing units" to measure CPU power, so it is difficult to compare these across providers.
Setting up and managing the TF2 server
Note: I recommend doing initial setup and any later maintenance work on the cheapest instance you can get. This will save you money while performance is not important. When you're ready to play, just save your disk or image and start an instance with more resources.

Now that you can SSH into your server, you need to install the TF2 dedicated server software. Simply follow the TF2 Wiki instructions, starting from "Download and install the SteamCMD Tool" and through to "Create a shell script to run the server". Using screen is entirely optional and mostly for advanced users, and you don't need to worry about iptables at all.

If you encounter an error running ./update.sh, this is probably because you're using a 64-bit distro and need the 32-bit libraries. Just follow these instructions to fix it: Installing 32-bit libraries on 64-bit systems. For AWS, you are probably using Ubuntu. For GCE, you are probably using Debian 7 "Wheezy".

You can now start your tf2 server by running "~/hlserver/tf.sh" (you will need to make the file executable first). Wait a few minutes for the server to start, then try to connect to it from tf2 with "connect <ip address>". You should connect successful and be able to start playing.

To run console commands on the server, set your rcon_password to match the server's rcon_password, then type "rcon <command>" in the server.

To install maps, simply put the .bsp files in the hlserver/tf2/tf/maps directory. To install configs, put them in hlserver/tf2/tf/cfg. And to install plugins, follow the instructions that come with the plugin.

You are now done with set up. The next time you launch an instance, all you need to do to start your TF2 server is SSH in and run ~/hlserver/tf.sh.


Shortcut on AWS: I have created an AMI with many common maps, plugins, and league configs. When launching your instance, go to Community AMIs and search for "Advanced TF2 Server". When the instance starts up, the TF2 server will be ready to go and all you will have to do is change the rcon_password and give yourself sourcemod admin powers.

EDIT: It turns out that this AMI is only available on the Virginia region (where I set it up). If you are using another region, you'll have to install the server manually, as above.
Spot Prices (AWS only)
AWS has a great feature that lets you bid on servers, instead of paying the normal price. This can be accessed by clicking "Spot Requests", then "Request Spot Instance". Create your request like a normal instance, but additionally set a maximum bid.

Here is how it works: At any given time, there is a current "spot price", which is what someone would have to pay to launch one additional server. If your maximum bid is greater than the spot price, then a server will be launched for you and you will be charged the spot price. However, if at any time the spot price rises above your maximum bid, your server will be stopped in favor of someone else (you will not be charged for hours you did not finish using).

Typically (but not always), the spot price is well below the normal price. So here is the strategy I recommend: First, verify that the spot price is desirable. Then place a maximum bid equal to the normal price for you instance. You may need to request a specify a particular subnet in order to get the best price. This bid makes it quite unlikely (but not impossible) that your server will be terminated.

Although you can save significantly with spot instances, and with a high maximum bid it is unlikely, I must reiterate: A spot instance can be terminated at any time.

When you are done, cancel your spot request AND terminate the instance.

By using Spot Requests I have been able to rent servers that normally cost $0.11 for just $0.02, and servers that normally cost $0.15 for just $0.03.
13 Comments
Dakor Jul 3, 2020 @ 12:08am 
Hi you didn't put in a calculation of how much money you actually saved?
With AWS being charged by usage and especially traffic to the internet being kinda expensive, I'm worried that it will cost more eventually?
Alex Apr 2, 2014 @ 12:38pm 
home hosting is shite
bill is ill Mar 28, 2014 @ 11:35pm 
Step 1. Have fiber, or don't have utorrent on full blast with your shitty 256kbps "broadband"
Kyzer Mar 25, 2014 @ 10:07pm 
Servers*
Kyzer Mar 25, 2014 @ 10:07pm 
Fuck this bullshit. It's cheaper to use your own computer. Also, whats up with no serves on the east coast of the US? The fuck is wrong with you?
‡₪TBC₪‡Grl.Lts.I. Mar 25, 2014 @ 5:09pm 
carefull of ddosers
thats one more step!
Kered13  [author] Mar 24, 2014 @ 6:10pm 
@General Pickleton: No, but you can ask the serveme admins to load the map on the server for you. They may or may not help you.
76561198130682523 Mar 24, 2014 @ 5:18pm 
XD
76561198130682523 Mar 24, 2014 @ 5:14pm 
jejeje
flushed emote Mar 24, 2014 @ 1:35pm 
is there a way to use custom maps using the tf2 reserve server thing?