This project provides a Dockerized environment for running a Hytale dedicated server with automated authentication handling.
- Linux
- Docker & Docker Compose
- Make
- curl
- jq
Run the following command to start the server stack:
make upThis command performs the following actions:
- Executes
scripts/auth.shto validate or refresh authentication tokens. - Updates the
.envfile with valid session credentials. - Starts the Docker container using valid credentials.
make downmake logsThe Hytale Dedicated Server requires active authentication to start (to verify ownership/access). This project automates the OAuth 2.0 Device Code flow to minimize manual intervention.
Authentication tokens are stored in the .env file in the root directory:
- REFRESH_TOKEN: A long-lived token (approx. 30 days) used to generate new session tokens without user interaction.
- HYTALE_SERVER_SESSION_TOKEN & HYTALE_SERVER_IDENTITY_TOKEN: Short-lived EdDSA-signed tokens required by the server runtime.
On a fresh installation, you will be prompted to authenticate twice. This is normal behavior due to the server architecture:
- Runtime Authentication: The
auth.shscript runs first. It will prompt you to visit a URL to generate the initial Refresh Token and Session Tokens. - Downloader Authentication: When the Docker container starts for the first time, if
HytaleServer.jaris missing, thehytale-downloader-linuxbinary runs. This binary requires its own authentication and will prompt you to visit a URL again via the logs.
Once the initial download is complete and the Refresh Token is stored, subsequent restarts via make up are fully automated.
This script handles the interaction with Hytale's OAuth endpoints.
- Checks for a valid
REFRESH_TOKENin.env. - If found, it refreshes the token and generates a new Game Session (
POST /game-session/new). - If not found, it initiates the Device Code Flow (
POST /oauth2/device/auth) and waits for user approval. - Updates
.envwith the new tokens fordocker-compose.ymlto consume.
The container is configured via docker-compose.yml to accept tokens as environment variables:
HYTALE_SERVER_SESSION_TOKENHYTALE_SERVER_IDENTITY_TOKENHYTALE_DOWNLOADER_TOKEN
Data is persisted in the ./data directory, which is mounted to /hytale inside the container.