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
  • Build Settings menu
  • Building the Game Server Docker Image
  • Dockerfile
  • Set the entry point
  • Next steps

Was this helpful?

  1. Documentation
  2. Tools & Integrations
  3. Unity

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 Settings. Once you have specified your build settings, you can click on Build to create your Build or click the Build And Run to create and run it on the platform you have specified.

In the options, select the following values using the dropdowns:

Menu
Selection

Target Platform

Linux

Architecture

x86_64

If you don't see Linux in Target Platform you must add the module Linux Build Support (Mono) to your Unity IDE. You can do this from Unity Hub.

And make sure the following options are selected:

Then Click Build

Once the Build is ready, let's make 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 creating your server running in a container.

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

  1. Move the Build you created using the unity editor in a folder called build.

  2. Create a folder on your local machine ( If you have Docker installed )

  3. Create a file with no extension named "Dockerfile" in this folder and paste the content shown in the example within it.

  4. Create a folder called build in this folder

  5. Copy the files generated by your Unity build into the build folder

  6. Create a file called entrypoint.sh and copy the content in ( Updating your build name )

Dockerfile

FROM ubuntu:bionic
MAINTAINER Edgegap <youremail@edgegap.com>

ARG DEBIAN_FRONTEND=noninteractive
ARG DOCKER_VERSION=17.06.0-ce

RUN apt-get update && \
    apt-get install -y libglu1 xvfb libxcursor1 ca-certificates && \
    apt-get clean && \
    update-ca-certificates

COPY build/                  /root/build/
COPY entrypoint.sh           /entrypoint.sh

WORKDIR /root/
ENTRYPOINT ["/bin/bash", "/entrypoint.sh"]

Set the entry point

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

Example:

entrypoint.sh

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

Next steps

Deploy your game server

Last updated 2 months ago

Was this helpful?

Now that you have a container for your game server, you can deploy it to the web within minutes on !

📚
our dashboard