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 in the Unity Editor, use the following steps:
- Open the Build ProfilesA set of customizable configuration settings to use when creating a build for your target platform. More info
See in Glossary window from File > Build Profiles.
- Select Add Build Profile to open the Platform Browser window.
- Select the type of server to build from the list of available platforms. For example, select Linux Server to build a Linux server.
- If the server type isn’t available, select Install with Unity Hub and follow the installation instructions. For information on how to install modules, refer to Add modules.
- Select Switch Profile to set the new build profile as the active profile.
- Click Build.
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.
Scripting
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;
Command line
To create a Dedicated Server build through the command line, use the -standaloneBuildSubtarget Server
argument.
-buildTarget Linux64 -standaloneBuildSubtarget Server
Additional resources
Dedicated Server optimizations
Dedicated Server AssetBundles