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
- Log in to your AWS account as Root user.
- Select the region closest to your in the top-right corner.
- 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.
- 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.
- 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.
- Don’t change anything on the Configure Instance Details screen, but continue on to Next: Add Storage.
- 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.
- Skip on to Next: Configure Security Group.
- 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
- SSH (used to access the server)
- Complete your server instance by tapping Review and Launch and then tapping Launch on the next screen.
- 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.
- Put the key pair .pem file somewhere safe on your computer.
- 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.
- 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.
- If you get an “UNPROTECTED PRIVATE KEY FILE!” error, then just run
- 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.
- 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'
. - Install Steam CMD using
sudo apt-get install -y steamcmd
. Accept the license when prompted. - Create a directory for CS:GO using
mkdir ~/csgosv
and change to the directory by typingcd csgosv
. - Start SteamCMD using
steamcmd
. - 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
- While SteamCMD is updating, open Steam Game Server Account Management in your browser and log in with your steam account.
- 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”. - 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
- 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
to0
and+game_mode
to1
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.
- 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>
.
- If you accidentally exited your AWS instance too, then reconnect using the same line as above:
- 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. - Save the file, most likely by tapping Ctrl + O, then Enter and then Ctrl + X.
- To make sure the server stays up to date, we need to add another file. Type
cd ~
to go back to your home directory. - Type
touch update.txt
- Edit the file by typing
nano update.txt
- Input the following:
login anonymous
force_install_dir "/home/ubuntu/csgosv"
app_update 740
quit - Save the file by using Ctrl + O, then Enter and then Ctrl + X.
- Put this file in
/home/ubuntu/.steam/steam/steamcmd
. - 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.
- 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.