LogoLogo
edgegap.comDashboard
  • 📘Learning Center
    • Getting Started
    • Unity Games
      • Getting Started - Servers
      • Developer Tools
    • Unreal Engine Games
      • Getting Started - Servers
      • Developer Tools
    • Matchmaking
      • Getting Started
      • Matchmaker In-Depth
      • Ping Beacons
    • Advanced Features
      • Apps and Versions
      • Deployments
      • Managed Clusters
  • API Reference
    • Dedicated Servers
    • Integration
    • Matchmaking
    • Peer to Peer
  • Release Notes
  • 📚Documentation
    • Sample Projects
      • Unity Netcodes
        • Unity NGO
        • Photon Fusion 1
        • Photon Fusion 2
        • Mirror
        • Mirror WebGL
        • Fishnet
        • Fishnet WebGL
        • Photon Bolt
      • Unreal Top-Down Sample
      • NuxtJS
      • Ruby On Rails
      • Unity Lobbies
      • Unity Matchmaker
    • Tools & Integrations
      • Container
        • What is Docker
        • Your First Docker
        • The Good Practices
        • SSH in Your Container
        • External Registries
          • Docker Hub
          • AWS ECR
          • GCP GCR
          • Gitlab registry
      • Deploy from Nakama
      • EOS Lobby Integration
      • Switch From Gamelift
      • Switch From Multiplay
      • Playfab Bridge
    • Deployment
      • Endpoint Storage
        • How to Save Logs
        • Upload File to Deployment
      • Webhooks
    • Application
      • Command and Arguments
      • 1:1 Port Mapping
    • Session
      • How They Work
      • Application Version Configuration
      • Manage Request
      • Selectors Filtering
    • Fleet
      • Fleet Policy
      • Policy Filter
      • Linking Version
      • Fleet's Deployment
    • Container Registry
    • Distributed Relay
      • Matchmaker/Lobby
      • Relay Edgegap API
      • Transport Samples
    • Lobby
      • Lobby Service
      • Functions
    • Glossary
    • SLA Terms
Powered by GitBook
LogoLogo

Connect with Community

  • Discord
  • Linkedin
  • X

Read More

  • Release Notes
  • Blog
  • Enterprise
  • Legal
  • edgegap.com

© 2025 Edgegap

On this page
  • Prerequisites
  • Steps

Was this helpful?

  1. Documentation
  2. Tools & Integrations
  3. Unreal

Unreal on Docker

Last updated 2 months ago

Was this helpful?

Prerequisites

To containerize your Unreal game server, you will need:

  • A working Unreal game server build If you don't have a server ready, or your server is not yet ready to build, see to rapidly setup a working client-server game.

    You should be able to launch your game server locally and connect to it from your game client.

  • Docker installed on your computer If it is not already intalled, see the .

  • A GitHub account and an Epic Games account, linked This should technically already be done as you need to build Unreal Engine from source to compile a game server. If it is not, here's how to proceed:

    In your Epic account page, find the "Connections" tab. You should then see the option to link your account to GitHub. Upon linking your accounts, you should receive an email allowing you to join the Epic Games organization on GitHub. When joined, you will gain access to their repos and packages.

Steps

Getting the Unreal Engine base images

Unreal Engine v4.27.0 and later have publicly accessible container images for the Unreal Engine, so that you don't have to create the image from source.

For Unreal Engine < 4.27.0

You will need to build an Unreal Engine image from source. Be aware that the process takes a lot of time and disk space, so we recommend doing it overnight. Read the documentation for for a detailed guide.

For Unreal Engine ≥ 4.27.0

Follow steps 4 and 5 of the to authenticate to ghcr.io and pull the public Unreal Engine images for your needs. In most cases, you will need both a dev and a runtime image, but you can refer to for more information on the available image types and features.

Writing the Dockerfile

At the root of your project, in the same folder where you can find your .uproject file, create a new file called Dockerfile (no extension) and put the following content.

# ====================================================================
# We will be using Unreal Editor's built-in automation tool to include as little third
# party software as possible.
#
# We will be using a Linux container for this exmaple, but please review the specific
# features availability for each contianer type and choose accordingly:
# https://unrealcontainers.com/docs/preliminaries/technology-selection#compatibility-guidance-for-specific-features-and-use-cases
#
# Support for other container types (e.g. Windows containers) is not currently guaranteed.
# ====================================================================


# 1. Create a development image with the tools required to package your server.
FROM <YOUR_UE_DEV_IMAGE> AS builder
COPY --chown=ue4:ue4 . /tmp/project

WORKDIR /tmp/project

# You may want to review the arguments listed below and change them as required by running `RunUAT BuildCookRun -Help`
# where applicable (the RunUAT executable is found in Unreal Editor's installation directory, under Engine/Build/BatchFiles/)
RUN /home/ue4/UnrealEngine/Engine/Build/BatchFiles/RunUAT.sh BuildCookRun \
-serverplatform=Linux \
-project=/tmp/project/<YOUR_PROJECT_NAME>.uproject \
-serverconfig=Development \
-noP4 \
-cook \
-allmaps \
-build \
-stage \
-prereqs \
-pak \
-archive \
-archivedirectory=/tmp/project/dist \
-server \
-noclient

# 2. Create a Runtime image from the packaged server.
FROM <YOUR_UE_RUNTIME_IMAGE>
COPY --from=builder --chown=ue4:ue4 /tmp/project/dist/LinuxServer /home/ue4/project

EXPOSE 7777/udp

ENTRYPOINT ["/home/ue4/project/<YOUR_PROJECT_NAME>.sh", "-log"]

Make sure to replace the <PLACEHOLDER_VALUES> with the proper values:

Placeholder
Expected value
Example

<YOUR_UE_DEV_IMAGE>

The dev image you pulled or created from source

ghcr.io/epicgames/unreal-engine:dev-4.27.2

<YOUR_UE_RUNTIME_IMAGE>

The runtime image you pulled or created from source

ghcr.io/epicgames/unreal-engine:runtime

<YOUR_PROJECT_NAME>

The name of your project

MyDemoGame

This Dockerfile serves as a base template. You may need to adjust it to suit your server's requirements. You can run the following command in Unreal's Automation Tool for a list of available options. The tool usually located at <UE_INSTALLATION_FOLDER>/Engine/Build/BatchFiles:

./RunUAT BuildCookRun -Help

Build, tag and push your image


And voilà! You now have a containerized game server, ready to be deployed with Edgegap.

Next steps:

We recommend using for hosting your built image.

Be aware that you should not distribute any Unreal Engine image publicly as this is against their EULA. For more information on that matter, read (section 1A specifically) and/or .

if you didn't already.

.

for your game.

📚
Unreal Engine's documentation for setting up dedicated servers
Docker installation guide
building Unreal images from source
Unreal documentation
this page
our private container image registry
Unreal Engine's EULA
UnrealContainer's summary of the relevant points of the former
Create your game profile
Deploy your game server
Setup a matchmaker