You can create a Dedicated Server build through either of the following ways:
To create a Dedicated Server build through the Unity Editor:
- From the Unity Editor, select File > Build Settings.
- Select Dedicated Server.
Tip: You can further configure the Dedicated Server build through 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 through a script:
(int)StandaloneBuildSubtarget.Server. For example, refer to the following code snippet.
buildPlayerOptions.target = BuildTarget.StandaloneWindows; // SubTarget expects an integer. buildPlayerOptions.subtarget = (int)StandaloneBuildSubtarget.Server;
Refer to Creating and Using Scripts to learn more.
To create a Dedicated Server build through the command line, use the
-standaloneBuildSubtarget Server argument. For example, refer to the following code snippet.
-buildTarget Linux64 -standaloneBuildSubtarget Server