Configuration

Configure your Hytale server environment variables and settings

Configuration

All configuration is done through environment variables in your docker-compose.yml.

Environment Variables

Core Settings

VariableDefaultDescription
SERVER_PORT5520Server port (UDP)
JAVA_OPTS-Xms4G -Xmx8GJVM memory and GC options
TZUTCContainer timezone
EXTRA_ARGS(empty)Additional server arguments

Server Configuration

These override fields in /server/Server/config.json on startup.

VariableDefaultDescription
SERVER_NAME(empty)Server name (ServerName)
MOTD(empty)Message of the day (MOTD)
PASSWORD(empty)Server password (Password)
MAX_PLAYERS(empty)Max players (MaxPlayers)
MAX_VIEW_RADIUS(empty)Max view radius (MaxViewRadius)
DEFAULT_WORLD(empty)Default world (Defaults.World)
DEFAULT_GAME_MODE(empty)Default game mode (Defaults.GameMode)

Updates

VariableDefaultDescription
AUTO_UPDATEfalseAutomatically update server on restart
PATCHLINEreleaseRelease channel (release, pre-release)
FORCE_UPDATEfalseForce re-download even if files exist

With AUTO_UPDATE=false, use hytale update schedule to manually trigger updates.

Authentication

VariableDefaultDescription
AUTO_REFRESH_TOKENStrueRefresh tokens before expiry
AUTOSELECT_GAME_PROFILEtrueAuto-select first profile
HYTALE_SERVER_SESSION_TOKEN(empty)Pre-provided session token
HYTALE_SERVER_IDENTITY_TOKEN(empty)Pre-provided identity token

Performance

VariableDefaultDescription
USE_AOT_CACHEtrueUse AOT cache for faster startup
DISABLE_SENTRYfalseDisable error reporting

CurseForge Mods

VariableDefaultDescription
CF_API_KEY(empty)CurseForge API key
CF_MODS(empty)Comma-separated mod project IDs

See CurseForge Mods for details.

Modtale Mods

VariableDefaultDescription
MT_API_KEY(empty)Modtale API key
MT_MODS(empty)Comma-separated mod UUIDs

See Modtale Mods for details.

Complete Example

services:
  hytale:
    image: rxmarin/hytale-docker:latest
    container_name: hytale-server
    restart: unless-stopped
    stdin_open: true
    tty: true
    ports:
      - "5520:5520/udp"
    
    environment:
      # Memory
      JAVA_OPTS: "-Xms4G -Xmx8G -XX:+UseG1GC"
      
      # Updates
      AUTO_UPDATE: "true"
      PATCHLINE: "release"
      
      # Performance
      USE_AOT_CACHE: "true"
      
      # CurseForge (optional)
      CF_API_KEY: "${CF_API_KEY}"
      CF_MODS: "123456,789012"
      
      # Timezone
      TZ: "America/New_York"
    
    volumes:
      - hytale-data:/server
    
    deploy:
      resources:
        limits:
          memory: 10G
        reservations:
          memory: 4G
    
    healthcheck:
      test: ["CMD", "pgrep", "-f", "HytaleServer.jar"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 120s

volumes:
  hytale-data:

Memory Configuration

Adjust Java heap size based on player count:

PlayersRAMJAVA_OPTS
1-52-4 GB-Xms2G -Xmx4G
5-104-6 GB-Xms4G -Xmx6G
10-206-8 GB-Xms6G -Xmx8G
20+8+ GB-Xms8G -Xmx10G

Set -Xms equal to -Xmx to prevent heap resizing during runtime.

Volume

The container uses one volume at /server:

volumes:
  - hytale-data:/server

Contents:

  • Server/ — Server JAR and runtime files
  • Assets.zip — Game assets
  • .hytale/tokens/ — OAuth and session tokens
  • mods/ — CurseForge mods (if configured)
  • World saves and configuration

Port Configuration

Hytale uses QUIC over UDP:

ports:
  - "5520:5520/udp"  # /udp is required!

To use a different external port:

ports:
  - "25565:5520/udp"  # External:Internal

Always keep the internal port as 5520. Only change the external (host) port.

AOT Cache

Ahead-of-Time compilation cache improves startup time:

environment:
  USE_AOT_CACHE: "true"
  • First startup: Normal speed (cache is generated)
  • Subsequent startups: Significantly faster

The cache file is stored at /server/Server/HytaleServer.aot.

Resource Limits

Set container resource limits:

deploy:
  resources:
    limits:
      memory: 10G
      cpus: '4.0'
    reservations:
      memory: 4G
      cpus: '2.0'

Health Check

The default health check monitors the Java process:

healthcheck:
  test: ["CMD", "pgrep", "-f", "HytaleServer.jar"]
  interval: 30s
  timeout: 10s
  retries: 3
  start_period: 120s

Next Steps

On this page