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└── .dockerignoreCreating the Dockerfile
Create a Dockerfile in the root of your repository:
FROM eclipse-temurin:17-jre-alpine
# Set working directoryWORKDIR /mindustry
# Download Mindustry serverARG MINDUSTRY_VERSION=146RUN wget -O server.jar \ "https://github.com/Anuken/Mindustry/releases/download/v${MINDUSTRY_VERSION}/server-release.jar"
# Create directoriesRUN mkdir -p /mindustry/config /mindustry/saves /mindustry/maps /mindustry/mods
# Copy configuration filesCOPY config/ /mindustry/config/COPY maps/ /mindustry/maps/COPY mods/ /mindustry/mods/
# Set permissionsRUN chmod -R 755 /mindustry
# Expose game portEXPOSE 6567/tcpEXPOSE 6567/udp
# Environment variablesENV JAVA_OPTS="-Xmx512M -Xms256M"
# Start the serverCMD ["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
| Variable | Required | Default | Description |
|---|---|---|---|
JAVA_OPTS | No | -Xmx512M | JVM memory settings |
SERVER_PORT | No | 6567 | Game server port |
Deploying on Klutch.sh
- Configure port 6567 for both TCP and UDP traffic
- Detect your Dockerfile automatically
- Build the container image
- Attach the persistent volumes
- Start the Mindustry server
- Open Mindustry
- Click Play > Join Game
- Enter your server address and port
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:
git initgit add Dockerfile config/ maps/ mods/ .dockerignore README.mdgit commit -m "Initial Mindustry server configuration"git remote add origin https://github.com/yourusername/mindustry-server.gitgit push -u origin mainCreate 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:
Set Environment Variables
Add the following environment variables:
| Variable | Value |
|---|---|
JAVA_OPTS | -Xmx1G -Xms512M (adjust based on resources) |
Attach Persistent Volumes
Add the following volumes:
| Mount Path | Recommended Size | Purpose |
|---|---|---|
/mindustry/saves | 1 GB | Game save files |
/mindustry/config | 100 MB | Server configuration |
Deploy Your Application
Click Deploy to start the build process. Klutch.sh will:
Connect to Your Server
Once deployment completes, connect to your server using the Mindustry client:
Server Administration
Console Commands
Access the server console for administration:
# List connected playersplayers
# Kick a playerkick <player>
# Ban a playerban <player>
# Change maphost <mapname> [mode]
# Save the gamesave <filename>
# Load a saveload <filename>
# Stop the serverstopGame 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 mapsmaps
# Add a maphost <mapname>
# Set map rotationconfig mapRotation map1,map2,map3Custom Maps
Adding Custom Maps
- Create maps in the Mindustry editor
- Export as
.msavfiles - Place in the
maps/directory - Redeploy your server
Map Sources
Find community maps at:
- Steam Workshop
- Mindustry Discord
- Community forums
- GitHub repositories
Mods and Plugins
Adding Mods
- Download mods from community sources
- Place
.jaror.zipfiles inmods/ - Redeploy your server
- Players may need matching mods to join
Popular Mods
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
- Mindustry Official Website
- Mindustry GitHub Repository
- Mindustry Wiki
- Mindustry Discord
- Klutch.sh Persistent Volumes
- Klutch.sh Deployments
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.