How to set up your own CS:GO server using Amazon Web Services for free

This guide is based on this great reddit post, with a bunch of important additions and changes. It will go through all steps of setting up a Counter-Strike: Global Offensive server using Amazon Web Services’ free tier. There’s several reasons why you might want to do this, maybe you want to play matches with your team or have a retakes server, it’s up to you. Also, in the majority of use cases, the server is free (more info on pricing tiers below).

Prerequisites to get started:

  • Your Steam account must not be community banned or locked.
  • Your Steam account must not be limited.
  • Your Steam account must have a qualifying registered phone.
  • An Amazon Web Services account, which can be created for free.
  • A debit or credit card. Don’t worry. You will be charged around 2 rupees or around 3 cents. It will just be done to verify your card.

Assuming you have the fulfill the prerequisites, let’s start with the guide:

Creating Server Instance

  1. Log in to your AWS account as Root user.
  2. Select the region closest to your in the top-right corner.
  3. Choose EC2 from Services and select Launch Instance from the screen. You may get some error if you just created your account, wait a few hours and try again.
  4. On the next screen select Ubuntu server 20.04 from the list of machines you see. Remember to verify that you have selected the one with a Free tier eligible label.
  5. You now have to pick the instance type. To stay in the free tier, pick t2.micro. Tap Next: Configure Instance Details at the bottom.
  6. Don’t change anything on the Configure Instance Details screen, but continue on to Next: Add Storage.
  7. On the Add Storage screen, increase the storage size to 30 GiB in the Size column. The server will require at least 20 GiB, and 30 GiB is the limit for the free tier. Tap Next: Add Tags.
  8. Skip on to Next: Configure Security Group.
  9. Create the following rules:
    • SSH (used to access the server)
      • Type: SSH
      • Protocol: TCP
      • Port Range: 22
      • Source: Anywhere
    • TCP Ports (opens player connections to server)
      • Type: Custom TCP Rule
      • Protocol: TCP
      • Port Range: 27000-27020
      • Source: Anywhere
    • UDP Ports (opens player connections to server)
      • Type: Custom UDP Rule
      • Protocol: UDP
      • Port Range: 27000-27020
        Source: Anywhere
  10. Complete your server instance by tapping Review and Launch and then tapping Launch on the next screen.
  11. A pop-up will appear called Select an existing key pair or create a new key pair. This create a so-called key pair, consisting of a public and a private key. Whoever is in possession of the private key will be able to access the server securely. Select Create a New Key Pair and name it anything you want, e.g. “AWS CS GO Server Key Pair”. Tap Download Key Pair and then Launch Instances.
  12. Put the key pair .pem file somewhere safe on your computer.
  13. Tap View Instances and note down the instance’s IP address found in the IPv4 Public IP column.

Connecting to Server and Installing CS:GO

To securely connect to the server we will use the SSH protocol. If you are on Linux then install OpenSSH. If you are Windows then install Putty. If you are on macOS, you already have SSH installed.

  1. Open your Command Prompt and type ssh -i <path-to-my-keypair.pem> ubuntu@<instance-ip>.
    • If you get an “UNPROTECTED PRIVATE KEY FILE!” error, then just run sudo chmod 600 <path-to-my-keypair.pem>. If on Windows then go to properties of your key pair .pem file and go to Security and then Advanced. Then tap Disable Inheritance. Delete all the users in the list and just add yourself as the owner of the file.
  2. You are now connected to your AWS server instance and you’ll see a Ubuntu terminal in your terminal where we can set up the CS:GO server.
  3. First, add and update repositories by typing sudo -- sh -c 'dpkg --add-architecture i386; add-apt-repository multiverse; apt-get update; apt-get -y dist-upgrade'.
  4. Install Steam CMD using sudo apt-get install -y steamcmd. Accept the license when prompted.
  5. Create a directory for CS:GO using mkdir ~/csgosv and change to the directory by typing cd csgosv.
  6. Start SteamCMD using steamcmd.
  7. Inside SteamCMD, execute the following code:
    login anonymous
    force_install_dir /home/ubuntu/csgosv
    app_update 740 validate

    This will install Steam and CS:GO, and it’ll take around 10-15 minutes.

Configuring CS:GO Server

  1. While SteamCMD is updating, open Steam Game Server Account Management in your browser and log in with your steam account.
  2. Create a new game server account and use 730 for the App ID (Counter-Strike: Global Offensive) and type something in the Memo field, so you can remember where you are using this game token, e.g. “AWS CS GO Server”.
  3. Now we’ll configure the launch command that will start the CS:GO server. Copy the following into a text editor: @reboot /home/ubuntu/csgosv/srcds_run -game csgo -console -usercon -autoupdate -steam_dir "/home/ubuntu/.steam/steam/steamcmd" -steamcmd_script "/home/ubuntu/update.txt" +game_type 0 +game_mode 0 +mapgroup mg_active +map de_inferno +sv_setsteamaccount <your Steam game login token> -tickrate 128 -net_port_try 1 -nobots
  4. Replace <your Steam game login token> with the token you generated in step 2. You are free to change the other options, too:
    • +game_type and +game_mode can be changed depending on the type of server you want. Setting both to zero create a casual server, setting +game_type to 0 and +game_mode to 1 would create a server for competitive or scrimmage play, for instance. More info here.
    • -tickrate 128 sets the tick rate to 128 as opposed to 64, which is the standard for CS:GO competitive matchmaking.
    • -nobots can be removed if you want bots on your server
    • We’ll come back to the -autoupdate, -steam_dir and -steamcmd_script parameters, which have to do with keeping the server up to date.
  5. Once you’re happy with your launch command, come back to your terminal and when the update is done, exit SteamCMD by pressing Ctrl + C.
    • If you accidentally exited your AWS instance too, then reconnect using the same line as above: ssh -i <path-to-my-keypair.pem> ubuntu@<instance-ip>.
  6. Now type crontab -e to open crontab, a time-based job scheduler we’ll use to make sure the CS:GO server launches whenever the AWS instance is rebooted. Select the first editor and continue. It will open a file with several instructions all prefixed with #. Ignore them and type the full launch command on a new line.
  7. Save the file, most likely by tapping Ctrl + O, then Enter and then Ctrl + X.
  8. To make sure the server stays up to date, we need to add another file. Type cd ~ to go back to your home directory.
  9. Type touch update.txt
  10. Edit the file by typing nano update.txt
  11. Input the following:
    login anonymous
    force_install_dir "/home/ubuntu/csgosv"
    app_update 740
    quit
  12. Save the file by using Ctrl + O, then Enter and then Ctrl + X.
  13. Put this file in /home/ubuntu/.steam/steam/steamcmd.
  14. Go back to the web interface for the AWS instance and reboot it by selecting the server and then tapping Actions, Instance State and then Reboot.
  15. We are now done, close your terminal, open Counter-Strike: Global Offensive and type connect <instance IP address> into the console and you should connect to your server.