Deploying LinuxGSM
Introduction
LinuxGSM (Linux Game Server Managers) is a comprehensive command-line tool for deploying and managing dedicated game servers on Linux. Supporting over 120 game servers, LinuxGSM simplifies the complex process of installing, updating, and maintaining game servers with standardized commands and automated processes.
Originally created as a simple script for managing Counter-Strike servers, LinuxGSM has grown into a robust framework used by gaming communities worldwide. The project provides consistent management commands across different games, automated backup and update functionality, and monitoring capabilities.
Key highlights of LinuxGSM:
- 120+ Supported Games: From Counter-Strike to Minecraft to Rust
- Standardized Commands: Same commands work across all servers
- Automatic Updates: Keep game servers current automatically
- Backup Management: Scheduled and on-demand backups
- Monitoring: Track server status and performance
- Log Management: Organized logging for troubleshooting
- SteamCMD Integration: Seamless Steam game installation
- Discord Alerts: Notifications for server events
- Cron Support: Automated scheduling for maintenance
- Community Supported: Active development and documentation
This guide walks through deploying LinuxGSM on Klutch.sh using Docker.
Why Deploy LinuxGSM on Klutch.sh
Deploying LinuxGSM on Klutch.sh provides several advantages:
Simplified Deployment: Klutch.sh builds your game server from a Dockerfile. Push to GitHub, and your server deploys.
Persistent Storage: Attach persistent volumes for game files and world saves.
Scalable Resources: Game servers need varying resources; allocate based on game requirements.
Environment Variable Management: Configure server settings securely.
Always-On Availability: Game servers need 24/7 uptime for community play.
Multiple Instances: Run multiple game servers as separate apps.
Prerequisites
Before deploying LinuxGSM 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
- Knowledge of the game server you want to run
- Sufficient resources for your chosen game
- (Optional) A Steam account for Steam-based games
Understanding LinuxGSM Architecture
LinuxGSM manages game servers through:
Management Scripts: Shell scripts providing standardized commands.
SteamCMD: For downloading and updating Steam-based games.
Game Server Binary: The actual game server software.
Configuration Files: Game-specific settings and parameters.
Log System: Organized logging for all server activity.
Preparing Your Repository
Repository Structure
linuxgsm-deploy/├── Dockerfile├── README.md└── .dockerignoreCreating the Dockerfile (Example: Counter-Strike 2)
FROM gameservermanagers/linuxgsm:ubuntu-22.04
# Switch to root for setupUSER root
# Install dependenciesRUN apt-get update && apt-get install -y \ lib32gcc-s1 \ lib32stdc++6 \ libsdl2-2.0-0:i386 \ && rm -rf /var/lib/apt/lists/*
# Switch to linuxgsm userUSER linuxgsm
# Set working directoryWORKDIR /home/linuxgsm
# Install the game server (change for your game)ENV GAMESERVER=cs2serverRUN ./linuxgsm.sh ${GAMESERVER}
# Install the serverRUN ./${GAMESERVER} auto-install
# Environment configurationENV SERVERPORT=27015ENV RCONPASSWORD=${RCONPASSWORD:-changeme}
# Expose game portsEXPOSE 27015/tcp 27015/udp 27020/udp
# Health checkHEALTHCHECK --interval=60s --timeout=30s --start-period=300s --retries=3 \ CMD ./${GAMESERVER} monitor || exit 1
# Start the serverCMD ["./${GAMESERVER}", "start"]Creating the .dockerignore File
.git.github*.mdLICENSE.gitignore*.log.DS_Store.env.env.localSupported Games Reference
Some popular games supported by LinuxGSM:
| Game | Server Name | Default Ports |
|---|---|---|
| Counter-Strike 2 | cs2server | 27015 |
| Minecraft | mcserver | 25565 |
| Rust | rustserver | 28015, 28016 |
| ARK: Survival | arkserver | 7777, 27015 |
| Valheim | vhserver | 2456-2458 |
| Team Fortress 2 | tf2server | 27015 |
| Garry’s Mod | gmodserver | 27015 |
Deploying LinuxGSM on Klutch.sh
- Configure appropriate ports for your game
- Both TCP and UDP may be needed
- Check game documentation for port requirements
Choose Your Game
Decide which game server to deploy. Each game has different resource requirements and port configurations.
Customize the Dockerfile
Modify the Dockerfile for your chosen game:
ENV GAMESERVER=rustserver # Change to your gamePush Your Repository to GitHub
git initgit add Dockerfile .dockerignore README.mdgit commit -m "Initial LinuxGSM deployment configuration"git remote add origin https://github.com/yourusername/linuxgsm-deploy.gitgit push -u origin mainCreate a New Project on Klutch.sh
Navigate to the Klutch.sh dashboard and create a new project named “gameserver” or the game name.
Create a New App
Within your project, create a new app. Connect your GitHub account and select your LinuxGSM repository.
Configure Traffic
Game servers typically use UDP:
Set Environment Variables
Add game-specific configuration:
| Variable | Value |
|---|---|
GAMESERVER | Your game server name |
RCONPASSWORD | Admin password |
Attach Persistent Volumes
| Mount Path | Recommended Size | Purpose |
|---|---|---|
/home/linuxgsm/serverfiles | 50+ GB | Game files |
/home/linuxgsm/log | 2 GB | Server logs |
/home/linuxgsm/backup | 20+ GB | Server backups |
Deploy Your Application
Click Deploy to start the build process. Initial deployment downloads game files, which may take time.
Verify Server Status
Check that the game server is running and accessible.
Managing Your Server
Basic Commands
LinuxGSM provides consistent commands:
./gameserver start # Start the server./gameserver stop # Stop the server./gameserver restart # Restart the server./gameserver monitor # Check server status./gameserver update # Update game files./gameserver backup # Create backup./gameserver console # Access server consoleUpdating the Server
Keep your server current:
- Check for updates:
./gameserver update-lgsm - Update game:
./gameserver update - Verify functionality after update
Backups
Protect your server data:
- Manual backup:
./gameserver backup - Backups stored in
backup/directory - Schedule automatic backups via cron
Production Best Practices
Security Recommendations
- Use strong RCON passwords
- Limit admin access
- Keep game and LinuxGSM updated
- Monitor for exploits
Performance Tips
- Allocate sufficient RAM for your game
- Use SSD storage for faster loading
- Monitor CPU usage during gameplay
- Adjust player limits based on resources
Backup Strategy
- Schedule regular automatic backups
- Back up before major updates
- Test restore procedures
- Store backups off-server
Troubleshooting
Server Won’t Start
- Check resource allocation
- Review server logs
- Verify game files integrity
- Check port availability
Players Can’t Connect
- Verify correct ports are exposed
- Check firewall rules
- Confirm server is actually running
- Test with direct IP connection
Performance Issues
- Increase allocated resources
- Reduce player count
- Disable resource-heavy mods
- Check for memory leaks
Additional Resources
- Official LinuxGSM Website
- LinuxGSM Documentation
- LinuxGSM GitHub Repository
- Supported Servers List
- Klutch.sh Persistent Volumes
- Klutch.sh Deployments
Conclusion
Deploying LinuxGSM on Klutch.sh enables you to host dedicated game servers for your community with professional management tools. The standardized command interface makes it easy to maintain servers across different games.
With persistent storage for game worlds and backups, you can build gaming communities with reliable infrastructure you control.