> ## Documentation Index
> Fetch the complete documentation index at: https://help.freakhosting.com/llms.txt
> Use this file to discover all available pages before exploring further.

# How to Host a Game Server on a Windows VPS with SteamCMD

> Host a game server on a Windows VPS: install SteamCMD, download the server with app_update, open its ports in Windows Firewall and start it automatically at boot.

To host a game server on a Windows VPS, download SteamCMD from Valve, unzip it to `C:\steamcmd`, and install the server with `steamcmd +force_install_dir C:\GameServers\mygame +login anonymous +app_update <app_id> validate +quit`. Then allow the game's ports in Windows Defender Firewall, start the server with its own start script, and add a scheduled task so it starts again after every reboot.

| Difficulty | Time | Works on | Needs |
| - | - | - | - |
| Intermediate | 30 to 60 minutes | Windows Server 2019 / 2022 / 2025 | Administrator account, the game's dedicated server app ID and ports |

## Before you start

* Sign in as an administrator with [Remote Desktop](https://help.freakhosting.com/portals/other/how-to-connect-to-windows-server-with-remote-desktop.md).
* Look up three things in the game's **official dedicated server guide**: the SteamCMD **app ID** of the dedicated server, its **ports** (and whether they are UDP or TCP), and the **start command or script**. Valve also keeps a list of dedicated server app IDs on the Valve Developer Community wiki.
* Check the game supports Windows Server. Some dedicated servers list only Windows 10/11 or only Linux.
* Have enough disk space for the server files plus updates (check with `Get-Volume`).

The example below uses Valheim, whose official guide gives the start script `start_headless_server.bat` and the default ports `2456-2457` ([Valheim dedicated server guide](https://valheim.com/support/a-guide-to-dedicated-servers/)). Replace the app ID, folder, ports and start command with your game's.

## How to install SteamCMD on Windows

SteamCMD is Valve's command-line Steam client for downloading and updating dedicated servers.

Open PowerShell as administrator (select **Start**, type `PowerShell`, right-click **Windows PowerShell** and choose **Run as administrator**) and run:

```powershell theme={null}
New-Item -ItemType Directory -Path C:\steamcmd
Invoke-WebRequest -UseBasicParsing -Uri "https://steamcdn-a.akamaihd.net/client/installer/steamcmd.zip" -OutFile C:\steamcmd\steamcmd.zip
Expand-Archive -Path C:\steamcmd\steamcmd.zip -DestinationPath C:\steamcmd
C:\steamcmd\steamcmd.exe +quit
```

The download URL is the one Valve publishes ([SteamCMD on the Valve Developer Community](https://developer.valvesoftware.com/wiki/SteamCMD)). On first run SteamCMD updates itself; `+quit` closes it when it's done.

## How to download the game server with SteamCMD

```powershell theme={null}
C:\steamcmd\steamcmd.exe +force_install_dir C:\GameServers\valheim +login anonymous +app_update <app_id> validate +quit
```

| Part | What it does |
| - | - |
| `+force_install_dir C:\GameServers\valheim` | Where the server files go. Valve says to set this **before** `+login`. |
| `+login anonymous` | Most dedicated servers download without a Steam account. Some need a real account; the game's guide says so. |
| `+app_update <app_id> validate` | Downloads or updates the server. `validate` checks every file against Steam's copy. |
| `+quit` | Logs off Steam cleanly. |

Run the same command again whenever the game releases an update.

## How to open the game's ports in Windows Firewall

Windows Defender Firewall blocks incoming connections that no rule allows. Add rules for your game's ports. Valheim's guide gives the range `2456-2457` but not the protocol, so this example allows both UDP and TCP:

```powershell theme={null}
New-NetFirewallRule -DisplayName "Valheim UDP 2456-2457" -Direction Inbound -Protocol UDP -LocalPort 2456-2457 -Action Allow
New-NetFirewallRule -DisplayName "Valheim TCP 2456-2457" -Direction Inbound -Protocol TCP -LocalPort 2456-2457 -Action Allow
```

If your game's guide names only UDP or only TCP, create just that rule. If you filter traffic in the [Firewall panel](https://help.freakhosting.com/portals/firewall/firewall-panel-overview.md), allow the same ports there; for UDP game traffic you may also want a [DDoS filter](https://help.freakhosting.com/portals/firewall/how-to-apply-ddos-filters.md) that matches your game.

> [!WARNING]
>
> Only open the ports the game needs. Don't turn Windows Firewall off to "make it work": that exposes Remote Desktop and every other service on the server.

## How to start the server

Most games ship a start script or document a command line. Edit it before the first start to set the name, world and password. For Valheim, open `C:\GameServers\valheim\start_headless_server.bat` in Notepad and set `-name`, `-world`, `-password` and `-port`, then run it:

```powershell theme={null}
cd C:\GameServers\valheim
.\start_headless_server.bat
```

Leave the window open while the server runs. Closing it stops the server.

## How to start the game server automatically after a reboot

A scheduled task can start the server when Windows starts, without anyone signing in. Run it as a separate, non-administrator user so a game exploit can't take over the whole server.

**1. Create a user for the game server**

```powershell theme={null}
$Password = Read-Host -AsSecureString
New-LocalUser -Name "gameserver" -Password $Password -Description "Runs the game server"
```

**2. Give it access to the server folder**

```powershell theme={null}
icacls C:\GameServers\valheim /grant "gameserver:(OI)(CI)M"
```

`M` (modify) lets it write saves and logs in that folder only.

**3. Create the task**

```powershell theme={null}
$Action   = New-ScheduledTaskAction -Execute "C:\GameServers\valheim\start_headless_server.bat" -WorkingDirectory "C:\GameServers\valheim"
$Trigger  = New-ScheduledTaskTrigger -AtStartup
$Settings = New-ScheduledTaskSettingsSet -ExecutionTimeLimit ([TimeSpan]::Zero) -RestartCount 3 -RestartInterval (New-TimeSpan -Minutes 1)
$Cred     = Get-Credential -UserName "gameserver" -Message "Password for gameserver"
Register-ScheduledTask -TaskName "Valheim server" -Action $Action -Trigger $Trigger -Settings $Settings -User $Cred.UserName -Password $Cred.GetNetworkCredential().Password
```

By default Task Scheduler stops a task after 72 hours; a time limit of zero lets the server run indefinitely ([Microsoft Learn](https://learn.microsoft.com/en-us/windows/win32/taskschd/tasksettings-executiontimelimit)).

**4. Test it**

```powershell theme={null}
Start-ScheduledTask -TaskName "Valheim server"
Get-ScheduledTask -TaskName "Valheim server" | Select-Object TaskName, State
```

`State` shows `Running`. Then restart the server with `Restart-Computer` and check that it comes back on its own.

To stop it: `Stop-ScheduledTask -TaskName "Valheim server"`.

## How to check it worked

* On the server, check the game is listening: `Get-NetUDPEndpoint -LocalPort 2456` for UDP, or `Get-NetTCPConnection -LocalPort 2456 -State Listen` for TCP. An entry means the port is in use by the game.
* From your own computer, connect in the game with `203.0.113.10:2456` (your server's IP and game port).
* If players can't connect, see [check if a port is open from outside](https://help.freakhosting.com/portals/other/how-to-check-if-a-port-is-open-from-outside.md). UDP ports can't be tested like TCP ports, so joining from the game is the real test.

## Frequently asked questions

### Windows or Linux for a game server?

Use whatever the game's developer supports best. Many dedicated servers run on both; on Linux you can use [LinuxGSM](https://help.freakhosting.com/portals/other/how-to-host-game-servers-with-linuxgsm.md). Choose Windows when the server is Windows-only or your mods or tools need it.

### How do I update the game server?

Stop the server, run the same `steamcmd ... +app_update <app_id> validate +quit` command, and start it again.

### SteamCMD can't log in or downloads nothing. What now?

Check the app ID, that `+force_install_dir` comes before `+login`, and whether the game requires a real Steam account instead of `anonymous`. Also check the server has free disk space.

### How much RAM does a game server need?

It depends on the game, player count and mods. Check the game's official requirements and watch usage under load with Task Manager or [monitor Windows Server performance](https://help.freakhosting.com/portals/other/how-to-monitor-windows-server-performance.md).

## Related guides

> [card] [VPS and dedicated server guides](https://help.freakhosting.com/portals/other/vps-and-dedicated-server-guides.md)
>
> Every guide in this section.

> [card] [Open a port in Windows Firewall](https://help.freakhosting.com/portals/other/how-to-open-a-port-in-windows-firewall.md)
>
> Inbound rules explained.

> [card] [Monitor Windows Server performance](https://help.freakhosting.com/portals/other/how-to-monitor-windows-server-performance.md)
>
> CPU, RAM and network under load.

> [card] [Host game servers with LinuxGSM](https://help.freakhosting.com/portals/other/how-to-host-game-servers-with-linuxgsm.md)
>
> The Linux alternative.

> [card] [Apply DDoS filters](https://help.freakhosting.com/portals/firewall/how-to-apply-ddos-filters.md)
>
> Protect UDP game traffic.

***

> [!NOTE]
>
> **Checked against [SteamCMD on the Valve Developer Community](https://developer.valvesoftware.com/wiki/SteamCMD), the [Valheim dedicated server guide](https://valheim.com/support/a-guide-to-dedicated-servers/) and Microsoft Learn ([New-NetFirewallRule](https://learn.microsoft.com/powershell/module/netsecurity/new-netfirewallrule), [Register-ScheduledTask](https://learn.microsoft.com/powershell/module/scheduledtasks/register-scheduledtask), [task execution time limit](https://learn.microsoft.com/en-us/windows/win32/taskschd/tasksettings-executiontimelimit))** on 4 November 2026. Not tested on a live Windows server for this page; every game's app ID, ports and start options differ.

> [!NOTE]
>
> ### Need Extra Help?
>
> If you encounter any issues, our support team is ready to assist:
>
> * **Live Chat:** Quick assistance via our website.
> * **Support Ticket:** [Open a Ticket](https://freakhosting.com/clientarea/submitticket.php)
> * **Discord:** [Join our Community](https://discord.gg/freakhosting)
> * **Email:** [support@freakhosting.com](mailto:support@freakhosting.com)

> [!TIP]
>
> ### Save on Your Hosting
>
> Ready to upgrade your hosting? Use code **KB20** at checkout for **20% off** your first order!

***

**Last Updated:** November 2026


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.