[TUTORIAL][DRAFT] Building Dedicated Server on Mac

This is a draft of a tutorial I’m working on. If anyone’s feeling adventurous, I’d love feedback and corrections.

Building Dedicated UE4 Server on Mac

I recently wanted to stand up a dedicated server to test a prototype I’ve been working on. Most of our servers are Macs, but all of the documentation, blog posts, and wiki entries that I’ve been able to find on the subject have instructions for building the server for Windows and Linux. None of them included instructions for building the dedicated server for the Mac.

It is possible to build a Mac dedicated server, however. As with creating a Windows or Linux dedicated server, doing a dedicated server build requires that you build your game from a source build of the engine pulled from GitHub (or if you’re a full licensee pulled from Epic’s Perforce server).

A lot of the information I needed to figure out how to build a dedicated server on the Mac was provided by Epic’s Samantha Sutton here on AnswerHub. Her instructions were specific to building a dedicated server for the Shooter Game content sample. I thought the UE4 community would benefit from a more generic set of build instructions that can be used with any UE4 project, but I doubt I would’ve figured it out without the excellent information she provided.

Note - These steps are only for building the dedicated server. It assumes your game is already set up to handle multiplayer and network replication.

If you already have a source build of Unreal Engine on your machine, you can skip past the first several steps.

  • Clone UnrealEngine from Github to your build machine. You have to be using a source build of the engine to compile the dedicated server. You may need to request access to the repo from Epic. If your project is a Blueprint only project, you’ll have to convert the project to a C++ project by adding a C++ class to your project. You only need to add one class. That class can be empty and need not be actually used anywhere in your project, but you must have at least one C++ class for your project.
  • Before taking any further steps, checkout the branch you want to use. For example, if your project is a 4.9 project, checkout the 4.9 branch ([FONT=Courier New]git checkout -t origin/4.9)
  • Open the UnrealEngine folder you just cloned from GitHub in the Finder and double-click [FONT=Courier New]Setup.command to launch it. This will download a number of dependencies to your machine and may take a while to complete.
  • When it finishes, double-click [FONT=Courier New]GenerateProjectFiles.command, which will create the Xcode project for creating the engine. You can skip this step if you don’t plan to modify the engine source code.
  • Navigate in the Finder to the Unreal Project that you want to build a dedicated server for.
  • In the Source folder of that project, create a new text file called [FONT=Courier New][your game name]Server.Target.cs. Add the following contents to it, replacing [FONT=Courier New][GameName] with your game name:

// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.

using UnrealBuildTool;
using System.Collections.Generic;

public class [GameName]ServerTarget : TargetRules
	public [GameName]ServerTarget(TargetInfo Target)
		Type = TargetType.Server;
		bUsesSteam = true;

	// TargetRules interface.

	public override bool GetSupportedPlatforms(ref List<UnrealTargetPlatform> OutPlatforms)
		// It is valid for only server platforms
		return UnrealBuildTool.UnrealBuildTool.GetAllServerPlatforms(ref OutPlatforms, false);

	public override void SetupBinaries(
		TargetInfo Target,
		ref List<UEBuildBinaryConfiguration> OutBuildBinaryConfigurations,
		ref List<string> OutExtraModuleNames
	public override List<UnrealTargetPlatform> GUBP_GetPlatforms_MonolithicOnly(UnrealTargetPlatform HostPlatform)
		List<UnrealTargetPlatform> Platforms = null;

		switch (HostPlatform)
			case UnrealTargetPlatform.Linux:
			case UnrealTargetPlatform.Mac:
				Platforms = new List<UnrealTargetPlatform> { HostPlatform };

			case UnrealTargetPlatform.Win64:
				Platforms = new List<UnrealTargetPlatform> { HostPlatform, UnrealTargetPlatform.Linux };
				Platforms = new List<UnrealTargetPlatform>();

		return Platforms;

	public override List<UnrealTargetConfiguration> GUBP_GetConfigs_MonolithicOnly(UnrealTargetPlatform HostPlatform, UnrealTargetPlatform Platform)
		return new List<UnrealTargetConfiguration> { UnrealTargetConfiguration.Test };
	public override List<GUBPFormalBuild> GUBP_GetConfigsForFormalBuilds_MonolithicOnly(UnrealTargetPlatform HostPlatform)
		return new List<GUBPFormalBuild>();

If you already have a Server.Target.cs file, then all you probably need to do is add one line immediately after [FONT=Courier New]case UnrealTargetPlatform.Linux:. That line is:

        case UnrealTargetPlatform.Mac:

  • Navigate back up to the root folder of your project. Right-click on the Unreal project (.uproject) and select [FONT=Courier New]Services->Switch Unreal Engine Version from the contextual menu that pops up. One of the options presented should be [FONT=Courier New]Source build at /path/to/UnrealEngine. Select that one. Note: if you have the UT source installed, make sure you select the engine folder you cloned earlier and not the UT source install.
  • If there’s an existing Xcode project in the folder, delete it. This is probably not strictly necessary, but I do it anyway. I also usually delete [FONT=Courier New]DerivedDataCache, [FONT=Courier New]Intermediate, and [FONT=Courier New]Saved just to avoid any cache issues, but that also isn’t strictly necessary.
  • Right-click on the Unreal project again, this time selecting [FONT=Courier New]Services->Generate Xcode Project from the contextual menu. This will create your Xcode project set up to compile against the source build of the engine. It will also include the new server target you added to the source folder.
  • Next, you need to launch UAT to build your server. I find the easiest way to do that is at the command line, using a script like the one that follows. You’ll have to update the path to the Github version of the engine, the path to the [FONT=Courier New].uproject file for the project you want to build, and the path to put the built app when it’s done:


# navigate to UnrealEngine directory
cd /Users/jeff/dev/UnrealEngine

# Run automation tool to cook content and package
#  - to cook just specific maps, add -map= followed by the names of all maps to cook, separating map names with a '+' as one long string
#       e.g. -map=Start+Ruins+TutorialCherry
#  - to do a clean build, add the -clean flag.
./Engine/Build/BatchFiles/RunUAT.command BuildCookRun -project=/Users/jeff/dev/SniperArena/SniperArena.uproject -noP4 -clientconfig=Development -serverconfig=Development -utf8output -platform=Mac -server -serverplatform=Mac -targetplatform=Mac -build -cook -unversionedcookedcontent -compressed -stage -package -cmdline=map-002 -Messaging -prereqs -archive -archivedirectory=/output/path -pak -prereqs

  • When it’s done building, navigate to the path you specified in [FONT=Courier New]-archivedirectory, and there you should see two folders. The folder called [FONT=Courier New]MacServer will contain the server app. The folder called [FONT=Courier New]MacNoEditor will contain the actual game (client). Both applications will have the same name, so it’s a good idea to rename the app in [FONT=Courier New]MacServer so you know it’s the dedicated server. That command above does the server build with the “Development” config rather than the “Shipping”. When I’ve tried to build the server with Shipping, the log window doesn’t come up. That means you probably don’t want to distribute the client app built from this command. You can change the client instance of [FONT=Courier New]Development to [FONT=Courier New]Shipping in the script above and to do shipping config for client. You can also change the server to use “Shipping” if you want, but you’ll lose the ability to see what’s going on with your server while it’s running.
  • Anybody know to specify different app names for each target?
  • I’ve never been able to find a way to build dedicated server without also building the game - if anyone knows, I’m all ears.
  • Anyone know the command line argument to pass to redirect log to a file?
  • Generally, you’ll want to launch the dedicated server from the command line, so you can pass in the initial map to load. You’ll probably also want to pass the -log parameter, which causes it to pop open a window showing the log. The easiest way to launch the server is with the open command, like so:

        open --args [Start Map Name] -log

  • If you put the open command into a text file and give it the file extension [FONT=Courier New].command, you’ll be able to launch from the finder without having to open the terminal directly. Just call it something like [FONT=Courier New]StartServer.command.

question about the command line args

Could you please tell me what does “-cmdline=map-00” mean?

Hey Jeff, thanks for posting this. I’ll report back with anything I figure out using this.

Awesome write up, got it up and working. One question that I’m not sure about. Do I need to rebuild the server and client for testing each time I want to make changes to the game in the editor? Or is just rebuilding and launching the client fine using the same server I built the first time?

i know its a bit late to answer, but to only build server, simply add -noclient parameter.

Hello. I’m running into difficulties with my mac dedicated build. I realize this is a very old post, but here is where I am getting stuck:

I skipped over changes to the Server.Target.cs since
GUBP_GetPlatforms_MonolithicOnly is a deprecated method now. For example, my Server.Target.cs looks like this.

using UnrealBuildTool;

using System.Collections.Generic;


public class PlayerVsServerTarget : TargetRules


    public PlayerVsServerTarget(TargetInfo Target) : base(Target)


        Type = TargetType.Server;

        bUsesSteam = true;

        ExtraModuleNames.AddRange( new string] { "PlayerVs" } );



I am not sure what is going on with “[SupportedPlatforms(UnrealPlatformClass.Server)]”

Anyway, I run the bash script as described in this post. It builds




So that seems good. Not sure why it made a macnoeditor/ & a macserver/ but no harm done.
I run

open —args DedicatedServer -log

and I get the following error:

So I think it is saying, the dedicated server doens’t know how to find the which is sitting in the same dir right next to it. Might anyone know what is going on here? Thank you.

So what worked for me was this post:…r-for-mac.html

I ended up learning about the UnrealFrontend tool (aka the ProjectLauncher tab in my uproj), and building from there. Worked great!

This reference helped me understand the UnrealFrontend build tool: