Skip to content

Unreal Engine

Unreal Engine has first-class support for dedicated server builds. The engine separates client, server, and editor code paths at the target level, which means you can produce a server binary that excludes rendering, audio, and other client systems entirely.

Unreal projects support multiple build targets:

  • Editor - Full engine with editor tools. Never ship this.
  • Client - The game client players run.
  • Server - The dedicated server. No rendering, no audio, no input.
  • Game - A combined client+server target. Avoid using this for production servers.

To create a dedicated server target, add a [YourProject]Server.Target.cs file alongside your existing target files. This tells Unreal Build Tool to produce a server-specific binary.

YourProjectServer.Target.cs
public class YourProjectServerTarget : TargetRules
{
public YourProjectServerTarget(TargetInfo Target) : base(Target)
{
Type = TargetType.Server;
DefaultBuildSettings = BuildSettingsVersion.Latest; // UE5+; for UE4, use BuildSettingsVersion.V2
// Add your modules here
}
}

When running an Unreal dedicated server, these flags are commonly used:

FlagPurpose
-serverLaunch as a dedicated server
-logEnable log output to console
-nosoundDisable audio subsystem
-nullrhiDisable rendering (no GPU required)
-unattendedSuppress dialog boxes (important for headless environments)
-port=NSet the game port

A typical launch command:

./YourProjectServer -server -log -nosound -nullrhi -unattended -port=7777

When packaging for production:

  1. Set the build configuration to Shipping (not Development or Debug)
  2. Use the Server target, not the Game target
  3. Enable pak file packaging to bundle assets
  4. Disable Include Debug Files for production builds

In the Editor: Platforms > [Your Platform] > Package Project, but select the Server target. Alternatively, use the command line:

RunUAT BuildCookRun -project=YourProject.uproject -serverconfig=Shipping -server -noclient -cook -stage -pak -archive

Blueprint-heavy projects: If your game logic lives primarily in Blueprints, those assets still need to ship with the server. You cannot strip them. Plan your asset organization so server-relevant Blueprints are in clearly separated directories from client-only UI or visual Blueprints.

Plugin dependencies: Some plugins assume a rendering context exists. If a plugin crashes on the server because it tries to access RHI or Slate, you need to either wrap those calls in #if !UE_SERVER guards or find a server-compatible alternative.

World Composition / World Partition: Large open-world setups with streaming can behave differently on the server. Test your server build with your full world loaded to catch streaming-related issues early.

Dedicated Server App ID on Steam: If distributing via Steam, you need a separate App ID for the dedicated server tool. This is free to set up through Steamworks.