13

How to Setup CS:GO Dedicated Server on Microsoft Azure

 2 years ago
source link: https://edi.wang/post/2022/6/16/how-to-setup-csgo-dedicated-server-on-microsoft-azure
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Pre-requests


CS:GO is a popular FPS game that has been around for over 10 years. This article will show you how to setup CS:GO dedicated server on Azure using a Windows VM and Storage Account. The server will be able to let clients download custom maps from the Storage Account with FastDL.

You must have:

  1. An Azure Subscription for
    • Virtual Machine
    • Storage Account
  2. Steam Account
    • With your mobile phone number added
  3. csgosl tool

Steps


1. Create VM

First, create a virtual machine. 

Go to Azure portal, click "Create a resource" and search for Virtual machine.

img-c02393a7-dcf4-4999-a72d-99ccbaa0d09c.png

I'll be using Windows Server 2022 Datacenter Azure Edition Gen2 with D2s_V3 SKU. The virtual machine size depends on your server's workloads. If you have 7x24 game players on your server, you'll likely use D or F series VMs.

img-c80cdbef-40de-49bf-8e13-15d3473b6d96.png

After the VM is created, go to "Networking" tab and add 27015,27016,27017 to the NSG inbound port rules. These are the ports CSGO is using.

img-a6d04cb3-1665-46b9-a8b0-4dcfa4fb994c.png

Optionally, you can set a custom DNS name or bind your own domain name to your VM, so that game players won't have to remember your IP address.

2. Create Storage Account

Next, we will create a Storage Account, which is for hosting your custom maps or other resources that client will need to download. CS:GO server recommend to use FastDL that enable a client to download resources from a web server because the game server has download speed limitation. This is why we'll be using a Storage Account with static website enabled. It is the most cost effect method for hosting static files as web server on Azure.

In Azure portal, click "Create a resource" and search for "Storage Account", create a storage account as you like. I'll be using LRS to save money because a game server backup isn't really important to me.

img-f1cc2f60-0599-490e-a7f4-5e3b954afae9.png

After the Storage Account is created. Go to "Static website" tab, and enable the Static website feature. Please copy the Primary endpoint URL. This will be used to configure FastDL in CS:GO server.

img-33053457-4221-43e2-9841-68092d8bc6b5.png

At this time, Azure will create a new container named "$web" in the Storage Account, which we will be using to upload CS:GO maps or any other game resources that client will have to download.

img-d624ad12-8aa3-4ec5-a2c2-1fcc70206763.png

I also turned off HTTPs requirement for the static web server for more fast download. This won't turn of port 443, it is just allowing access from port 80. This is up to you. 

img-10239ffe-2abf-4324-9e10-b11aabe09225.png

3. Install csgosl

Now, RDP into your VM. 

Download csgosl from https://github.com/lenosisnickerboa/csgosl and extract it into your desired location, like "C:\csgosl-windows\csgosl".

Run csgosl batch file.

img-8a2a44ce-7621-4167-b130-c844fcb59897.png

Click "Install server".

img-ccebc052-90c0-419b-83ca-2472fc539d1b.png

It will take around 30 minutes to download CS:GO server files.

img-172f8aea-1ea4-40c2-a2bc-44476a9c952a.png

When the download is completed, click "Restart csgosl".

img-b54e84ea-d9ed-4497-aff5-3c220162db18.png

4. Configure CS:GO server

In csgosl. Uncheck "lanonly" checkbox to enable public internet access. 

img-fb010f5a-218e-4146-bba6-722b80461f79.png

Check "fastdl" to enable FastDL. Use the Primary Endpoint URL from step 2. If you have HTTPS turned off, you can also use http instead of https in the URL.

img-afef7963-922a-4107-a405-fbaa4db170e1.png

You may have to add "+sv_allowdownload 1 +sv_allowupload 1" in Misc options.

img-660ea531-439f-45af-bc05-8778a2327e5a.png

In Steam settings. Enter your steamusername, steamid and gameserverlogintoken

The steamid is for you to manage Sourcemod plugin in game. If you don't use Sourcemod, you can leave it blank.

You can get the token from https://steamcommunity.com/dev/managegameservers 

img-b981d9f3-4fb9-4acf-8913-abe310da2228.png

Copy your custom maps to your server location, in my case it's "C:\csgosl-windows\csgosl\server\csgo\maps".

img-435ec155-c16e-441c-b063-b6e5117960a2.png

Now, you can create Map groups to rotate your custom maps.

img-46119148-930e-458a-b4fb-c2df302e330d.png

The map group is used in Run settings.

img-32414b90-fa7b-4839-a2d8-399ee69a5db2.png

Now, we will need to copy custom maps to Azure Storage Account for client to download. Use Azure Storage Explorer to navigate to the $web container, create a new folder named "maps".

img-add663a1-6476-42b7-9150-8608d8455922.png

Upload your maps to this folder. 

img-ba8c790f-f976-4287-8d0d-f06cfac883ab.png

You can use your browser to test if your maps can be downloaded from HTTP.

img-90e87929-c152-4829-8b61-af7df64b4714.png

If everything is OK. Click "Start server" in csgosl.

img-d5cff995-4ab4-417a-a888-1b26a5987a01.png

It will launch CS:GO server console. Wait until you see steam token login is success and your public IP address is shown.

img-65d50d7f-f2dd-40ed-a13f-3cebf660dec2.png

5. Test your server

Run CS:GO game on client machine.

Set Enable Developer Console to yes.

Enter "connect xxx.xxx.xxx.xxx" which xxx.xxx.xxx.xxx is your server's public IP address or domain name.

If everything is good, you will now be able to download custom map and enter game.

Reference: https://developer.valvesoftware.com/wiki/Counter-Strike:_Global_Offensive_Dedicated_Servers


Recommend

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK