Skip to main content

Steam Dedicated Server (UE5)

Prerequisites

Please note that I assume you already know how to use Steam and configure the .ini file with your AppID and other settings such as the NetDriver used and other parameters.

This is just a technical memo where I add some details/problems I encountered without changing the code when I switched from UE4 to UE5

Running Dedicated Server

Running the dedicated server with -server will automatically listen to the Default Server Map or the specified map from the command line. This means a connection will be created by default.

It's important to know this, especially when you plan to switch levels or create sessions (especially with SteamSocket).

When Unreal reopen a map (or renew connection), it binds a new net driver before destroying the old one.

Windows

MyServerServer.exe -server

Linux

MyServerServer.sh -server

On Linux, you can also create a service to run the server and restart it automatically when it crashes.

Game service file example :

/etc/systemd/system/game-server.service

[Unit]
Description=Game Server Service
After=network.target

[Service]
Type=simple
User=steam
Group=steam
WorkingDirectory=/home/steam/my-game-server
ExecStart=/home/steam/my-game-server/MyGame.sh -server -log
Restart=always
RestartSec=30s

[Install]
WantedBy=multi-user.target

Command Execute :

sudo systemctl start game-server.service

Some ways to open a dedicated server

  • from command line with SteamSocket NetDriver : open steam.TheServerSteamID:port
  • from command line natively without steam networking : open TheServerIp:port
Seemless Travel required with SteamSocket NetDriver

Especially on UE5 (in my case) with the latest versions of SteamSocket and SteamSDK, when you are on a dedicated server and you have created a Steam session, the GameMode of the maps used by the server must have Use Seamless Travel enabled and therefore have a Transition map in project settings !

So in short ue isnt destroying the old netdriver and bind before starting a new one and because steam doesnt allow you to bind multiple sockets to the same steamid it will fail

— Feror

Screenshot

Your transition map:

Screenshot