You can create a Dedicated Server build in either of the following ways:
To create a Dedicated Server build in the Unity Editor, use the following steps:
Tip: You can further configure the Dedicated Server build in the Player settingsSettings that let you set various player-specific options for the final game built by Unity. More info
See in Glossary.
To create a Dedicated Server build using a script, set buildPlayerOptions.subtarget
to (int)StandaloneBuildSubtarget.Server
.
buildPlayerOptions.target = BuildTarget.StandaloneWindows;
// SubTarget expects an integer.
buildPlayerOptions.subtarget = (int)StandaloneBuildSubtarget.Server;
To create a Dedicated Server build through the command line, use the -standaloneBuildSubtarget Server
argument.
-buildTarget Linux64 -standaloneBuildSubtarget Server