Version: 2021.3
Language : English
Dedicated Server optimizations
Dedicated Server AssetBundles

Build your application for Dedicated Server

You can create a Dedicated Server build in either of the following ways:

Unity Editor

To create a Dedicated Server build through the Unity Editor:

  1. In Unity’s main menu, select File > Build Settings.

  2. Select Dedicated Server.

    Add Dedicated Server Build Support module
    Add Dedicated Server Build Support module

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
.

Scripting

To create a Dedicated Server build through a script, set buildPlayerOptions.subtarget to (int)StandaloneBuildSubtarget.Server.

buildPlayerOptions.target = BuildTarget.StandaloneWindows;
// SubTarget expects an integer.
buildPlayerOptions.subtarget = (int)StandaloneBuildSubtarget.Server;

Command line

To create a Dedicated Server build through the command line, use the -standaloneBuildSubtarget Server argument.

-buildTarget Linux64 -standaloneBuildSubtarget Server

Code sign macOS Dedicated Server builds

Dedicated Server builds that aren’t code signed might display security warnings when deployed on macOS systems. To avoid such warnings, make sure you code sign the build before distribution. For more information, refer to the documentation on Code sign and notarize your macOS application.

Additional resources

Dedicated Server optimizations
Dedicated Server AssetBundles