# Build your application for Dedicated Server

> Create a build for the Dedicated Server platform optimized for server applications.

A Dedicated Server build is a headless executable with no graphical interface. Create a build for the Dedicated Server platform optimized for server applications.

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

* [Create a build in the Unity Editor](#unity-editor)
* [Create a build using a script](#scripting)
* [Create a build using the command line](#command-line)

## Create a build in the Unity Editor

To create a Dedicated Server build in the Unity Editor, use the following steps:

1. In the Unity Editor, open the **Build Profiles** window (menu: **File** > **Build Profiles**).
2. Select **Add Build Profile** to open the **Platform Browser** window.
3. Select the server platform from the available options. For example, select **Linux Server** to build a Linux server.
4. If the server platform isn't available, select **Install with Unity Hub** and follow the installation instructions. For information on how to install modules, refer to [Add modules](https://docs.unity.com/hub/add-modules.html.md).
5. Select **Switch Profile** to set the new build profile as the active profile.
6. Click **Build**.

> **Tip:**
>
> You can further configure the Dedicated Server build in the [Player settings](/engine/6000.6/manual/platform-specific/dedicated-server/get-started/player-settings.md).

## Create a build using a script

To create a Dedicated Server build using a script:

Set `buildPlayerOptions.subtarget` to `(int)StandaloneBuildSubtarget.Server`. Note that `subtarget` requires an integer value.

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

Unity defines the `UNITY_SERVER` scripting symbol when you build for the Dedicated Server platform. You can use this symbol in your scripts to compile code for the server. For more information, refer to [Scripting symbol reference](/engine/6000.6/manual/scripting/compilation-and-code-reload/script-compilation/conditional-compilation/symbol-reference.md).

## Create a build using the command line

To create a Dedicated Server build through the command line:

Use the `-standaloneBuildSubtarget Server` [argument](/engine/6000.6/manual/unity-editor/command-line-arguments.md) along with your target platform.

```bash
-buildTarget Linux64 -standaloneBuildSubtarget Server
```

To interact with and configure your server application at runtime, use the [Unity Player command line arguments](/engine/6000.6/manual/unity-editor/command-line-arguments/player.md) and the [DedicatedServer.Arguments API](/engine/6000.6/script-reference/unityengine/dedicatedserver/arguments.md).

## 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](/engine/6000.6/manual/platform-specific/apple-mac/macos-delivery/macos-building-notarization.md).  

## Additional resources

* [Dedicated Server Player Settings reference](/engine/6000.6/manual/platform-specific/dedicated-server/get-started/player-settings.md)
* [Build Profiles](/engine/6000.6/manual/building-and-publishing/build-settings.md)
* [macOS build settings reference](/engine/6000.6/manual/platform-specific/apple-mac/macos-delivery/macosbuildsettings.md)
* [Windows build settings reference](/engine/6000.6/manual/platform-specific/windows/standalone-binaries.md)
* [Linux build settings reference](/engine/6000.6/manual/platform-specific/linux/buildsettings.md)
* [Creating scripts](/engine/6000.6/manual/scripting/get-started/creating-scripts.md)
* [Scripting symbol reference](/engine/6000.6/manual/scripting/compilation-and-code-reload/script-compilation/conditional-compilation/symbol-reference.md)
