Download

Linux Dedicated Server - Invalid Target Platform Error

I’ve successfully built a dedicated server for windows, but I’d prefer to have a linux dedicated server. I’ve installed the linux cross compile toolchain from Epic and I’m building from UE source. From the editor I set package build target to Server and my build configuration to either Development or Shipping. Then I attempt to build selecting Linux. My computer then compiles the code (this takes a while, no surprise) which completes successfully. Cook command then starts, and I get a number of logs that look like this:


UATHelper: Packaging (Linux):   LogTargetPlatformManager: Display: Loaded TargetPlatform 'WindowsServer'

But I don’t get any messages indicating the loading of any linux TargetPlatforms.

Shortly after that I get this:


UATHelper: Packaging (Linux):  LogTargetPlatformManager: Error: Invalid target platform specified (LinuxServer). Available = { AllDesktop, Android, Android_ASTC, Android_DXT, Android_ETC2, AndroidClient, Android_ASTCClient, Android_DXTClient, Android_ETC2Client, Android_Multi, Android_MultiClient, IOSClient, IOS, Lumin, LuminClient, MacNoEditor, Mac, MacClient, MacServer, TVOSClient, TVOS, WindowsNoEditor, Windows, WindowsClient, WindowsServer }

Does anyone have any idea how I get LinuxServer to be a valid target platform?
Thanks.

I’m not really sure why this got fixed, and I’m almost hesitant to post because it seems so odd. But maybe it will help someone who comes along later. I had been running my game in Development Editor trying to create the linux server but it wasn’t an accepted target. (See original post) Looking into it I found that when the editor is booting up it would call FTargetPlatformModuleManager::DiscoverAvailablePlatforms() and that would generate the list of all platforms that were available. To do this, it would look in the Engine/Binaries/Win64 folder and the subfolders that are there. (Which at the time were Android, IOS and Lumin) Today, trying to debug this better, I decided to run using Debug Editor configuration, and when I did that, it created a fourth folder Engine/Binaries/Win64/Linux. And now that I have this folder, I am able to build the LinuxServer in the editor.

I don’t think it was switching to the Debug Editor configuration per se that made the difference. When I first managed to compile and link the LinuxServer it generated a folder, Engine/Binaries/Linux, and then only when I rebuilt the Editor did that rebuild in turn generate the Engine/Binaries/Win64/Linux folder.

As mentioned at the beginning of this comment, I’m not really sure about any of this, so take my answer with a grain of salt. But hopefully it will help if someone else has similar problems.

1 Like

Maybe you’ve already seen this tutorial video but this worked for me 100%.

How to Package a Dedicated Server - YouTube video

Now, it does generate a Windows Dedicated Server but I was able to create a new project and generate a Linux-based Dedicated Server.

Hope this helps.

I can confirm the fix: After you have installed the toolchain for cross-compilation, you must open the solution for the engine in Rider (or VisualStudio) and build (rebuild is not necessary) the editor for Win64 (yes, that is Win64 and not Linux). This will create the needed folder “Engine/Binaries/Win64/Linux”. Then restart your editor, and packaging LinuxServer will work.