Skip to content

Running your game server ​

In this section, you will learn how to run your first game server.

Understanding Hosting Models

Before proceeding, consider reviewing the hosting models guide to understand the difference between Vessels (long-running servers) and Armadas (session-based servers), and choose the right approach for your needs.

Prerequisites ​

In order to follow this guide, make sure you have the following:

Log into the GameFabric UI before proceeding.

Create configuration files (optional) ​

If your game server requires configuration files, you should add those before creating your first game server.

Visit the "Config Files" section in the navigation bar on the left of the interface, and click the "Add File" button.

You may give a name and description to the file, as you did with branches. Then, simply write the contents of your file, press "Next", verify that the configuration file is correct, and click "Create ConfigFile".

Create a Vessel ​

Visit the Vessels page under Persistent Servers in the UI, and click on the "Create New Vessel" button, on the top right of the interface.

Vessels allow you to spin up individual game servers and to define a unique configuration for each of them, which is ideal for a first integration. Later, you will use concepts like Formations, Armadas and ArmadaSets to efficiently manage large numbers of game servers at once. To create a Formation instead, visit the Formations page and click on the "Create New Formation" button.

GUI_Create_Vessel_Buttons.pngGUI_Create_Vessel_Buttons.png

General ​

In this step, specify a unique name for your Vessel. You can also assign a description as a reminder what this Vessel is used for.

GUI_Create_Vessel_General.pngGUI_Create_Vessel_General.png

Region ​

Select the Region that this Vessel should run in. Please note that you do not need to specify the type of capacity within the Region (i.e. Bare Metal vs. Cloud). This scheduling decision is performed automatically and adjusts dynamically when capacity changes.

Region Immutability

The Region of a Vessel is immutable, which means that if you want to change the Region, you need to create a new Vessel and delete the old one. This is because the Region is a fundamental part of the Vessel's identity and configuration.

Instead, the Vessel can be cloned, which creates a new Vessel with the same configuration as the original one, but with a different name and Region. This allows you to easily create multiple similar Vessels in different Regions without having to manually configure each one from scratch.

GUI_Create_Vessel_Region.pngGUI_Create_Vessel_Region.png

Containers ​

The Containers section contains the majority of your game server configuration.

Image ​

The first thing to do is select the image you previously pushed to your branch. This makes the game server container use that image.

GUI_Create_Vessel_Containers_Image.pngGUI_Create_Vessel_Containers_Image.png

WARNING

If you select autoUpdate, pushing a new version of your game server image immediately triggers an automatic rollout. This can be very convenient for development purposes, as it avoids you having to edit the Vessel whenever you push a new version.

Environment variables ​

Environment variables are a convenient way of exposing configuration options to the game server without defining a full configuration file. You can define them as static key/value pairs, or, by selecting the "Pod Field" type, expose metadata about the deployed game server, such as the name of the region the game server is deployed to or the version of the image in use.

GUI_Create_Vessel_Containers_Environment_Variables.pngGUI_Create_Vessel_Containers_Environment_Variables.png

Supported pod fields are:

Pod fieldDescriptionResolved by
metadata.nameName of the game server, usually referring to the unique pod name.Kubernetes
metadata.labels['<KEY>']Accessor to the game server labels.Kubernetes
metadata.armadaNameName of the associated Armada.GameFabric (Armada only)
metadata.vesselNameName of the associated Vessel.GameFabric (Formation only)
metadata.regionNameName of the region.GameFabric (any)
metadata.regionTypeNameName of the region type.GameFabric (any)
metadata.regionTypePriorityPriority of the region type.GameFabric (any)
metadata.siteNameName of the site.GameFabric (any)
metadata.imageBranchName of the image branch of the used game server image.GameFabric (any)
metadata.imageNameName of the used game server image.GameFabric (any)
metadata.imageTagTag name of the used game server image.GameFabric (any)

For more information, see the full list of supported Kubernetes fields.

Ports ​

Ports determine how your game server can be reached from the outside world. Game servers live behind Network Address Translation (NAT), that means the public IP and ports differ from the IP and ports that the game server binds to locally.

There are two types of ports you can configure:

  • Dynamic is the preferred default. The game server locally binds to a predetermined port (such as 7777) and at runtime, a random public port is chosen that game clients can then use to reach the game server. If the game server needs to communicate its public IP and ports to an outside system, such as a server list, the game server needs to query this data from the Agones SDK. See Discovering Your Public Address for details.
  • Passthrough may be required if a game server requires public and local port to be the same (Steam's A2S query being a notable example). The public port is randomly chosen at runtime, and the game server then has to locally bind to that specific port after retrieving it from the Agones SDK. Passthrough should only be used when required.

GUI_Create_Vessel_Containers_Ports.pngGUI_Create_Vessel_Containers_Ports.png

Below are some port name conventions and what they are typically used for:

Port NameUsage
gamePrimary game traffic port, often UDP.
queryPort to retrieve meta data about the server, such as current number of players.
rconAny remote control endpoint that can be used to manage the game server at runtime.
allocatorCallback endpoint for a server allocation mechanism.

INFO

The allocator port is used by the Allocator service, which manages server assignment for matchmaking-based games. Games that rely on a server browser instead of matchmaking do not require this port.

Command and arguments ​

You can also override the command run by the container, as well as CLI arguments your game server starts with.

If left empty, the game server starts with the default arguments defined in the container's Dockerfile for the properties CMD and ARGS, respectively.

GUI_Create_Vessel_Containers_Command.pngGUI_Create_Vessel_Containers_Command.png

Volumes ​

Volumes provide temporary storage that the containers of a game server can share until the game server stops. Use them to exchange files between your game server and a sidecar container, such as the allocation payload written by the Allocation Sidecar, or as scratch space for a single container. If your game server needs neither, skip this section.

Game servers use emptyDir volumes. An emptyDir volume is created empty when the game server starts, and every container that mounts it can read and write its files. The data is deleted when the game server stops.

Volumes are not persistent

Do not store data in a volume that must survive a restart or an update, such as save games or player progress. Store this data outside the game server, for example in your own backend.

GUI_Create_Vessel_Containers_Volumes.pngGUI_Create_Vessel_Containers_Volumes.png

Volume settings ​

To add a volume, click "Add Volume" and configure the following settings:

  • Volume Name (required): A name that identifies the volume, such as shared. Use the same name to mount the volume in more than one container.
  • Size Limit (optional): The maximum amount of data the volume can hold. Enter a number and select a unit from the dropdown, such as Mi (mebibytes). If you leave this field empty, the volume is limited only by the storage available on the node.
  • Storage Medium (optional): Where the volume stores its data.
    • Default stores data on the disk of the node. This is the right choice for most use cases. If the volume grows beyond its size limit, the game server is terminated, which disconnects all players.
    • Memory stores data in RAM. Reads and writes are faster, but the data counts toward the memory usage of your game server. Include the expected volume size in the memory values in Resources, and set a size limit.
Mount settings ​

Every volume must be mounted in at least one container. To mount a volume, click "Add Mount" and configure the following settings:

  • Mount Path (required): The absolute path in the container where the volume appears, such as /shared.
  • SubPath (optional): A path inside the volume to mount instead of the volume root, such as logs. Use it to give each container its own directory within the same volume.

You can add several mounts for the same volume, for example to mount different SubPaths at different locations.

Mount paths hide existing files

A mounted volume replaces the content at its mount path. If your container image already contains files at that path, such as your game server binaries or default configuration, they are no longer visible to the container. Choose a mount path that does not exist in the image, or that is empty.

SubPaths are created as directories

Because an emptyDir volume starts empty, a SubPath does not exist when the game server starts and is created as a directory. A SubPath such as path.txt results in a directory named path.txt, not a file. To share a single file, mount the volume or a SubPath directory, and read or write the file inside it.

Example: Share the allocation payload with the Allocation Sidecar ​

The Allocation Sidecar can write the allocation payload to a file. Your game server can only read this file if both containers mount the same volume.

To set up the shared volume:

  1. Add a volume named payload with a size limit of 10 Mi. Keep the default storage medium.
  2. Mount the payload volume at /payload in the game server container.
  3. Mount the payload volume at /payload in the Allocation Sidecar container.
  4. On the Allocation Sidecar container, set the environment variable ALLOC_PAYLOAD_FILE to /payload/payload.json.

When the game server is allocated, the Allocation Sidecar writes the payload to /payload/payload.json, and your game server reads it from the same path. If both containers run as different users, adjust the file permissions with ALLOC_PAYLOAD_FILE_MODE.

ConfigFiles ​

In this section, you can mount any configuration files previously defined within your environment.

GUI_Create_Vessel_Containers_Config_Files.pngGUI_Create_Vessel_Containers_Config_Files.png

Resources ​

Resources are the CPU and memory required by your game server. This definition comes in two parts:

  • Requests (Mandatory): These are the resources that are guaranteed to your game server, and should be set to values that realistically resemble the resource consumption of an average game server that is in use. These requested values are used for scheduling decisions, which means that the game server is only started on a node that is guaranteed to still have these resources available.
  • Limits (Optional): Additionally, hard limits can be set for the resources the game server is allowed to use. If the game server exceeds its memory limits, it will be terminated, and if it exceeds its CPU limits, it will be throttled. It is generally recommended to set the memory limit to a threshold that would indicate a memory leak that warrants termination, and to not apply CPU limits, unless negative effects have been observed.

Resource Configuration

For detailed guidance on setting CPU and memory resources, see the Resource Management guide, which provides best practices for optimizing performance and costs.

GUI_Create_Vessel_Containers_Resources.pngGUI_Create_Vessel_Containers_Resources.png

Sidecars ​

Once you are done configuring your game server container, you may go back to the top of the page to add a sidecar container if you want to use one. The selector allows you to directly create an Allocator sidecar, or to create a new arbitrary container from scratch.

GUI_Create_Vessel_Containers_Sidecar.pngGUI_Create_Vessel_Containers_Sidecar.png

Advanced options ​

In this last section you can adjust advanced options like enabling profiling, configuring health checks, and defining grace periods for game server termination.

Profiling ​

GameFabric Multiplayer Servers has built-in support for eBPF-based CPU performance profiling using Grafana Pyroscope. This feature has an expected CPU performance impact of just 2-3%, so in most cases it is safe to enable.

Learn More

For details on troubleshooting profiling issues, including symbol resolution, see the Profiling guide.

GUI_Create_Vessel_Advanced_Profiling.pngGUI_Create_Vessel_Advanced_Profiling.png

Health checks ​

If a game server fails to call agones.Health(), it will be considered unhealthy and terminated. The thresholds for that process can be configured here. The default values are usually okay to use.

GUI_Create_Vessel_Advanced_Health_Checks.pngGUI_Create_Vessel_Advanced_Health_Checks.png

Health Checks: Default State & Best Practices

Health Checks are disabled by default to simplify the initial testing and integration of your Game Server SDK. However, for production usage, it is recommended that they be enabled. If Health Checks remain disabled in a live environment, game servers that enter an unresponsive or "frozen" state cannot be automatically detected or cleaned up by the platform, leading to potential matchmaking failures. Additionally, we do not make any promises as to lifecycle handling of such game servers without health checks during maintenances; game servers without proper integration may be evicted at a moment's notice during maintenance.

Termination grace periods ​

Game servers may receive Shutdown Hints, observable via the Agones SDK. These hints are used when game servers need to shut down within a specific time frame due to an external reason.

The reasons for a server to be told it should shut down are:

  • Maintenance: The Site the game server is running on is being put into maintenance and needs to be emptied.
  • Spec Change: The game server configuration was updated (such as a new version being available), and the game server needs to shut down so that the new configuration can be applied.
  • User Initiated: A suspension or restart was triggered by a user through the GameFabric UI or API.

Your game server is expected to handle shutdown hints explicitly:

  1. Observe the shutdown hint on the Agones GameServer object.
  2. If a hint is present, treat its timestamp as a deadline and start shutdown handling immediately.
  3. Exit the game server process before the hint timestamp is reached.

For the best player experience, implement graceful shutdown logic that lets active sessions end cleanly before exit. At minimum, show an in-game message such as "This server will shut down in X minutes" and stop accepting new matches.

GUI_Create_Vessel_Advanced_Grace_Periods.pngGUI_Create_Vessel_Advanced_Grace_Periods.png

The configured grace period is the time that the game server can use to gracefully shut down, for example, by informing the players to disconnect and shutting down when all players have left. When the game server has not shut down before the grace period has passed, it is forcefully terminated.

Visualize and configure ​

Now that the Vessel has been successfully created, it should become visible in the "Vessels" section. If the game server starts up as expected and completes its agones.Ready() call, the state of the Vessel should switch to "RUNNING".

GUI_Vessel_List.pngGUI_Vessel_List.png

You may click on the "Details" button to see more information.

GUI_Vessel_Details.pngGUI_Vessel_Details.png

In this view, you see the most important information about your game server, such as its public IP and ports. You can now use this information to perform a test connection to your game server.

On the same page, you can also inspect the logs of your game server, to troubleshoot any issues that occur.

GUI_Vessel_Details_Logs.pngGUI_Vessel_Details_Logs.png