# More Build Methods

These approaches are generally slower and require deeper understanding of Unreal Engine.

{% hint style="success" %}
See [Unreal Engine](/unreal-engine.md) for your first steps with Unreal Engine game server hosting on Edgegap.
{% endhint %}

Explore alternative build methods suited for more advanced Unreal Engine and Edgegap users:

1. [#build-from-containers](#build-from-containers "mention") is a fast and automated method suitable for Continuous Integration.
2. [#build-from-plugin](#build-from-plugin "mention") is a legacy build method requiring building Unreal Engine from source.

## ⚡ Build with Scripts

Building with scripts is a fast, fully automated, and easy method suitable for Continuous Integration.

### Preparation <a href="#scripts-before-starting" id="scripts-before-starting"></a>

Before you get started, make sure to [create a free account with Edgegap](https://app.edgegap.com/auth/register) (no credit card required).

**Configure a few essentials on your development machine:**

<details>

<summary><a href="https://www.docker.com/products/docker-desktop/">Install Docker Desktop (or Docker CLI)</a></summary>

* [Install Docker Desktop from the official source](https://www.docker.com/products/docker-desktop/) (no account required),
* make sure to restart your computer after completing the installation.

</details>

<details>

<summary><a href="https://www.unrealengine.com/en-US/ue-on-github">Gain Access to Unreal Engine resources on GitHub</a></summary>

* [Sign up for a GitHub account.](https://github.com/)
* Navigate to your [Unreal Engine linked accounts dashboard page](https://www.epicgames.com/account/connections).
* Link GitHub account with your Epic account.
  * Authorize Epic Games to access your GitHub account.
  * Accept email invitation to join Epic Games organization on GitHub.

</details>

<details>

<summary><a href="https://github.com/settings/tokens/new">Generate GitHub Personal Access Token (classic)</a></summary>

* enable only permission `[read:packages]` ,
* generate token - **store this value safely, you won't see it again**.

</details>

### 1. Configure Project <a href="#scripts-configure-game-builds" id="scripts-configure-game-builds"></a>

Whether you’re using a Windows, Mac, or a Linux machine, you will **need to build your server for Linux runtime**, as most cloud providers nowadays (including Edgegap) run on Linux. Don’t worry, no Linux knowledge is required.

☑️ **Disable Unreal Engine version compatibility check** for dedicated servers and **set `IpNetDriver` as the default driver or the fallback driver** for replication networking:

{% hint style="warning" %}
Make sure to **input your `DefaultServerTarget`  at the end of this snippet**!
{% endhint %}

<pre data-title="Config/DefaultEngine.ini"><code><a data-footnote-ref href="#user-content-fn-1">[ConsoleVariables]</a>
net.IgnoreNetworkChecksumMismatch=1
net.CurrentHandshakeVersion=2
net.MinHandshakeVersion=2
net.VerifyNetSessionID=0
net.VerifyNetClientID=0

<a data-footnote-ref href="#user-content-fn-2">[/Script/Engine.GameEngine]</a>
!NetDriverDefinitions=ClearArray
+NetDriverDefinitions=(DefName="GameNetDriver",DriverClassName="OnlineSubsystemUtils.IpNetDriver",DriverClassNameFallback="OnlineSubsystemUtils.IpNetDriver")

<a data-footnote-ref href="#user-content-fn-3">[/Script/OnlineSubsystemUtils.IpNetDriver]</a>
MaxClientRate=1000000000
MaxInternetClientRate=1000000000
InitialConnectTimeout=120.0
MaxNetTickRate=60
NetServerMaxTickRate=60

<a data-footnote-ref href="#user-content-fn-4">[/Script/BuildSettings.BuildSettings]</a>
DefaultServerTarget=LyraServer
</code></pre>

☑️ **Restart Unreal Engine** to reload latest changes.

☑️ **Create a dedicated server target script** by copying your `<PROJECT>Editor.Target.cs` file in project root folder and renaming the copy to `<PROJECT>Server.Target.cs`.

☑️ **Replace any references to** word **`Editor`** **with** **`Server`** in your server target script.

☑️ **Modify server build defaults** by editing your server target script:

<pre data-title="Source/<PROJECT>Server.Target.cs"><code>bOverrideBuildEnvironment = true;
<a data-footnote-ref href="#user-content-fn-5">bUseLoggingInShipping = true;</a>
<a data-footnote-ref href="#user-content-fn-6">bUseChecksInShipping = false;</a>
<a data-footnote-ref href="#user-content-fn-7">bBuildWithEditorOnlyData = false;</a>
<a data-footnote-ref href="#user-content-fn-8">bUsesSlate = false;</a>
<a data-footnote-ref href="#user-content-fn-9">bCompileCEF3 = false;</a>
</code></pre>

✅ You may now proceed to the next step.

<details>

<summary>Optional: Steam Integration</summary>

To **integrate Steam**, use `IpNetDriver` as your default Net Driver and verify that the [64 bit steamclient.so for Linux](https://developer.valvesoftware.com/wiki/SteamCMD#Ubuntu) is copied to image on path `/home/ubuntu/.steam/sdk64/` .

{% hint style="success" %}
Add `steamclient.so`  linux library with a single click using our [docker extension](/unreal-engine.md).
{% endhint %}

<a href="https://github.com/edgegap/edgegap-unreal-buildutils/raw/refs/heads/main/steamclient.so" class="button secondary" data-icon="square-down">Download steamclient.so</a>

<pre class="language-docker" data-title="Dockerfile"><code class="lang-docker">...
<a data-footnote-ref href="#user-content-fn-10">RUN mkdir -p /home/ubuntu/.steam/sdk64</a>
<a data-footnote-ref href="#user-content-fn-11">COPY ./steamclient.so /home/ubuntu/.steam/sdk64/steamclient.so</a>
<a data-footnote-ref href="#user-content-fn-12">RUN chmod 755 /home/ubuntu/.steam/sdk64/steamclient.so</a>
...
</code></pre>

{% hint style="warning" %}
**Make sure to disable steam networking, which sends packets through Steam Relay and may cause connection issues or lag spikes.** This doesn't prevent you from using other Steamworks features like Leaderboards, Achievements, Voice, or publishing your game on Steam Store.
{% endhint %}

<pre data-title="Config/DefaultEngine.ini"><code>[OnlineSubsystemSteam]
bUseSteamNetworking=false
bAllowP2PPacketRelay=false
<a data-footnote-ref href="#user-content-fn-13">SteamDevAppId=480</a>
<a data-footnote-ref href="#user-content-fn-13">SteamAppId=480</a>
</code></pre>

</details>

### 2. Build and Publish <a href="#scripts-build-and-upload-to-edgegap" id="scripts-build-and-upload-to-edgegap"></a>

Working in a team of developers means sharing your code. When things go wrong, the last thing you want to hear is “it works on my machine”. Game servers have to run reliably on any machine, since a successful games’ servers will run on thousands of server machines across the world.

To help make your server reliable, we use Docker - virtualization software to ensuring that all of your server code dependencies down to the operating system level are going to be always exactly the same, no matter how or where the server is launched.

{% hint style="info" %}
We recommend watching ["Never install locally" (video)](https://www.youtube.com/watch?v=J0NuOlA2xDc\&ab_channel=Coderized). **You DON'T need to use Dockerhub with Docker**.  Docker ≠ Dockerhub. Think of Docker as a programming engine and Dockerhub as it’s App Store.
{% endhint %}

☑️ **Verify that Docker is installed and running.**

{% embed url="<https://github.com/edgegap/edgegap-unreal-buildutils>" %}

☑️ **Download our Edgegap Build Utils** archive including:

* platform-specific build scripts:
  * `BuildAndUpload.ps1`  for Windows,
  * `BuildAndUpload.sh`  for macOS and Linux,
* `Dockerfile`  - recipe for building your docker images,
* `dockerignore`  - list of noncritical files to remove and speed up builds,
* `StartServer.sh`  - utility script managing your Unreal Engine lifecycle on runtime.

☑️ **Move the `edgegap-unreal-buildutils` folder to your project root directory.**

☑️ **Edit the `BuildAndUpload`  script for your platform** to configure:

* github credentials used to pull pre-built Unreal Engine images for Linux Servers,
* project details - engine version, server configuration, .uproject file name,
* [Edgegap Registry](https://app.edgegap.com/registry-management/repositories/list) credentials used to upload your completed builds.

☑️ **Execute the edited script** to start build and upload process. Completing this step will add a new **image in your** [Edgegap Container Registry dashboard page in your Repository](https://app.edgegap.com/registry-management/repositories/list).

☑️ You will be automatically redirected to **create a new** [Apps and Versions](/learn/orchestration/application-and-versions.md#app-versions) in [dashboard](https://app.edgegap.com/application-management/applications/list)**.**

✅ You may now proceed to the next step, skip to [#test-your-server-locally](#test-your-server-locally "mention").

<details>

<summary>Troubleshooting and FAQ</summary>

`ERROR: failed to run Build function: the Dockerfile cannot be empty`

* Some plugin sources may be missing `Dockerfile` and/or `StartServer.sh` , please find a copy these files from github source version of your plugin to your local plugin.

***

`open //./pipe/dockerDesktopLinuxEngine: The system cannot find the file specified.`

* Verify that Docker is running on your development machine.

***

`invalid reference format EdgegapLog: Warning: OnContainerizeCallback: Could not generate container, message:Failed`

* Verify that your application name is set and doesn't contain trailing whitespace.
* Make sure to press Enter to confirm the input value when done editing.

***

[**Couldn’t find target rules file for target ‘ProjectName’ when building a project?**](https://forums.unrealengine.com/t/how-may-i-resolve-an-error-couldnt-find-target-rules-file-for-target-projectname-when-building-a-project/411707)

* Change build configuration in your `XYZServerTarget.cs` file:

```
BuildConfig = EProjectPackagingBuildConfigurations::PPBC_Shipping;
```

***

`403 Forbidden, Could not push container, message:Failed`

* Please verify your docker credentials are correctly set.
* If using Edgegap Container Registry, ensure the username doesn’t include `app-version-pull` , which is the profile only allowing pulling images. Your profile should resemble your account email instead.
* Verify that you have enough free space in your account’s [Container Registry](https://app.edgegap.com/registry-management/repositories/list). We recommend trying to [#optimize-server-build-size](#optimize-server-build-size "mention"), and using [our API to delete older images](https://docs.edgegap.com/api/#tag/Container-Registry/operation/image-tag-delete). Images are stored on your local machine until deleted for backups.

</details>

## ⚡ Build from Plugin <a href="#build-from-plugin" id="build-from-plugin"></a>

Our legacy plugin includes advanced utilities, and requires building Unreal Engine from source.

### Preparation <a href="#plugin-before-starting" id="plugin-before-starting"></a>

Before you get started, make sure to [create a free account with Edgegap](https://app.edgegap.com/auth/register) (no credit card required).

**Configure a few essentials on your development machine:**

<details>

<summary><a href="https://www.docker.com/products/docker-desktop/">Install Docker Desktop (or Docker CLI)</a></summary>

* [Install Docker Desktop from the official source](https://www.docker.com/products/docker-desktop/) (no account required),
* make sure to restart your computer after completing the installation.

</details>

<details>

<summary><a href="https://www.unrealengine.com/en-US/ue-on-github">Gain Access to Unreal Engine resources on GitHub</a></summary>

* [Sign up for a GitHub account.](https://github.com/)
* Navigate to your [Unreal Engine linked accounts dashboard page](https://www.epicgames.com/account/connections).
* Link GitHub account with your Epic account.
  * Authorize Epic Games to access your GitHub account.
  * Accept email invitation to join Epic Games organization on GitHub.

</details>

<details>

<summary>Configure Your Development Environment</summary>

* [Download Unreal Engine source code](https://dev.epicgames.com/documentation/en-us/unreal-engine/downloading-unreal-engine-source-code#downloadingthesourcecode).
* [Set up Visual Studio](https://dev.epicgames.com/documentation/en-us/unreal-engine/setting-up-visual-studio-development-environment-for-cplusplus-projects-in-unreal-engine).

</details>

<details>

<summary>Install an Official Edgegap Unreal Engine Plugin</summary>

Choose one of the official plugins:

* download [Developer Tools](/unreal-engine/developer-tools.md#integration-kit),
* or download [Developer Tools](/unreal-engine/developer-tools.md#legacy-plugin).

</details>

### 1. Configure Project <a href="#scripts-configure-game-builds" id="scripts-configure-game-builds"></a>

Whether you’re using a Windows, Mac, or a Linux machine, you will **need to build your server for Linux runtime**, as most cloud providers nowadays (including Edgegap) run on Linux. Don’t worry, no Linux knowledge is required.

☑️ [Build your Unreal Engine version from source](https://dev.epicgames.com/documentation/en-us/unreal-engine/building-unreal-engine-from-source) on your development machine,

* install [specific release branch (e.g. ](https://github.com/EpicGames/UnrealEngine/tree/5.5)[`5.5`](https://github.com/EpicGames/UnrealEngine/tree/5.5)[)](https://github.com/EpicGames/UnrealEngine/tree/5.5) to build on a stable foundation,
* **use Solid State Drive (SSD)** to speed up builds (from \~12+ hours to \~2+ hours),
* this is only required the first time and every time you upgrade your Unreal Engine version.

{% hint style="warning" %}
**Download branch with a git client!** Using github UI will always download the unstable `release` branch.
{% endhint %}

☑️ [Install Unreal Cross-Compiling Toolchain](https://dev.epicgames.com/documentation/en-us/unreal-engine/linux-development-requirements-for-unreal-engine) to build game servers for Linux.

☑️ **Restart your development machine**, otherwise you’ll run into errors later on!

☑️ **Disable Unreal Engine version compatibility check** for dedicated servers and **set `IpNetDriver` as the default driver or the fallback driver** for replication networking:

{% hint style="warning" %}
Make sure to **input your `DefaultServerTarget`  at the end of this snippet**!
{% endhint %}

<pre data-title="Config/DefaultEngine.ini"><code><a data-footnote-ref href="#user-content-fn-1">[ConsoleVariables]</a>
net.IgnoreNetworkChecksumMismatch=1
net.CurrentHandshakeVersion=2
net.MinHandshakeVersion=2
net.VerifyNetSessionID=0
net.VerifyNetClientID=0

<a data-footnote-ref href="#user-content-fn-2">[/Script/Engine.GameEngine]</a>
!NetDriverDefinitions=ClearArray
+NetDriverDefinitions=(DefName="GameNetDriver",DriverClassName="OnlineSubsystemUtils.IpNetDriver",DriverClassNameFallback="OnlineSubsystemUtils.IpNetDriver")

<a data-footnote-ref href="#user-content-fn-3">[/Script/OnlineSubsystemUtils.IpNetDriver]</a>
MaxClientRate=1000000000
MaxInternetClientRate=1000000000
InitialConnectTimeout=120.0
MaxNetTickRate=60
NetServerMaxTickRate=60

<a data-footnote-ref href="#user-content-fn-4">[/Script/BuildSettings.BuildSettings]</a>
DefaultServerTarget=LyraServer
</code></pre>

☑️ **Restart Unreal Engine** to reload latest changes.

☑️ **Create a dedicated server target script** by copying your `<PROJECT>Editor.Target.cs` file in project root folder and renaming the copy to `<PROJECT>Server.Target.cs`.

☑️ **Replace any references to** word **`Editor`** **with** **`Server`** in your server target script.

☑️ **Modify server build defaults** by editing your server target script:

<pre data-title="Source/<PROJECT>Server.Target.cs"><code>bOverrideBuildEnvironment = true;
<a data-footnote-ref href="#user-content-fn-5">bUseLoggingInShipping = true;</a>
<a data-footnote-ref href="#user-content-fn-6">bUseChecksInShipping = false;</a>
<a data-footnote-ref href="#user-content-fn-7">bBuildWithEditorOnlyData = false;</a>
<a data-footnote-ref href="#user-content-fn-8">bUsesSlate = false;</a>
<a data-footnote-ref href="#user-content-fn-9">bCompileCEF3 = false;</a>
</code></pre>

✅ You may now proceed to the next step.

<details>

<summary>Optional: Steam Integration</summary>

To **integrate Steam**, use `IpNetDriver` as your default Net Driver and verify that the [64 bit steamclient.so for Linux](https://developer.valvesoftware.com/wiki/SteamCMD#Ubuntu) is copied to image on path `/home/ubuntu/.steam/sdk64/` .

{% hint style="success" %}
Add `steamclient.so`  linux library with a single click using our [docker extension](/unreal-engine.md).
{% endhint %}

<a href="https://github.com/edgegap/edgegap-unreal-buildutils/raw/refs/heads/main/steamclient.so" class="button secondary" data-icon="square-down">Download steamclient.so</a>

<pre class="language-docker" data-title="Dockerfile"><code class="lang-docker">...
<a data-footnote-ref href="#user-content-fn-10">RUN mkdir -p /home/ubuntu/.steam/sdk64</a>
<a data-footnote-ref href="#user-content-fn-11">COPY ./steamclient.so /home/ubuntu/.steam/sdk64/steamclient.so</a>
<a data-footnote-ref href="#user-content-fn-12">RUN chmod 755 /home/ubuntu/.steam/sdk64/steamclient.so</a>
...
</code></pre>

{% hint style="warning" %}
**Make sure to disable steam networking, which sends packets through Steam Relay and may cause connection issues or lag spikes.** This doesn't prevent you from using other Steamworks features like Leaderboards, Achievements, Voice, or publishing your game on Steam Store.
{% endhint %}

<pre data-title="Config/DefaultEngine.ini"><code>[OnlineSubsystemSteam]
bUseSteamNetworking=false
bAllowP2PPacketRelay=false
<a data-footnote-ref href="#user-content-fn-13">SteamDevAppId=480</a>
<a data-footnote-ref href="#user-content-fn-13">SteamAppId=480</a>
</code></pre>

</details>

### 2. Build and Publish <a href="#plugin-build-and-upload-to-edgegap" id="plugin-build-and-upload-to-edgegap"></a>

Working in a team of developers means sharing your code. When things go wrong, the last thing you want to hear is “it works on my machine”. Game servers have to run reliably on any machine, since a successful games’ servers will run on thousands of server machines across the world.

To help make your server reliable, we use Docker - virtualization software to ensuring that all of your server code dependencies down to the operating system level are going to be always exactly the same, no matter how or where the server is launched.

{% hint style="info" %}
We recommend watching ["Never install locally" (video)](https://www.youtube.com/watch?v=J0NuOlA2xDc\&ab_channel=Coderized). **You DON'T need to use Dockerhub with Docker**.  Docker ≠ Dockerhub. Think of Docker as a programming engine and Dockerhub as it’s App Store.
{% endhint %}

☑️ **Verify that Docker is installed and running.**

☑️ [Rebuild our plugin](https://dev.epicgames.com/community/learning/tutorials/qz93/unreal-engine-building-plugins) for your custom Unreal Engine version built from source.

☑️ **Copy compiled plugin** to your `Plugins` folder **in the root of your Unreal project** (not engine).

☑️ **Launch your new Unreal Engine** from Visual Studio and **open toolbar item Edit / Plugins**.

☑️ **Enable our plugin** in section **INSTALLED / Other**.

☑️ **Configure our plugin** by opening toolbar item **Edit / Project Settings / Edgegap**:

{% hint style="warning" %}
Always press enter after editing input values to **ensure they are saved correctly**.
{% endhint %}

* **API Token** is needed to upload your server to Edgegap, get one by clicking Get Token.
* **Application name** on Edgegap can match your project name or be customized, make sure to only use lowercase letters, numbers, or characters dash `-` and underscore `_`.
* **Image Path** provides optionally a custom icon for your game server on Edgegap, skip for now.
* **Version name** is useful for tracking client/server compatibility and rolling back in case of issues.
  * Timestamps are a great option for app version names, e.g. `2024.01.30-16.50.20-UTC` .
  * Multiple application versions may point to the same image tag, such as `v1.1.0` and `dev` .
  * Learn more about [Apps and Versions](/learn/orchestration/application-and-versions.md) later.

{% hint style="warning" %}
**Do not reuse `latest` version** to prevent our system from deploying outdated (cached) image.
{% endhint %}

☑️ Click **Create Application.** Completing this step will result in a **new application appearing** in [Edgegap Dashboard](https://app.edgegap.com/application-management/applications/list).

☑️ Skip custom container registry settings for now, you can use third party registry later if you’d like.

☑️ Once you’re happy with your configuration hit **Build and Push**, wait for the process to finish and verify there are no new errors in your Unreal console. Completing this step will result in a **new folder appearing in your project root** - `Saved/LinuxServer`. In addition, a **new image appears now in your** [Edgegap Container Registry dashboard page underneath your Repository](https://app.edgegap.com/registry-management/repositories/list), and a new [Apps and Versions](/learn/orchestration/application-and-versions.md#app-versions) **appears in your** [dashboard underneath your Application](https://app.edgegap.com/application-management/applications/list)**.**

☑️ In your new application version, set environment variable `TARGET_FILE_NAME`  to match your `DefaultServerTarget`  value from step [#id-2.-configure-game-server-builds-1](#id-2.-configure-game-server-builds-1 "mention").

✅ You may now proceed to the next step.

<details>

<summary>Troubleshooting and FAQ</summary>

`ERROR: failed to run Build function: the Dockerfile cannot be empty`

* Some plugin sources may be missing `Dockerfile` and/or `StartServer.sh` , please find a copy these files from github source version of your plugin to your local plugin.

***

`open //./pipe/dockerDesktopLinuxEngine: The system cannot find the file specified.`

* Verify that Docker is running on your development machine.

***

`invalid reference format EdgegapLog: Warning: OnContainerizeCallback: Could not generate container, message:Failed`

* Verify that your application name is set and doesn't contain trailing whitespace.
* Make sure to press Enter to confirm the input value when done editing.

***

[**Couldn’t find target rules file for target ‘ProjectName’ when building a project?**](https://forums.unrealengine.com/t/how-may-i-resolve-an-error-couldnt-find-target-rules-file-for-target-projectname-when-building-a-project/411707)

* Change build configuration in your `XYZServerTarget.cs` file:

```
BuildConfig = EProjectPackagingBuildConfigurations::PPBC_Shipping;
```

***

`403 Forbidden, Could not push container, message:Failed`

* Please verify your docker credentials are correctly set.
* If using Edgegap Container Registry, ensure the username doesn’t include `app-version-pull` , which is the profile only allowing pulling images. Your profile should resemble your account email instead.
* Verify that you have enough free space in your account’s [Container Registry](https://app.edgegap.com/registry-management/repositories/list). We recommend trying to [#optimize-server-build-size](#optimize-server-build-size "mention"), and using [our API to delete older images](https://docs.edgegap.com/api/#tag/Container-Registry/operation/image-tag-delete). Images are stored on your local machine until deleted for backups.

</details>

## 👉 Next Steps

Continue to [/pages/DbR6ihTNvNj5aBknA5wA#id-5.-deploy-to-cloud](https://docs.edgegap.com/unreal-engine/pages/DbR6ihTNvNj5aBknA5wA#id-5.-deploy-to-cloud "mention") with our [Dashboard Deployment](https://app.edgegap.com/deployment-management/deployments/list) feature and learn more about stopping your deployments, injected variables and parametrization, and server discoverability.

[^1]: disable compatibility check

[^2]: use IpNetDriver

[^3]: set client/server tick rates and timeout

[^4]: set server build as default target

[^5]: enable logs

[^6]: don't use checks

[^7]: don't package editor content

[^8]: don't package Slate UI (editor)

[^9]: don't compile CEF3 (editor)

[^10]: create parent directory

[^11]: copy the steamclient.so file

[^12]: allow executing steam client

[^13]: find in your steam publisher portal


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.edgegap.com/unreal-engine/more-build-methods.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
