Skip to content

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
└── .dockerignore

Creating the Dockerfile (Example: Counter-Strike 2)

FROM gameservermanagers/linuxgsm:ubuntu-22.04
# Switch to root for setup
USER root
# Install dependencies
RUN 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 user
USER linuxgsm
# Set working directory
WORKDIR /home/linuxgsm
# Install the game server (change for your game)
ENV GAMESERVER=cs2server
RUN ./linuxgsm.sh ${GAMESERVER}
# Install the server
RUN ./${GAMESERVER} auto-install
# Environment configuration
ENV SERVERPORT=27015
ENV RCONPASSWORD=${RCONPASSWORD:-changeme}
# Expose game ports
EXPOSE 27015/tcp 27015/udp 27020/udp
# Health check
HEALTHCHECK --interval=60s --timeout=30s --start-period=300s --retries=3 \
CMD ./${GAMESERVER} monitor || exit 1
# Start the server
CMD ["./${GAMESERVER}", "start"]

Creating the .dockerignore File

.git
.github
*.md
LICENSE
.gitignore
*.log
.DS_Store
.env
.env.local

Supported Games Reference

Some popular games supported by LinuxGSM:

GameServer NameDefault Ports
Counter-Strike 2cs2server27015
Minecraftmcserver25565
Rustrustserver28015, 28016
ARK: Survivalarkserver7777, 27015
Valheimvhserver2456-2458
Team Fortress 2tf2server27015
Garry’s Modgmodserver27015

Deploying LinuxGSM on Klutch.sh

    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 game

    Push Your Repository to GitHub

    Terminal window
    git init
    git add Dockerfile .dockerignore README.md
    git commit -m "Initial LinuxGSM deployment configuration"
    git remote add origin https://github.com/yourusername/linuxgsm-deploy.git
    git push -u origin main

    Create 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:

    • Configure appropriate ports for your game
    • Both TCP and UDP may be needed
    • Check game documentation for port requirements

    Set Environment Variables

    Add game-specific configuration:

    VariableValue
    GAMESERVERYour game server name
    RCONPASSWORDAdmin password

    Attach Persistent Volumes

    Mount PathRecommended SizePurpose
    /home/linuxgsm/serverfiles50+ GBGame files
    /home/linuxgsm/log2 GBServer logs
    /home/linuxgsm/backup20+ GBServer 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:

Terminal window
./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 console

Updating the Server

Keep your server current:

  1. Check for updates: ./gameserver update-lgsm
  2. Update game: ./gameserver update
  3. Verify functionality after update

Backups

Protect your server data:

  1. Manual backup: ./gameserver backup
  2. Backups stored in backup/ directory
  3. 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

  1. Schedule regular automatic backups
  2. Back up before major updates
  3. Test restore procedures
  4. 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

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.