How to package the game with Server Target setting?

I’m guessing your symptom is “the game still launches a GUI”?

I believe the instructions from @Fronit should be updated to also include the -noclient argument. Here are my changes that gets me a headless dedicated server (which uses -server instead of -dedicatedserver; they are aliases):

diff --git a/Engine/Source/Developer/DesktopPlatform/Private/PlatformInfo.cpp b/Engine/Source/Developer/DesktopPlatform/Private/PlatformInfo.cpp
index 3012d89db5162..ecece2f759d3a 100644
--- a/Engine/Source/Developer/DesktopPlatform/Private/PlatformInfo.cpp
+++ b/Engine/Source/Developer/DesktopPlatform/Private/PlatformInfo.cpp
@@ -79,12 +79,14 @@ FTargetPlatformInfo::FTargetPlatformInfo(const FString& InIniPlatformName, EBuil
 		// put the type in parens
 		DisplayString += FString::Printf(TEXT(" (%s)"), LexToString(PlatformType));
 
-		// client builds need to be plopped on the commandline, servers are handled differently? 
-		// @todo: not sure if needed to be handled specially, honestly
 		if (PlatformType == EBuildTargetType::Client)
 		{
 			UATCommandLine += TEXT(" -client");
 		}
+		else if (PlatformType == EBuildTargetType::Server)
+		{
+			UATCommandLine += TEXT(" -server -noclient");
+		}
 
 		VanillaInfo->Flavors.AddUnique(this);
 	}
5 Likes