A Terraform module to implement a CS: GO Server on AWS. You can read more about this project in our TechBlog.
The server is managed by Linux GSM (Game Server Manager) and deployed to EC2. The game server will be automatically registered, and alerts will be emitted to a webhook (if provided).
Copy the example on examples/complete
. then:
- Generate a GSLT token from Steam (access https://steamcommunity.com/dev/managegameservers to generate, use app_id 730).
- Update the configuration of main.tf to match yours.
- Run terraform init.
- Run terraform plan.
- Run terraform apply.
- Wait until setup is finished.
The initial setup usually takes ~30min.
An id_rsa.pem and an id_rsa.pub files will be created in your module root folder.
Use the id_rsa.pem (the private key) to connect to the server.
- SSH into the instance using user csgoserver (
ssh -i id_rsa.pem csgoserver@<server ip>
); - Manipulate the server using
./csgoserver <command>
;
You can get a list of commands using just ./csgoserver
;
- SSH into the instance
- Run
vncpasswd
and crete a password (answer no view only password); - Start the vncserver using
vncserver -localhost no
- Connect using a VNC Client (e.g. TigerVNC) using
<server_ip>:1
and provide the password you've just configured.
- Enable Developer Console in
Settings > Game
. - Open the console using
'
. - Type
connect csgo.<provided_domain>
orconnect <instance_ip>
.
If a password was provided, instead use
connect <ip>; password <pass>
.
- Ensure you have connected to your server using the instructions above.
- Open the in-game developer console by pressing the tilde (~) key.
- Type
rcon_address <server_ip>
to set your rcon_address; - Type
rcon_password <your_password>
to set your password; - Confirm rcon is working by issuing
rcon status
in the console;
The following table describes the available variables.
variable | type | description | default | required |
---|---|---|---|---|
app | string | The name of this application | csgo | |
env | string | The environment of the current application | prod | |
subnet_id | string | The public subnet id to host the ec2 instance | - | x |
instance_type | string | The instance type | t3.large | |
gslt | string | The server token provided by Steam | - | x |
max_players | string | The maximum number of players in this server | 32 | |
slack_webhook_url | string | The alerts webhook | - | |
sv_password | string | The server password, empty means public | - | |
sv_contact | string | The e-mail of the server owner | - | |
sv_tags | string | The tags for the search system | 64-tick,casual,dust2,zrp | |
sv_region | string | The server region, defaults to World | 255 |
The following table contains the set of outputs generated by this module.
output | type | description | sensitive |
---|---|---|---|
public_ssh_key | string | The public ssh key | |
private_ssh_key_path | string | The SSM path for the SSH private key | |
instance_public_ip | string | The instance ip | |
instance_arn | string | The instance arn | |
rcon_password | string | The server rcon password | x |