📥 Container installation

Method A: Docker CLI

Run this command in your terminal to start the server immediately:

docker run \
  --name hytale-server \
  -e SERVER_IP="0.0.0.0" \
  -e SERVER_PORT="5520" \
  -e TZ="UTC" \
  -p 5520:5520/udp \
  -v "hytale-server:/home/container" \
  -v "/etc/machine-id:/etc/machine-id:ro" \
  --restart unless-stopped \
  -t -i \
  shotah/hytale-server:alpine

Method B: Docker compose

  1. Prepare a Directory: Create a dedicated folder inside your home directory to keep your project organized:
    mkdir ~/hytale-server && cd ~/hytale-server
    
  2. Configuration: Create a file named docker-compose.yml inside this new folder.

    nano docker-compose.yml
    

    add this docker-compose.yml information to the file:

    services:
      hytale:
        image: shotah/hytale-server:alpine
        container_name: hytale-server
        environment:
          SERVER_IP: "0.0.0.0"
          SERVER_PORT: "5520"
          TZ: "UTC"
        restart: unless-stopped
        ports:
          - "5520:5520/udp"
        volumes:
          - ./data:/home/container
          - /etc/machine-id:/etc/machine-id:ro
        tty: true
        stdin_open: true
    

    For more configuration options, see the examples folder.

  3. Now get out of the nano text editor and save the file:

    Operating System Step 1: Write Out Step 2: Confirm Filename Step 3: Exit Editor
    Linux / Windows (WSL) Press Ctrl + O Press Enter Press Ctrl + X
    macOS Press Control + O Press Return Press Control + X

    Automatic folder creation: When you start the container, a data folder will be created automatically next to your docker-compose.yml.

    [IMPORTANT] Your game files, world data, and configurations will be stored in this data folder. Because this folder is mapped to the container, your progress is saved even if you stop or delete the Docker container.

  4. Run the docker compose file!

    docker compose up
    

    Tip: do not use -d. We need to use the terminal to authenticate the server.


Windows Users (Docker Desktop with WSL)

If you’re running Docker Desktop on Windows with WSL, the default /etc/machine-id volume binding won’t work. Follow these steps instead:

  1. Modify the volume binding in your docker-compose.yml:

    Change this:

    volumes:
      - ./data:/home/container
      - /etc/machine-id:/etc/machine-id:ro
    

    To this:

    volumes:
      - ./data:/home/container
      - ./machine-id:/etc/machine-id:ro
    
  2. Generate a machine-id file by opening PowerShell in the same directory as your docker-compose.yml and running:

    [guid]::NewGuid().ToString("N") | Out-File -Encoding ascii -NoNewline .\machine-id
    
  3. Restart the server and authenticate it. You’ll be fine going forward.

Note: This creates a local machine-id file that persists with your project, ensuring consistent authentication across container restarts.


**Go to the Next page!


This site uses Just the Docs, a documentation theme for Jekyll.