Skip to content

Deploying Zero-K

Introduction

Zero-K is a free, open-source real-time strategy game built on the Spring RTS engine. It features a unique combination of traditional RTS gameplay with innovative mechanics like terraforming, physics-based projectiles, and over 100 unique units across multiple factions. The game supports large-scale battles with thousands of units and offers both single-player campaigns and competitive multiplayer modes.

Originally derived from Total Annihilation and its spiritual successor Supreme Commander, Zero-K has evolved into a distinct game with its own identity. The dedicated development team continues to refine gameplay, add new features, and maintain active multiplayer servers that host players worldwide.

Key highlights of Zero-K:

  • 100+ Unique Units: Diverse unit roster including walkers, tanks, aircraft, naval units, and experimental superweapons
  • Terraforming System: Reshape the battlefield by raising or lowering terrain, creating walls, or digging moats
  • Physics-Based Combat: Projectiles follow realistic trajectories affected by terrain and gravity
  • Deep Economy: Metal and energy resource management with reclaim mechanics and constructor units
  • Multiplayer Focused: Matchmaking, team games, and custom lobbies with active player community
  • Mod Support: Extensive modding capabilities for custom units, maps, and game modes
  • Cross-Platform: Runs on Windows, Linux, and macOS
  • Completely Free: No pay-to-win mechanics or premium content

This guide walks through deploying a Zero-K dedicated game server on Klutch.sh using Docker, enabling you to host custom matches and private tournaments.

Why Deploy Zero-K on Klutch.sh

Deploying a Zero-K server on Klutch.sh provides several advantages for hosting multiplayer games:

Dedicated Server Hosting: Run a persistent game server without tying up your personal computer or dealing with port forwarding and network configuration.

Low Latency Infrastructure: Klutch.sh’s infrastructure provides consistent, low-latency connections for competitive gameplay.

Always Available: Your server remains online 24/7, allowing players from different time zones to join matches whenever they want.

Custom Configuration: Full control over game settings, maps, mods, and server rules for your community.

Scalable Resources: Allocate CPU and memory based on expected player counts and game complexity.

GitHub Integration: Store your server configuration in version control and deploy updates automatically.

Prerequisites

Before deploying Zero-K on Klutch.sh, ensure you have:

  • A Klutch.sh account
  • A GitHub account with a repository for your server configuration
  • Basic familiarity with Docker and containerization concepts
  • A Zero-K account for server registration (optional but recommended)
  • Understanding of RTS game server administration

Understanding Zero-K Architecture

Zero-K’s multiplayer infrastructure consists of several components:

Spring RTS Engine: The core game engine that handles physics, rendering, and game logic. Dedicated servers run headless versions without graphical output.

Lobby Server: The central matchmaking and lobby system that coordinates players and servers. Your dedicated server registers with the lobby for visibility.

Autohost: A specialized server mode that automatically manages games, rotates maps, and handles player voting.

SPADS (Spring Autohost System): A popular autohost solution written in Perl that provides advanced server management features.

Preparing Your Repository

Create a GitHub repository containing your Zero-K server configuration.

Repository Structure

zero-k-server/
├── Dockerfile
├── config/
│ ├── spads.conf
│ └── hostingPresets.conf
├── maps/
│ └── .gitkeep
└── .dockerignore

Creating the Dockerfile

Create a Dockerfile that sets up the Zero-K dedicated server:

FROM ubuntu:22.04
# Prevent interactive prompts during installation
ENV DEBIAN_FRONTEND=noninteractive
# Install dependencies
RUN apt-get update && apt-get install -y \
wget \
unzip \
libsdl2-2.0-0 \
libfreetype6 \
libopenal1 \
libvorbisfile3 \
libcurl4 \
perl \
libdbd-sqlite3-perl \
libwww-perl \
libjson-perl \
&& rm -rf /var/lib/apt/lists/*
# Create server directory
WORKDIR /opt/zerok
# Download and install Spring RTS engine
RUN wget -q https://springrts.com/dl/buildbot/default/master/spring_104.0.1-1770-g25d8760_linux64-minimal-portable.7z \
&& 7z x spring_104.0.1-1770-g25d8760_linux64-minimal-portable.7z \
&& rm spring_104.0.1-1770-g25d8760_linux64-minimal-portable.7z
# Download Zero-K game files
RUN wget -q https://zero-k.info/lobby/Zero-K.sdz -O games/Zero-K.sdz
# Download SPADS autohost
RUN wget -q https://github.com/Yaribz/SPADS/archive/master.zip \
&& unzip master.zip \
&& mv SPADS-master spads \
&& rm master.zip
# Copy configuration files
COPY config/ /opt/zerok/spads/etc/
# Expose game port
EXPOSE 8452/udp
# Set environment variables
ENV SERVER_NAME=${SERVER_NAME:-"Klutch Zero-K Server"}
ENV ADMIN_PASSWORD=${ADMIN_PASSWORD}
# Start the server
CMD ["perl", "/opt/zerok/spads/spads.pl", "/opt/zerok/spads/etc/spads.conf"]

Environment Variables Reference

VariableRequiredDefaultDescription
SERVER_NAMENoKlutch Zero-K ServerDisplay name for your server in the lobby
ADMIN_PASSWORDYes-Password for server administration
LOBBY_LOGINNo-Zero-K lobby account username
LOBBY_PASSWORDNo-Zero-K lobby account password
MAX_PLAYERSNo16Maximum players per game

Deploying Zero-K on Klutch.sh

    Push Your Repository to GitHub

    Initialize and push your configuration repository to GitHub with your Dockerfile and server configuration files.

    Create a New Project on Klutch.sh

    Navigate to the Klutch.sh dashboard and create a new project named “zero-k” or similar.

    Create a New App

    Within your project, create a new app and connect your GitHub repository containing the Zero-K server configuration.

    Configure Network Settings

    Zero-K uses UDP for game traffic:

    • Select UDP as the traffic type
    • Set the port to 8452 (default Spring RTS port)

    Set Environment Variables

    Configure the following environment variables:

    VariableValue
    SERVER_NAMEYour desired server name
    ADMIN_PASSWORDSecure admin password
    LOBBY_LOGINYour Zero-K account username
    LOBBY_PASSWORDYour Zero-K account password

    Attach Persistent Volumes

    Add persistent storage for maps and replays:

    Mount PathRecommended SizePurpose
    /opt/zerok/maps10 GBDownloaded map files
    /opt/zerok/demos20 GBGame replays and recordings
    /opt/zerok/spads/var1 GBSPADS runtime data and logs

    Deploy Your Application

    Click Deploy to build and start your Zero-K server. The server will register with the Zero-K lobby once running.

    Verify Server Status

    Check the Zero-K lobby or game client to verify your server appears in the server list.

Server Configuration

SPADS Configuration

Customize your server behavior by editing the SPADS configuration files:

spads.conf: Main configuration including server name, game settings, and permissions.

hostingPresets.conf: Define game presets for different modes like 1v1, team games, or FFA.

Map Rotation

Configure automatic map rotation by editing the map list in your SPADS configuration or allowing players to vote for maps.

Moderation Tools

SPADS provides extensive moderation capabilities:

  • Player bans and kicks
  • Vote systems for map changes and settings
  • Automatic balance for team games
  • Skill-based matchmaking integration

Troubleshooting Common Issues

Server Not Appearing in Lobby

Solutions:

  • Verify lobby credentials are correct
  • Check that UDP port 8452 is accessible
  • Review logs for connection errors

Players Cannot Connect

Solutions:

  • Confirm UDP traffic type is selected
  • Verify firewall settings allow game traffic
  • Check server logs for authentication issues

Game Crashes or Desyncs

Solutions:

  • Ensure all players have matching game versions
  • Verify map files are not corrupted
  • Check server resource allocation for large games

Additional Resources

Conclusion

Deploying Zero-K on Klutch.sh enables you to host a dedicated game server for this excellent open-source RTS game. With SPADS autohost integration, you can run a fully automated server that manages games, rotates maps, and provides a great multiplayer experience for your community. The combination of Zero-K’s deep tactical gameplay and Klutch.sh’s reliable hosting infrastructure creates an ideal environment for competitive matches and casual games alike.