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 Unreal Engine's documentation for setting up dedicated servers 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 Docker installation guide.
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.
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.
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 building Unreal images from source for a detailed guide.
Follow steps 4 and 5 of the Unreal documentation 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 this page for more information on the available image types and features.
At the root of your project, in the same folder where you can find your
create a new file called
Dockerfile (no extension) and put the following content.
Make sure to replace the <PLACEHOLDER_VALUES> with the proper values:
|<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|
We recommend using our private container image registry for hosting your built image.
You now have a containerized game server, ready to be deployed with Arbitrium.