Complete automated setup of Counter-Strike 2 server on Hetzner Cloud for casual gaming with friends.
cd terraform/
cp terraform.tfvars.example terraform.tfvars
# 2. Create infrastructure
terraform init
terraform apply
# 3. Deploy CS2 server
cd ../ansible/
nano inventory.yml # set IP address
ansible-playbook -i inventory.yml playbook.yml
- Hetzner Cloud account + API token
- Terraform installed
- Ansible installed
- SSH key (~/.ssh/)
โ Automatically configured VPS (Ubuntu 22.04) โ Counter-Strike 2 dedicated server โ Metamod:Source + CounterStrikeSharp (plugin framework) โ AIM maps (Dust2, Mirage, custom aim maps) โ Admin plugins (kick, ban, map change) โ Systemd service (auto-restart on crash) โ Firewall (SSH + CS2 ports)
- de_dust2 - Classic
- de_mirage - Popular competitive
- aim_map - Custom AIM training
Maps automatically rotate after each match.
# Ansible
ansible-playbook -i inventory.yml playbook.yml # Deploy
# Server management
ssh root@YOUR-IP
sudo systemctl status cs2-server
sudo systemctl restart cs2-server
sudo journalctl -u cs2-server -f # Logsrcon_password zmensito123
rcon status
rcon changelevel de_mirage
rcon say "Hello everyone!"
ssh root@YOUR-IP
# Use RCON commands from server consoleServer comes with pre-installed:
- CounterStrikeSharp - Plugin framework for CS2
- Metamod:Source - Base for plugins
- Find plugin for CounterStrikeSharp
- Download
.dllfile - Upload to
/home/steam/cs2/game/csgo/addons/counterstrikesharp/plugins/ - Restart server
Recommended plugins:
- CSS Admin - Admin commands
- Map Chooser - Map voting
- Deathmatch - Respawn mode
- CS2 Dedicated Server Docs: https://developer.valvesoftware.com/wiki/Counter-Strike_2/Dedicated_Servers
- CounterStrikeSharp: https://docs.cssharp.dev/
- CS2 Maps: https://steamworkshop.download/app/730
Free to use, modify and distribute. Have fun! ๐ฎ
Made with โค๏ธ for the CS2 community