> For the complete documentation index, see [llms.txt](https://docs.edgegap.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.edgegap.com/docs/sample-projects/godot/godotsteam-server.md).

# GodotSteam Server on Edgegap

GodotSteam Server dedicated server on Edgegap: headless Linux export, Steam logon and auth tickets, Docker, deployment and Steam clients.

[GodotSteam Server](https://codeberg.org/godotsteam/godotsteam-server) is the dedicated server flavor of GodotSteam. It wraps Steam's game server API (`SteamGameServer`) for Godot, so a headless server can log on to Steam, get its own Steam ID and check that every player who joins is a real Steam user who owns your game.

This guide takes a Godot 4 project from nothing to a GodotSteam Server dedicated server running on Edgegap, with a Steam client that connects and passes the Steam auth ticket check. Players connect with Godot's built-in ENet (UDP); Steam is used for identity, ownership and anti-cheat checks.

The complete project from this guide is on GitHub: [edgegap/server-sample-godotsteam-dedicated-server](https://github.com/edgegap/server-sample-godotsteam-dedicated-server). Clone it, run `./tools/fetch-godotsteam.sh` to download the GodotSteam add-ons, and follow its README to run the server in a few commands.

{% hint style="success" %}
**Tested on 2026-11-09** with Godot 4.7.2, GodotSteam Server 4.12.1 (GDExtension), GodotSteam 4.24 (GDExtension) and Steamworks SDK 1.65: the server logged on to Steam anonymously on Edgegap, a Windows client connected over ENet, its auth ticket was validated by Steam, and the deployment stopped itself when the client left.
{% endhint %}

## ✔️ Preparation

Before you get started, make sure to [create a free account with Edgegap](https://app.edgegap.com/auth/register) (no credit card required).

**Configure a few essentials on your development machine:**

* [Godot 4.4 or newer](https://godotengine.org/download) with the **Linux** export templates (Editor / Manage Export Templates). GodotSteam Server's GDExtension requires Godot 4.4+.
* [Docker Desktop (or Docker CLI)](https://www.docker.com/products/docker-desktop/).
* The Steam client, installed and signed in, to test your game client.
* A Steam App ID. This guide uses `480` (Spacewar), Valve's test app that every Steam account can use. Replace it with your own App ID before you ship.

{% hint style="info" %}
New to dedicated servers in Godot? Start with [Godot - Getting Started](/godot.md) to learn the export, Docker and deploy steps with the Edgegap plugin, then come back to add Steam.
{% endhint %}

## 🧩 1. Install GodotSteam

GodotSteam comes in two flavors, and a client/server game uses both:

| Add-on                | Singleton     | Used by          | Download                                                                                                                                                                                                       |
| --------------------- | ------------- | ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **GodotSteam Server** | `SteamServer` | Dedicated server | [Codeberg releases](https://codeberg.org/godotsteam/godotsteam-server/releases) (`godotsteam-server-<version>-gdextension-plugin-4.4.zip`), or "GodotSteam Server GDExtension 4.4+" in the Godot Asset Library |
| **GodotSteam**        | `Steam`       | Game client      | [Codeberg releases](https://codeberg.org/godotsteam/godotsteam/releases) (`godotsteam-<version>-gdextension-plugin-4.4.zip`), or "GodotSteam GDExtension 4.4+" in the Godot Asset Library or Asset Store       |

☑️ Unzip both into your project, so you get `addons/godotsteam_server/` and `addons/godotsteam/`. The Steamworks API library (`libsteam_api.so`, `steam_api64.dll`, ...) is already inside each add-on.

{% hint style="info" %}
**GDExtension or module?** This guide uses the GDExtension builds: they work with the standard Godot editor and the standard export templates. The module builds (`godotsteam-server` templates and editor) are a custom Godot build; if you use them, export the server with the GodotSteam Server templates instead and skip the add-on folder. Never mix GDExtension and module builds in one project.
{% endhint %}

{% hint style="warning" %}
With both add-ons in one project, the editor prints errors such as `Attempt to register extension class 'SteamProjectSettings', which appears to be already registered`. Both add-ons declare that settings class. It did not affect the server or the client in our test, and each export in this guide ships only one of the two add-ons, so exported builds don't have it.
{% endhint %}

✅ You may now proceed to the next step.

## 🔧 2. Add the Server and Client Script

The script below is one autoload that runs as the dedicated server in a server export and as the client everywhere else. It uses `Engine.get_singleton()` so it still parses in exports that ship only one of the two add-ons.

**What the server does:**

1. `serverInitEx()` starts the Steam game server API with your game port, query port, authentication mode and version string.
2. Sets the server's product, description, mod dir, name and player count. Steam only accepts these **before** logging on.
3. `logOnAnonymous()` logs on to Steam with a temporary Steam ID, or `logOn(token)` with a Game Server Login Token when `STEAM_GSLT` is set (see [#steam-account-and-game-server-login-token](#steam-account-and-game-server-login-token "mention")).
4. Opens an ENet server on port `7777`. When a peer connects, it sends the peer the server's Steam ID and waits up to 15 seconds for a Steam auth ticket.
5. `beginAuthSession()` hands the ticket to Steam; the `validate_auth_ticket_response` signal says whether the player is allowed. Players that fail or never send a ticket are disconnected.
6. When everyone has left (or nobody joined within 2 minutes), it logs off from Steam and deletes its own Edgegap deployment, so you stop paying for an empty server.

**What the client does:** initializes Steam with your App ID, connects with ENet, asks Steam for an auth session ticket bound to the server's Steam ID, waits until Steam confirms the ticket, and sends it to the server.

{% hint style="warning" %}
Steam signals only fire when you call `run_callbacks()`. The script calls `SteamServer.run_callbacks()` (and `Steam.run_callbacks()` on the client) every frame in `_process`. GodotSteam's "embed callbacks" project setting hooks into rendering frames instead, which a headless server doesn't draw.
{% endhint %}

☑️ Save the script as `res://net/session.gd`.

{% code title="net/session.gd" lineNumbers="true" expandable="true" %}

```gdscript
extends Node
## One autoload for both sides of the connection.
## Server (dedicated_server export or `-- --server`): ENet on GAME_PORT, logged on to Steam
## with GodotSteam Server, and every player must pass a Steam auth ticket check.
## Client (GodotSteam): connects with ENet, then sends a Steam auth ticket to the server.
## Uses Engine.get_singleton() so the script parses in exports that ship only one of the two add-ons.

const STEAM_APP_ID := 480            # Spacewar, Valve's test app. Use your own App ID.
const SERVER_VERSION := "1.0.0.0"    # x.x.x.x; Steam only lists servers on the latest version.
const GAME_PORT := 7777              # ENet, UDP. Edgegap port "gameport".
const QUERY_PORT := 27015            # Steam queries, UDP. Edgegap port "queryport".
const MAX_PLAYERS := 8
const AUTH_TIMEOUT_SEC := 15.0       # Kick peers that don't send a valid ticket in time.
const NO_PLAYER_TIMEOUT_SEC := 120.0 # Stop the deployment if nobody joins.

# SteamServer.ServerMode and the BeginAuthSession / AuthSession results we check.
const SERVER_MODE_AUTHENTICATION := 2
const BEGIN_AUTH_RESULT_OK := 0
const AUTH_SESSION_RESPONSE_OK := 0

var steam_server: Object  # SteamServer singleton, server only
var steam: Object         # Steam singleton, client only
var server_steam_id := 0
var players := {}         # peer_id -> steam_id, authenticated players
var pending := {}         # peer_id -> {"steam_id": int, "deadline": float}
var had_players := false
var stopping := false


func _ready() -> void:
	if is_server_launch():
		_start_server()
	else:
		_start_client()


func _process(_delta: float) -> void:
	# Steam callbacks (signals) only fire when this is called.
	if steam_server:
		steam_server.run_callbacks()
	if steam:
		steam.run_callbacks()
	if multiplayer.is_server() and steam_server:
		_check_timeouts()


static func is_server_launch() -> bool:
	return OS.has_feature("dedicated_server") or "--server" in OS.get_cmdline_user_args()


# ---------------------------------------------------------------- server

func _start_server() -> void:
	steam_server = Engine.get_singleton("SteamServer")
	if steam_server == null:
		_fail("GodotSteam Server add-on not loaded")
		return

	# Edgegap maps internal ports to random external ones. Steam advertises the game port we
	# pass here, so give it the external port players actually connect to.
	var advertised_port := int(_env("ARBITRIUM_PORT_GAMEPORT_EXTERNAL", str(GAME_PORT)))
	var init: Dictionary = steam_server.serverInitEx("0.0.0.0", advertised_port, QUERY_PORT,
			SERVER_MODE_AUTHENTICATION, SERVER_VERSION)
	if init.get("status", -1) != 0:
		_fail("serverInitEx failed: %s" % init)
		return
	print("STEAM init ok game_port=%d query_port=%d" % [advertised_port, QUERY_PORT])

	steam_server.server_connected.connect(_on_steam_connected)
	steam_server.server_connect_failure.connect(_on_steam_connect_failure)
	steam_server.server_disconnected.connect(_on_steam_disconnected)
	steam_server.validate_auth_ticket_response.connect(_on_validate_auth_ticket_response)

	# These must be set before logging on.
	steam_server.setModDir("spacewar")        # Your game's folder name on Steam.
	steam_server.setProduct(str(STEAM_APP_ID))
	steam_server.setGameDescription("GodotSteam Server on Edgegap")
	steam_server.setDedicatedServer(true)
	steam_server.setMaxPlayerCount(MAX_PLAYERS)
	steam_server.setServerName("Edgegap %s" % _env("ARBITRIUM_REQUEST_ID", "local"))
	steam_server.setMapName("arena")

	var gslt := _env("STEAM_GSLT", "")
	if gslt.is_empty():
		steam_server.logOnAnonymous()
	else:
		steam_server.logOn(gslt)  # Persistent Steam ID, needs a Game Server Login Token.
	steam_server.setAdvertiseServerActive(true)

	var peer := ENetMultiplayerPeer.new()
	var err := peer.create_server(GAME_PORT, MAX_PLAYERS)
	if err != OK:
		_fail("ENet create_server failed: %s" % error_string(err))
		return
	multiplayer.multiplayer_peer = peer
	multiplayer.peer_connected.connect(_on_peer_connected)
	multiplayer.peer_disconnected.connect(_on_peer_disconnected)
	print("SERVER listening udp=%d request_id=%s" % [GAME_PORT, _env("ARBITRIUM_REQUEST_ID", "-")])
	get_tree().create_timer(NO_PLAYER_TIMEOUT_SEC).timeout.connect(func():
		if not had_players:
			_stop_server("nobody joined"))


func _on_steam_connected() -> void:
	server_steam_id = steam_server.getSteamID()
	var ip: Dictionary = steam_server.getPublicIP()
	print("STEAM logged on steam_id=%d public_ip=%s secure=%s" % [server_steam_id,
			_ip_to_string(ip.get("ipv4", 0)), steam_server.isServerSecure()])


func _on_steam_connect_failure(result: int, retrying: bool) -> void:
	print("STEAM connect failure result=%d retrying=%s" % [result, retrying])


func _on_steam_disconnected(result: int) -> void:
	print("STEAM disconnected result=%d" % result)


func _on_peer_connected(peer_id: int) -> void:
	pending[peer_id] = {"steam_id": 0, "deadline": Time.get_ticks_msec() / 1000.0 + AUTH_TIMEOUT_SEC}
	print("PEER connected peer=%d, waiting for Steam ticket" % peer_id)
	# Tell the client who we are: it binds its ticket to this server's Steam ID.
	server_hello.rpc_id(peer_id, server_steam_id)


func _on_peer_disconnected(peer_id: int) -> void:
	pending.erase(peer_id)
	if players.has(peer_id):
		steam_server.endAuthSession(players[peer_id])
		players.erase(peer_id)
	print("PEER left peer=%d players=%d" % [peer_id, players.size()])
	if had_players and players.is_empty() and pending.is_empty():
		_stop_server("everyone left")


@rpc("any_peer", "reliable")
func submit_ticket(ticket: PackedByteArray, steam_id: int) -> void:
	if not multiplayer.is_server():
		return
	var peer_id := multiplayer.get_remote_sender_id()
	if not pending.has(peer_id):
		return
	var result: int = steam_server.beginAuthSession(ticket, ticket.size(), steam_id)
	print("AUTH begin peer=%d steam_id=%d result=%d" % [peer_id, steam_id, result])
	if result != BEGIN_AUTH_RESULT_OK:
		_kick(peer_id, "ticket rejected (%d)" % result)
		return
	pending[peer_id]["steam_id"] = steam_id
	# Steam answers with validate_auth_ticket_response a moment later.


func _on_validate_auth_ticket_response(steam_id: int, response: int, owner_id: int) -> void:
	for peer_id in pending.keys():
		if pending[peer_id]["steam_id"] != steam_id:
			continue
		pending.erase(peer_id)
		if response != AUTH_SESSION_RESPONSE_OK:
			steam_server.endAuthSession(steam_id)
			_kick(peer_id, "Steam auth failed (%d)" % response)
			return
		players[peer_id] = steam_id
		had_players = true
		print("AUTH ok peer=%d steam_id=%d owner=%d players=%d" % [peer_id, steam_id, owner_id, players.size()])
		welcome.rpc_id(peer_id, players.size())
		return
	# A response for a player already in the game means Steam ended their session (ban, logged in elsewhere).
	for peer_id in players.keys():
		if players[peer_id] == steam_id and response != AUTH_SESSION_RESPONSE_OK:
			_kick(peer_id, "Steam session ended (%d)" % response)


func _check_timeouts() -> void:
	var now := Time.get_ticks_msec() / 1000.0
	for peer_id in pending.keys():
		if now > pending[peer_id]["deadline"]:
			_kick(peer_id, "no Steam ticket")


func _kick(peer_id: int, reason: String) -> void:
	print("KICK peer=%d reason=%s" % [peer_id, reason])
	pending.erase(peer_id)
	multiplayer.multiplayer_peer.disconnect_peer(peer_id)


func _stop_server(reason: String) -> void:
	if stopping:
		return
	stopping = true
	print("SERVER stopping reason=%s" % reason)
	steam_server.setAdvertiseServerActive(false)
	steam_server.logOff()
	steam_server.serverShutdown()
	var url := _env("ARBITRIUM_DELETE_URL", "")
	if url.is_empty():
		get_tree().quit()
		return
	# Edgegap: delete our own deployment so it stops billing.
	var http := HTTPRequest.new()
	add_child(http)
	http.request_completed.connect(func(result, code, _h, _b):
		print("SERVER self_stop result=%d http=%d" % [result, code])
		get_tree().quit())
	http.request(url, ["authorization: " + _env("ARBITRIUM_DELETE_TOKEN", "")], HTTPClient.METHOD_DELETE)


# ---------------------------------------------------------------- client

func _start_client() -> void:
	steam = Engine.get_singleton("Steam")
	if steam == null:
		_fail("GodotSteam add-on not loaded")
		return
	var init: Dictionary = steam.steamInitEx(STEAM_APP_ID)
	if init.get("status", -1) != 0:
		_fail("Steam init failed, is Steam running and logged in? %s" % init)
		return
	print("CLIENT steam_id=%d name=%s" % [steam.getSteamID(), steam.getPersonaName()])

	var address := _arg("connect", "127.0.0.1:%d" % GAME_PORT)
	var host := address.get_slice(":", 0)
	var port := int(address.get_slice(":", 1))
	var peer := ENetMultiplayerPeer.new()
	var err := peer.create_client(host, port)
	if err != OK:
		_fail("ENet create_client failed: %s" % error_string(err))
		return
	multiplayer.multiplayer_peer = peer
	multiplayer.connection_failed.connect(func(): _fail("could not reach %s" % address))
	multiplayer.server_disconnected.connect(func(): _status("Disconnected by server"))
	_status("Connecting to %s..." % address)


@rpc("authority", "reliable")
func server_hello(steam_id_of_server: int) -> void:
	# A ticket bound to this server's Steam ID can't be replayed against another server.
	var ticket: Dictionary = steam.getAuthSessionTicket(steam_id_of_server)
	var bytes: PackedByteArray = ticket["buffer"].slice(0, ticket["size"])
	# Steam needs a moment to register the ticket: send it once Steam confirms.
	while true:
		var response: Array = await steam.get_auth_session_ticket_response
		if response[0] == ticket["id"]:
			if response[1] != 1:  # Steam Result OK
				_fail("Steam could not issue a ticket (result %d)" % response[1])
				return
			break
	_status("Connected, sending Steam ticket (%d bytes) to server %d" % [bytes.size(), steam_id_of_server])
	submit_ticket.rpc_id(1, bytes, steam.getSteamID())


@rpc("authority", "reliable")
func welcome(player_count: int) -> void:
	_status("AUTHENTICATED by Steam, %d player(s) on the server" % player_count)
	if "--quit-after-auth" in OS.get_cmdline_user_args():
		await get_tree().create_timer(2.0).timeout
		get_tree().quit()


# ---------------------------------------------------------------- helpers

func _status(text: String) -> void:
	print("CLIENT " + text)
	var label := get_tree().current_scene as Label
	if label:
		label.text = text


func _fail(text: String) -> void:
	push_error(text)
	print("ERROR " + text)
	if is_server_launch():
		get_tree().quit(1)
	else:
		_status(text)


static func _env(key: String, default: String) -> String:
	var value := OS.get_environment(key)
	return default if value.is_empty() else value


static func _arg(key: String, default: String) -> String:
	for a in OS.get_cmdline_user_args():
		if a.begins_with("--%s=" % key):
			return a.get_slice("=", 1)
	return default


static func _ip_to_string(ip: int) -> String:
	return "%d.%d.%d.%d" % [(ip >> 24) & 255, (ip >> 16) & 255, (ip >> 8) & 255, ip & 255]
```

{% endcode %}

☑️ Register it as an autoload named `Session`, and turn on `flush_stdout_on_print` so the server's `print()` output reaches the container logs right away. In `project.godot`:

{% code title="project.godot" expandable="true" %}

```ini
[application]

run/flush_stdout_on_print=true

[autoload]

Session="*res://net/session.gd"
```

{% endcode %}

☑️ Replace the placeholders with your own values when you're ready: `STEAM_APP_ID`, `setModDir()`, `setGameDescription()` and `SERVER_VERSION`.

☑️ Test from the editor: run the project with `--server` as a user argument to start a server (Project Settings / Editor / Run / Main Run Args: `-- --server`), and run a second instance with `-- --connect=127.0.0.1:7777` as the client. The client shows `AUTHENTICATED by Steam` once the server has validated its ticket.

✅ You may now proceed to the next step.

## 🐧 3. Export the Headless Linux Server

Edgegap runs Linux containers, so the server is exported for **Linux** in Godot's **Dedicated Server** mode: it starts headless (no window, no GPU) and strips textures and audio from the export.

☑️ Add an export preset named `Edgegap Linux Server` (Project / Export / Add / Linux), and set:

* **Export Mode** (Resources tab): Export as dedicated server.
* **Filters to exclude files/folders**: `addons/godotsteam/*`, so the server export ships only GodotSteam Server.
* **Export Path**: `build/edgegap-linux-server.x86_64`.
* **Embed PCK**: off.

Or paste this into `export_presets.cfg` (renumber `[preset.0]` if you already have presets):

{% code title="export\_presets.cfg" expandable="true" %}

```ini
[preset.0]

name="Edgegap Linux Server"
platform="Linux"
runnable=false
dedicated_server=true
custom_features=""
export_filter="customized"
customized_files={
"res://": "strip"
}
include_filter=""
exclude_filter="addons/godotsteam/*"
export_path="build/edgegap-linux-server.x86_64"
encryption_include_filters=""
encryption_exclude_filters=""
encrypt_pck=false
encrypt_directory=false
script_export_mode=2

[preset.0.options]

custom_template/debug=""
custom_template/release=""
debug/export_console_wrapper=0
binary_format/embed_pck=false
texture_format/s3tc_bptc=true
texture_format/etc2_astc=false
binary_format/architecture="x86_64"
```

{% endcode %}

☑️ For your client presets (Windows, macOS, Linux desktop), exclude the server add-on instead: `addons/godotsteam_server/*`.

☑️ Export the server from Project / Export, or from the command line:

```bash
mkdir -p build
godot --headless --path . --export-release "Edgegap Linux Server" build/edgegap-linux-server.x86_64
```

{% hint style="info" %}
Godot doesn't create the export folder: make sure `build/` exists before exporting.
{% endhint %}

☑️ Check the `build` folder. Godot copies the GDExtension and the Steamworks API library next to the binary, and the server needs all four files:

```
build/
├─ edgegap-linux-server.x86_64
├─ edgegap-linux-server.pck
├─ libgodotsteam_server.linux.template_release.x86_64.so
└─ libsteam_api.so
```

{% hint style="info" %}
The preset name and path match the [Edgegap Godot plugin](https://github.com/edgegap/buildtool-godot-plugin), so its **Export server** button reuses this preset (it never changes an existing preset). Its **Containerize** step needs the Dockerfile from the next step: the plugin's default Dockerfile only copies the binary and the `.pck`, not the `.so` files GodotSteam Server needs.
{% endhint %}

✅ You may now proceed to the next step.

## 🐋 4. Containerize the Server

A Steam game server needs one file that isn't in your export: **`steamclient.so`**, the Steam client library the Steamworks API loads to talk to Steam. Valve distributes it with [SteamCMD](https://developer.valvesoftware.com/wiki/SteamCMD), and the Steamworks API looks for it in `~/.steam/sdk64/`. The Dockerfile below downloads SteamCMD in a first stage, copies only `steamclient.so` into the final image, and runs the server as a non-root user under `tini`, so stopping the deployment ends the server right away.

☑️ Save this as `Dockerfile` in your project root:

{% code title="Dockerfile" lineNumbers="true" expandable="true" %}

```docker
# Stage 1: SteamCMD downloads steamclient.so. The game server needs it to log on to
# Steam, and it is not part of the Steamworks redistributables that GodotSteam ships.
FROM ubuntu:24.04 AS steamcmd
RUN apt-get update \
 && apt-get install -y --no-install-recommends ca-certificates curl lib32gcc-s1 \
 && rm -rf /var/lib/apt/lists/*
WORKDIR /steamcmd
RUN curl -fsSL https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz | tar -xz \
 && ./steamcmd.sh +quit \
 && test -f linux64/steamclient.so

# Stage 2: the Godot dedicated server.
FROM ubuntu:24.04
# Same contract as the Edgegap Godot plugin: project-relative path without extension.
ARG SERVER_BUILD_PATH=build/edgegap-linux-server

RUN apt-get update \
 && apt-get install -y --no-install-recommends ca-certificates tini \
 && rm -rf /var/lib/apt/lists/* \
 && useradd --create-home --uid 1001 game

# steam_api looks for the 64-bit Steam client library in ~/.steam/sdk64/.
COPY --from=steamcmd --chown=game:game /steamcmd/linux64/steamclient.so /home/game/.steam/sdk64/steamclient.so

WORKDIR /home/game/server
COPY --chown=game:game ${SERVER_BUILD_PATH}.x86_64 ./server.x86_64
COPY --chown=game:game ${SERVER_BUILD_PATH}.pck ./server.pck
# The GDExtension and the Steamworks API library, exported next to the binary.
COPY --chown=game:game build/libgodotsteam_server.linux.template_*.x86_64.so build/libsteam_api.so ./
RUN chmod +x server.x86_64

# Your Steam App ID (480 = Spacewar, Valve's test app). Same effect as a steam_appid.txt.
ENV SteamAppId=480

USER game
# tini forwards SIGTERM, so stopping the deployment ends the server right away.
ENTRYPOINT ["/usr/bin/tini", "--", "./server.x86_64"]
```

{% endcode %}

☑️ Add a `.dockerignore` next to it, so Docker doesn't send Godot's cache to the build:

{% code title=".dockerignore" %}

```
.godot/
.git/
```

{% endcode %}

{% hint style="info" %}
The `SteamAppId` environment variable tells the Steamworks API which game this server belongs to. You can override it per app version on Edgegap instead of rebuilding the image.
{% endhint %}

☑️ Build the image. Tag it with a timestamp, never `latest`:

```bash
docker build --platform linux/amd64 -t my-game-server:20261109-1924 .
```

☑️ Test it locally before uploading:

```bash
docker run --name my-game-server -p 7777:7777/udp -p 27015:27015/udp my-game-server:20261109-1924
```

The logs should show the server logging on to Steam:

```
[S_API] SteamAPI_Init(): Loaded '/home/game/.steam/sdk64/steamclient.so' OK.  (First tried local 'steamclient.so')
Setting breakpad minidump AppID = 480
STEAM init ok game_port=7777 query_port=27015
SERVER listening udp=7777 request_id=-
STEAM logged on steam_id=90297081554892826 public_ip=203.0.113.10 secure=false
```

{% hint style="info" %}
The lines `dlopen failed trying to load: steamclient.so` just before `Loaded '/home/game/.steam/sdk64/steamclient.so' OK` are expected: the Steamworks API tries the working directory first.
{% endhint %}

☑️ With Steam running on your machine, start a client from your project and connect to the container:

```bash
godot --path . -- --connect=127.0.0.1:7777
```

The client shows `AUTHENTICATED by Steam, 1 player(s) on the server`, and the server logs `AUTH ok peer=... steam_id=...`. Close the client: the server logs `SERVER stopping reason=everyone left` and exits (locally there is no deployment to delete).

✅ You may now proceed to the next step.

## ☁️ 5. Upload to Edgegap

☑️ Push your image to [Edgegap's Container Registry](/learn/advanced-features/edgegap-container-registry.md). Find your project name, username and token on the [Container Registry page](https://app.edgegap.com/registry-management/repositories/list) of the dashboard:

```bash
echo "<registry-token>" | docker login registry.edgegap.com -u "<registry-username>" --password-stdin
docker tag my-game-server:20261109-1924 registry.edgegap.com/<project>/my-game-server:20261109-1924
docker push registry.edgegap.com/<project>/my-game-server:20261109-1924
```

☑️ [Create an Application](https://app.edgegap.com/application-management/applications/list), then a [new Version](/learn/orchestration/application-and-versions.md) of it with your image and tag, and these ports:

| Port name   | Port  | Protocol | Purpose                                                                                                                        |
| ----------- | ----- | -------- | ------------------------------------------------------------------------------------------------------------------------------ |
| `gameport`  | 7777  | UDP      | ENet game traffic. Players connect here.                                                                                       |
| `queryport` | 27015 | UDP      | Steam server queries (A2S). Optional, see [#steam-server-browser](#steam-server-browser "mention"). Turn off its verification. |

☑️ Optionally add version environment variables:

* `SteamAppId` to override the App ID baked into the image.
* `STEAM_GSLT` for a Game Server Login Token. Its name marks it as a secret.

{% hint style="info" %}
0.5 vCPU and 1 GB of memory were plenty for this script. Size it for your own game with the deployment's container metrics.
{% endhint %}

✅ You may now proceed to the next step.

## 🚀 6. Deploy and Connect Clients

☑️ Start a deployment of your new version from the [Dashboard](https://app.edgegap.com/deployment-management/deployments/list), near your location. Once it's **Ready**, its container logs show the server on Steam:

```
STEAM init ok game_port=32137 query_port=27015
SERVER listening udp=7777 request_id=101ce07c06f7
STEAM logged on steam_id=90297081535503378 public_ip=192.46.222.253 secure=false
```

`game_port` is the **external** port Edgegap mapped to 7777. The script reads it from the injected `ARBITRIUM_PORT_GAMEPORT_EXTERNAL` variable and gives it to Steam, so Steam advertises the address players can actually reach.

☑️ Connect a client to the deployment's host and the external port of `gameport`:

```bash
godot --path . -- --connect=101ce07c06f7.pr.edgegap.net:32137
```

The client logs:

```
CLIENT Connecting to 101ce07c06f7.pr.edgegap.net:32137...
CLIENT Connected, sending Steam ticket (234 bytes) to server 90297081535503378
CLIENT AUTHENTICATED by Steam, 1 player(s) on the server
```

And the server:

```
PEER connected peer=1943168941, waiting for Steam ticket
AUTH begin peer=1943168941 steam_id=76561198040851267 result=0
AUTH ok peer=1943168941 steam_id=76561198040851267 owner=76561198040851267 players=1
```

☑️ Close the client. The server logs off from Steam and deletes its own deployment through `ARBITRIUM_DELETE_URL`, so the deployment ends on its own. A client that disappears without disconnecting (crash, lost connection) is removed once ENet times it out (up to about 30 seconds).

{% hint style="warning" %}
**Starting deployments by hand and pasting addresses will not cut it for a live game.** Let the [Edgegap Matchmaker](/learn/matchmaking.md) start the server and hand every matched client the address, and keep the Steam auth ticket check on the server.
{% endhint %}

🙌 Congratulations, your GodotSteam Server dedicated server runs on Edgegap!

## 👉 Next Steps

### Steam Server Browser

Steam's server browser (`requestInternetServerList()` in GodotSteam, or the server list in the Steam client) is **not a good fit for Edgegap deployments**. We tested it: Steam lists the server with the correct connect address (public IP and external game port), but it records the query port as the internal `27015`. Edgegap maps that port to a random external port, so Steam's ping to the server times out and the server shows as not responding. A2S queries sent to the deployment's external `queryport` do get an answer.

Use one of these to bring players to a server instead:

* [Edgegap Matchmaker](/learn/matchmaking.md): players press Find Match, Edgegap starts a server near them and every client gets its address.
* Steam lobbies: the party leader's lobby stores the server's address with `Steam.setLobbyGameServer()` or lobby data once a server is ready, and members read it to join.
* [Edgegap Server Browser](/learn/server-browser.md) for persistent servers players pick from a list.

### Steam Account and Game Server Login Token

`logOnAnonymous()` gives the server a new Steam ID every time it starts. That's the usual choice for match servers that live for one session, and it's all the auth ticket check needs.

A persistent server identity (for example, so players can favorite a server) needs a [Game Server Login Token (GSLT)](https://steamcommunity.com/dev/managegameservers) and `logOn(token)`. Each token can only be used by one running server at a time, so it suits a few long-running servers, not one deployment per match. Store it as the `STEAM_GSLT` version variable, never in the image or your repository. Our test used anonymous logon only.

### Authentication Modes

`serverInitEx()` takes the server mode:

* `SERVER_MODE_NO_AUTHENTICATION` (1): no Steam checks.
* `SERVER_MODE_AUTHENTICATION` (2): Steam validates auth tickets. Used in this guide.
* `SERVER_MODE_AUTHENTICATION_AND_SECURE` (3): also turns on VAC for apps with VAC enabled. `isServerSecure()` reports `true` once Steam marks the server secure.

### Troubleshooting

<details>

<summary><code>Failed to retrieve non-existent singleton 'SteamServer'</code> or <code>GDExtension dynamic library not found</code></summary>

The server export is missing `libgodotsteam_server.linux.template_*.x86_64.so`. Check that the export wrote it to `build/`, and that your Dockerfile copies it next to the binary. The Edgegap Godot plugin's default Dockerfile doesn't: use the Dockerfile from this guide.

</details>

<details>

<summary><code>serverInitEx failed</code> on the server</summary>

* `steamclient.so` is missing from `~/.steam/sdk64/` of the user that runs the server. Keep the SteamCMD stage and the `COPY --from=steamcmd` line, and the `USER game` home directory they point to.
* No App ID: set `SteamAppId` (or add a `steam_appid.txt` with the ID next to the binary).

</details>

<details>

<summary><code>Steam init failed, is Steam running and logged in?</code> on the client</summary>

The Steam client must be running and signed in on the player's machine, and the account must own the App ID (every account can use 480). Launched through Steam, the App ID comes from Steam itself.

</details>

<details>

<summary>Client is kicked with <code>Steam auth failed</code> or <code>ticket rejected</code></summary>

* `beginAuthSession` result `1`: the ticket is invalid. Send only the first `size` bytes of the ticket buffer (`buffer.slice(0, size)`), not the whole buffer.
* `beginAuthSession` result `2`: a ticket from that Steam ID is already in use, for example two clients signed in to the same Steam account.
* `validate_auth_ticket_response` response `2`: the user doesn't own the App ID. Check that the client and the server use the same App ID.

</details>

<details>

<summary>Client is kicked with <code>no Steam ticket</code></summary>

The client didn't send its ticket within `AUTH_TIMEOUT_SEC`. Check the client's output for Steam errors, and that the client waits for `get_auth_session_ticket_response` before sending the ticket.

</details>

<details>

<summary>Deployment logs are empty</summary>

Turn on `application/run/flush_stdout_on_print` in Project Settings. Without it, `print()` output from a headless server stays buffered.

</details>

<details>

<summary>The server lists in Steam but players can't find it in the server browser</summary>

Expected on Edgegap, see [#steam-server-browser](#steam-server-browser "mention").

</details>

{% hint style="info" %}
If you need help, [please reach out to us over Discord](https://discord.gg/MmJf8fWjnt). For live games support see our [ticketing system](https://edgegap.atlassian.net/servicedesk/customer/portal/3).
{% endhint %}
