Skip to main content

Unity on Docker

To create your game server's first container build, you will need to generate your server in Linux.

Select your server then File->Build Settings

Build Settings menu#

The Build Settings window allows you to choose your target platform, adjust settings for your build, and start the build process. To access the Build Settings window, select File > Build Setting. Once you have specified your build settings, you can click Build to create your build or click the Build And Run to create and run your build on the platform you have specified.

In the options, please select In the drop-down

Target PlatformLinux

In the Checkbox

  • Headless Mode
  • Server Build

Then Click Build

Once the build is created, let's create the docker container.

Building the Game Server Docker Image#

One of Edgegap's features is that it's agnostic of how you build your game executable. It just needs a reference for an OCI Image ( Docker, ContainerD), and it will be able to spin any number of servers you want. We will now get you started with the creation of your server running in a container.

Starting with Docker, you will find a Dockerfile at the root folder. This configuration file describes how to build the image, and here are the main points to look at:

  1. Move your build that was done using the unity editor in a folder call build
  2. Create a folder on your local machine ( If you have Docker installed )
  3. In this folder, Create "dockerfile" and paste the content the example
  4. Create a folder call build in this folder
  5. Copy the files generated by your Unity build into the build folder
  6. Create a file called and copy the content in ( Updating your build name )


FROM ubuntu:bionic
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get install -y libglu1 xvfb libxcursor1
COPY build/ /root/build/
WORKDIR /root/
ENTRYPOINT ["/bin/bash", "/"]

Set the entry point#

The entry point refers to the executable that will be started when a container is booting up.


chmod +x /root/build/linuxBuild.x86_64
xvfb-run --auto-servernum --server-args='-screen 0 640x480x24:32' /root/build/linuxBuild.x86_64 -batchmode -nographics

We are always available to help you get started. Just send us a help request on Slack.