How to Create a Hytale Server with Docker

Docker provides a production-ready, containerized solution for hosting Hytale servers with simplified deployment, automatic updates, and easy scalability. This guide uses a pre-built Docker image that handles all server dependencies, making it perfect for VPS hosting and cloud deployments.
What you'll learn: Docker installation, using pre-built images from Docker Hub, Docker Compose configuration, persistent data management, VPS deployment, backups, and production best practices.
Why Use Docker for Hytale Servers?
🚀 Easy Deployment
One-command setup with pre-configured Java 25, server files, and dependencies. No manual installation needed.
🔄 Automatic Updates
Pull the latest image to update your server. No need to manually download and configure new versions.
💾 Persistent Storage
Docker volumes ensure your world data, configs, and mods survive container restarts and updates.
🔒 Isolated Environment
Containers provide isolation from your host system, improving security and preventing conflicts.
Requirements
- â–¸Docker Engine: 20.10 or higher
- â–¸Docker Compose: 2.0 or higher
- â–¸RAM: 4GB minimum (6-8GB recommended)
- â–¸Storage: 5GB+ for server files and world data
- â–¸Hytale License: Valid Hytale game license for authentication
Step 1: Install Docker
Linux (Ubuntu/Debian)
# Download and run Docker installation scriptcurl -fsSL https://get.docker.com -o get-docker.shsudo sh get-docker.sh# Install Docker Compose pluginsudo apt-get updatesudo apt-get install docker-compose-plugin# Add your user to docker group (optional, avoids sudo)sudo usermod -aG docker $USERnewgrp dockerWindows / macOS
- 1.
Download Docker Desktop:
https://www.docker.com/products/docker-desktop - 2.
Install Docker Desktop and restart your computer
- 3.
Launch Docker Desktop and wait for it to start
Verify Installation
docker --versiondocker compose versionYou should see version numbers for both commands.
Step 2: Quick Start with Pre-Built Image
Recommended: Using the pre-built image from Docker Hub is the fastest way to get started. No build process required!
Docker Hub: p0lgs/hytale-server-docker →Create Project Directory
mkdir hytale-server && cd hytale-serverCreate docker-compose.yml
Create a file named docker-compose.yml with this content:
services: hytale-server: image: p0lgs/hytale-server-docker:latest container_name: hytale-server restart: unless-stopped ports: - "5520:5520/udp" environment: - JAVA_OPTS=-Xms2G -Xmx4G -XX:AOTCache=Server/HytaleServer.aot - HYTALE_PORT=5520 - HYTALE_BIND=0.0.0.0 volumes: - hytale-data:/hytale/Server stdin_open: true tty: truevolumes: hytale-data:Step 3: Start Your Server
Launch the Container
# Pull image and start serverdocker compose up -dThe -d flag runs the container in detached mode (background).
Check Status
# View logsdocker compose logs -f# Check container statusdocker psPress Ctrl+C to exit logs view.
Step 4: Authenticate Your Server
Important: Server authentication is required and separate from the build authentication. You must complete this step for players to connect.
Access Server Console
# Attach to the running containerdocker attach hytale-serverIn the server console, type:
/auth login deviceYou'll see output like:
===================================================================DEVICE AUTHORIZATION===================================================================Visit: https://accounts.hytale.com/deviceEnter code: ABCD-1234===================================================================- 1.
Visit the URL in your browser
- 2.
Enter the authorization code
- 3.
Complete authentication in your browser
- 4.
Return to console—you should see "Authentication successful!"
Detach from Console
To exit the console without stopping the server, press:
Ctrl+P, Ctrl+QThis key combination detaches from the container while keeping it running.
Step 5: Configure Firewall & Network
Critical: Hytale uses QUIC over UDP. All firewall rules must specify UDP, not TCP!
Linux (UFW)
sudo ufw allow 5520/udpsudo ufw enablesudo ufw statusLinux (iptables)
sudo iptables -A INPUT -p udp --dport 5520 -j ACCEPTsudo iptables-save | sudo tee /etc/iptables/rules.v4Cloud VPS (AWS, DigitalOcean, etc.)
Add an inbound rule in your provider's firewall/security group:
Protocol: UDP
Port: 5520
Source: 0.0.0.0/0 (allow all)
Configuration Options
Memory Allocation
Adjust JAVA_OPTS in docker-compose.yml:
environment: - JAVA_OPTS=-Xms4G -Xmx6G -XX:AOTCache=Server/HytaleServer.aot-Xms: Minimum heap (starting memory)
-Xmx: Maximum heap (memory limit)
Custom Port
Change the server port:
ports: - "25565:25565/udp" # External:Internalenvironment: - HYTALE_PORT=25565Auto-Restart Policy
Control container restart behavior:
restart: unless-stopped # Restart unless manually stopped# restart: always # Always restart# restart: no # Never restart# restart: on-failure # Only restart on crashData Management
Persistent Storage
All server data is stored in the Docker volume hytale-data:
- â–¸World saves (universe/)
- â–¸Configuration files (config.json, permissions.json)
- â–¸Mods (mods/)
- â–¸Logs (logs/)
Access Server Files
# List filesdocker exec hytale-server ls -la /hytale/Server# View configdocker exec hytale-server cat /hytale/Server/config.json# Copy file from containerdocker cp hytale-server:/hytale/Server/config.json ./config.json# Copy file to containerdocker cp ./config.json hytale-server:/hytale/Server/config.jsondocker compose restartInstall Mods
# Copy mod to serverdocker cp your-mod.jar hytale-server:/hytale/Server/mods/# Restart to load moddocker compose restartBackups
Full Server Backup
docker run --rm --volumes-from hytale-server -v $(pwd):/backup ubuntu \ tar czf /backup/hytale-backup-$(date +%Y%m%d).tar.gz -C /hytale/Server .Creates a compressed backup in your current directory.
Backup Just World Data
docker exec hytale-server tar czf /tmp/universe.tar.gz -C /hytale/Server/universe .docker cp hytale-server:/tmp/universe.tar.gz ./universe-backup-$(date +%Y%m%d).tar.gzCommon Docker Commands
# Start serverdocker compose up -d# Stop serverdocker compose down# Restart serverdocker compose restart# View logs (live)docker compose logs -f# Access consoledocker attach hytale-server# (Detach: Ctrl+P, Ctrl+Q)# Check resource usagedocker stats hytale-server# Update to latest versiondocker compose pulldocker compose up -dComplete VPS Deployment Guide
Full Setup Script
Here's a complete deployment script for a fresh VPS:
# Install Dockercurl -fsSL https://get.docker.com -o get-docker.shsudo sh get-docker.shsudo apt-get install docker-compose-plugin# Configure firewallsudo ufw allow 5520/udpsudo ufw enable# Create server directorymkdir -p ~/hytale-server && cd ~/hytale-server# Download docker-compose.ymlwget https://raw.githubusercontent.com/PolGs/hytale-server-docker/main/docker-compose.yml# Edit to use published imagenano docker-compose.yml# Change 'build: .' to 'image: p0lgs/hytale-server-docker:latest'# Start serverdocker compose up -d# Authenticatedocker attach hytale-server# Run: /auth login device# Detach: Ctrl+P, Ctrl+QTroubleshooting
Players Can't Connect
Check:
- â–¸Port mapping uses
/udpnot/tcp - â–¸Firewall allows UDP port 5520:
sudo ufw status - â–¸Server authentication completed
- â–¸Container is running:
docker ps
Container Crashes (Out of Memory)
Check logs with docker compose logs. If you see OOM errors, increase -Xmx in JAVA_OPTS. For 10+ players, use at least 8GB.
Permission Denied Errors
If you get permission errors, add your user to the docker group: sudo usermod -aG docker $USER, then log out and back in.
Data Lost After Update
Ensure you're using Docker volumes (not bind mounts) for persistent storage. Check your docker-compose.yml has volumes: section defined.
Advanced: Build from Source
Optional: Only build from source if you want to customize the Dockerfile or contribute to development.
# Clone repositorygit clone https://github.com/PolGs/hytale-server-docker.gitcd hytale-server-docker# Build image (requires authentication during build)docker compose build# Start serverdocker compose up -d# Authenticate serverdocker attach hytale-server# /auth login deviceNote: Building requires authentication (~1.4GB download, 5-10 minutes).
Your Docker Server is Ready!
You now have a production-ready, containerized Hytale server running with Docker. Enjoy easy updates, persistent data storage, and simple management. Share your server IP to let players connect, and don't forget to list it on Hytale Servers Space to grow your community!
Additional Resources
- â–¸Docker Hub Image: p0lgs/hytale-server-docker
- â–¸GitHub Repository: PolGs/hytale-server-docker
- â–¸
- â–¸