Skip to content

Deploying Mindustry

Introduction

Mindustry is an open-source factory-building game combined with tower defense elements. Players build elaborate supply chains to feed ammunition to turrets, constructing defenses to survive waves of enemies. The game supports multiplayer, making it perfect for hosting dedicated servers for friends or communities.

Running a dedicated Mindustry server allows for persistent worlds, custom maps, and modded gameplay experiences. The server is lightweight and can handle multiple players working together to build and defend against enemy waves.

Key highlights of Mindustry:

  • Factory Building: Design complex production chains and logistics systems
  • Tower Defense: Build turrets and defenses against enemy waves
  • Multiplayer Support: Play cooperatively with friends and communities
  • Custom Maps: Create and share custom maps and campaigns
  • Mod Support: Extend gameplay with community mods
  • Cross-Platform: Players on PC, mobile, and web can join
  • Lightweight Server: Low resource requirements for hosting
  • Persistent Worlds: Save and continue games across sessions
  • Active Community: Large player base with active development
  • 100% Open Source: Java-based with MIT license

This guide walks through deploying a Mindustry dedicated server on Klutch.sh using Docker, configuring game settings, and managing your server.

Why Deploy Mindustry on Klutch.sh

Deploying a Mindustry server on Klutch.sh provides several advantages for multiplayer gaming:

Simplified Deployment: Klutch.sh automatically detects your Dockerfile and builds your game server without complex orchestration.

Persistent Storage: Attach persistent volumes for save files and configuration. Your game progress survives container restarts.

GitHub Integration: Connect your configuration repository directly from GitHub. Updates trigger automatic redeployments.

Scalable Resources: Allocate CPU and memory based on player count and map complexity.

Always-On Availability: Your game server runs 24/7, allowing players to join anytime.

Custom Domains: Use a memorable domain for players to connect.

Prerequisites

Before deploying Mindustry on Klutch.sh, ensure you have:

  • A Klutch.sh account
  • A GitHub account with a repository for your configuration
  • Basic familiarity with Docker and containerization concepts
  • Mindustry game client for testing
  • (Optional) Custom maps and mods to add to your server

Preparing Your Repository

To deploy Mindustry on Klutch.sh, create a GitHub repository containing your Dockerfile and server configuration.

Repository Structure

mindustry-server/
├── Dockerfile
├── config/
│ └── config.json
├── maps/
├── mods/
├── README.md
└── .dockerignore

Creating the Dockerfile

Create a Dockerfile in the root of your repository:

FROM eclipse-temurin:17-jre-alpine
# Set working directory
WORKDIR /mindustry
# Download Mindustry server
ARG MINDUSTRY_VERSION=146
RUN wget -O server.jar \
"https://github.com/Anuken/Mindustry/releases/download/v${MINDUSTRY_VERSION}/server-release.jar"
# Create directories
RUN mkdir -p /mindustry/config /mindustry/saves /mindustry/maps /mindustry/mods
# Copy configuration files
COPY config/ /mindustry/config/
COPY maps/ /mindustry/maps/
COPY mods/ /mindustry/mods/
# Set permissions
RUN chmod -R 755 /mindustry
# Expose game port
EXPOSE 6567/tcp
EXPOSE 6567/udp
# Environment variables
ENV JAVA_OPTS="-Xmx512M -Xms256M"
# Start the server
CMD ["sh", "-c", "java $JAVA_OPTS -jar server.jar"]

Server Configuration

Create config/config.json:

{
"name": "My Mindustry Server",
"desc": "A dedicated Mindustry server on Klutch.sh",
"port": 6567,
"autoUpdate": false,
"showConnectMessages": true,
"enableVotekick": true,
"startCommands": "",
"logging": true,
"strict": false,
"antiSpam": true,
"interactRateWindow": 6,
"interactRateLimit": 25,
"interactRateKick": 50,
"messageRateLimit": 2,
"messageSpamKick": 3,
"packetSpamLimit": 30,
"chatSpamLimit": 5
}

Environment Variables Reference

VariableRequiredDefaultDescription
JAVA_OPTSNo-Xmx512MJVM memory settings
SERVER_PORTNo6567Game server port

Deploying on Klutch.sh

    Add Custom Maps (Optional)

    Place any custom map files (.msav) in the maps/ directory.

    Add Mods (Optional)

    Place any mod files (.jar or .zip) in the mods/ directory.

    Push Your Repository to GitHub

    Initialize your repository and push to GitHub:

    Terminal window
    git init
    git add Dockerfile config/ maps/ mods/ .dockerignore README.md
    git commit -m "Initial Mindustry server configuration"
    git remote add origin https://github.com/yourusername/mindustry-server.git
    git push -u origin main

    Create a New Project on Klutch.sh

    Navigate to the Klutch.sh dashboard and create a new project. Give it a descriptive name like “mindustry” or “game-server”.

    Create a New App

    Within your project, create a new app. Connect your GitHub account if you haven’t already, then select the repository containing your Mindustry Dockerfile.

    Configure Network Traffic

    Mindustry uses TCP and UDP for game connections:

    • Configure port 6567 for both TCP and UDP traffic

    Set Environment Variables

    Add the following environment variables:

    VariableValue
    JAVA_OPTS-Xmx1G -Xms512M (adjust based on resources)

    Attach Persistent Volumes

    Add the following volumes:

    Mount PathRecommended SizePurpose
    /mindustry/saves1 GBGame save files
    /mindustry/config100 MBServer configuration

    Deploy Your Application

    Click Deploy to start the build process. Klutch.sh will:

    • Detect your Dockerfile automatically
    • Build the container image
    • Attach the persistent volumes
    • Start the Mindustry server

    Connect to Your Server

    Once deployment completes, connect to your server using the Mindustry client:

    1. Open Mindustry
    2. Click Play > Join Game
    3. Enter your server address and port

Server Administration

Console Commands

Access the server console for administration:

# List connected players
players
# Kick a player
kick <player>
# Ban a player
ban <player>
# Change map
host <mapname> [mode]
# Save the game
save <filename>
# Load a save
load <filename>
# Stop the server
stop

Game Modes

Available game modes:

  • survival: Standard survival mode with waves
  • attack: Attack the enemy core
  • pvp: Player vs player
  • sandbox: Creative mode without enemies
  • editor: Map editor mode

Map Management

Control which maps are available:

# List available maps
maps
# Add a map
host <mapname>
# Set map rotation
config mapRotation map1,map2,map3

Custom Maps

Adding Custom Maps

  1. Create maps in the Mindustry editor
  2. Export as .msav files
  3. Place in the maps/ directory
  4. Redeploy your server

Map Sources

Find community maps at:

  • Steam Workshop
  • Mindustry Discord
  • Community forums
  • GitHub repositories

Mods and Plugins

Adding Mods

  1. Download mods from community sources
  2. Place .jar or .zip files in mods/
  3. Redeploy your server
  4. Players may need matching mods to join

Common mods include:

  • New units and blocks
  • Additional maps
  • Quality of life improvements
  • Custom game modes

Performance Tuning

Memory Settings

Adjust JVM memory based on player count:

# Small server (1-5 players)
JAVA_OPTS="-Xmx512M -Xms256M"
# Medium server (5-20 players)
JAVA_OPTS="-Xmx1G -Xms512M"
# Large server (20+ players)
JAVA_OPTS="-Xmx2G -Xms1G"

Server Settings

Optimize for performance:

{
"interactRateWindow": 6,
"interactRateLimit": 25,
"antiSpam": true
}

Troubleshooting

Players Cannot Connect

  • Verify port 6567 is accessible
  • Check firewall settings
  • Confirm server is running
  • Test with local connection first

Server Crashes

  • Check available memory
  • Review server logs
  • Verify mod compatibility
  • Test with vanilla configuration

Lag Issues

  • Reduce map complexity
  • Limit player count
  • Increase server resources
  • Disable unnecessary mods

Additional Resources

Conclusion

Deploying a Mindustry server on Klutch.sh gives you a dedicated space for multiplayer factory-building and tower defense gameplay. With persistent saves, custom maps, and mod support, you can create unique gaming experiences for your community.

The combination of Mindustry’s engaging gameplay and Klutch.sh’s reliable infrastructure ensures your server runs 24/7, ready for players to join and build together. Whether you’re hosting casual games with friends or running a community server, Mindustry on Klutch.sh provides the foundation for endless cooperative fun.