Skip to content

Running in Docker

Liam Robinson edited this page Nov 8, 2026 · 1 revision

Running in Docker

The game's repository holds a Dockerfile and a compose.yaml for the dedicated server in Engine/assets/server/deploy/. The image is built from the source on your machine; there is no ready-made image. The image holds only the server program. Your disc's rules data, the keys, the logs and the scripts' data live in a volume, never in the image.

Build and set up

From the root of a clone of the game's repository:

  1. Make server.toml beside compose.yaml (copy server.toml.example there and edit it). Inside a container, bind must be "::" or "0.0.0.0".

  2. Build the image (this compiles the server; it takes a while):

    docker compose -f Engine/assets/server/deploy/compose.yaml build
  3. Set up the rules data from your own disc image into the volume, once:

    docker compose -f Engine/assets/server/deploy/compose.yaml run --rm \
      -v /path/to/your/ssx.iso:/iso/ssx.iso:ro avalanche-server setup /iso/ssx.iso --out /srv/avalanche/data
  4. Start it:

    docker compose -f Engine/assets/server/deploy/compose.yaml up -d
Task Command (add -f Engine/assets/server/deploy/compose.yaml)
check the configuration docker compose run --rm avalanche-server check --config /srv/avalanche/server.toml --data /srv/avalanche/data
the log docker compose logs -f avalanche-server
apply a changed server.toml docker compose restart avalanche-server
stop docker compose stop

What the compose file sets

  • Ports UDP 27450, TCP 27450 and UDP 27451 published on the host.
  • server.toml mounted read-only at /srv/avalanche/server.toml; an icon goes beside it (the file has the line commented out).
  • The volume avalanche-data at /srv/avalanche/data.
  • The graceful stop: SIGTERM, and 110 seconds before Docker kills the server: a round under way ([stop] round_end, 60 s by default) and 50 seconds for the rest of the stop (Running as a Service lists them). With another round_end, set stop_grace_period to round_end + 50 seconds.
  • The server runs as an unprivileged user (uid 10001) and restarts unless you stopped it.

A container has no console input: use the remote console from the host or from anywhere else.

Resources

Keep the resources in a folder beside compose.yaml, mount it read-only and point the server at it:

    volumes:
      - ./server.toml:/srv/avalanche/server.toml:ro
      - avalanche-data:/srv/avalanche/data
      - ./resources:/srv/avalanche/resources:ro
[resources]
folder = "/srv/avalanche/resources"
start = ["welcome"]

The server only reads that folder; its own copies and the scripts' data stay in the volume.

LAN discovery and port mapping

Both need the host's network: LAN broadcasts and the router see the container's network otherwise. With lan = true or [port_mapping] enabled = true, remove ports from compose.yaml and add network_mode: host.

Back up

The server's keys (identity.key, netcode.key), acl.toml, bans.toml and the scripts' data are in the volume. Back up the whole volume with your usual Docker volume backup; losing identity.key makes players' games refuse the server.

Clone this wiki locally