LinuxGSM (Linux Game Server Managers) is a free, open-source command-line tool for installing and managing dedicated game servers on Linux. It supports well over 100 games, including CS2, Rust, Valheim, ARK, 7 Days to Die, Project Zomboid, Satisfactory, Minecraft, Terraria and Garry’s Mod. It wraps SteamCMD, tmux, updates, backups, monitoring and alerts into one consistent set of commands.

Prefer a web panel? See Pterodactyl or AMP.

Why use LinuxGSM?

  • One workflow for every game: ./vhserver install, start, stop, update, backup, monitor.
  • It checks and installs dependencies for you (with sudo), including 32-bit libraries.
  • Console access through tmux, without systemd unit files to write.
  • Automatic updates and crash recovery from cron.
  • Alerts to Discord, email, Telegram, Slack, Pushover and more.

Requirements

  • Ubuntu or Debian (other distributions are supported too).
  • A non-root user per game server (recommended).
  • Resources for your game: check each game’s guide, such as Valheim, Rust, or Minecraft RAM.

Install a game server (Valheim example)

sudo adduser --disabled-password --gecos "" vhserver
sudo -iu vhserver
curl -Lo linuxgsm.sh https://linuxgsm.sh && chmod +x linuxgsm.sh && bash linuxgsm.sh vhserver
./vhserver install

Each game has a short server name (vhserver for Valheim, cs2server, rustserver, pzserver, sdtdserver, mcserver, terrariaserver, gmodserver and so on). Run ./linuxgsm.sh list to see all of them.

The installer lists missing dependencies, and offers to install them if your user has sudo. Otherwise, it prints the apt install command for an admin to run.

Everyday commands

Command Short What it does
./vhserver start st Start in a tmux session
./vhserver stop sp Graceful stop
./vhserver restart r Restart
./vhserver console c Attach to the console (detach: Ctrl+B, D)
./vhserver details dt Ports, paths, passwords, status
./vhserver update u Update the game via SteamCMD (if an update exists)
./vhserver backup b Create a compressed backup
./vhserver monitor m Restart the server if it has crashed
./vhserver update-lgsm ul Update LinuxGSM itself

details is especially useful: it shows the ports to open in your firewall. See UFW.

Configuration

LinuxGSM’s config uses layered files in lgsm/config-lgsm/vhserver/:

  • _default.cfg: defaults (don’t edit; it’s overwritten on updates);
  • common.cfg: your settings for all instances of this game;
  • vhserver.cfg: settings for this instance.

Copy the variables you want to change from _default.cfg into vhserver.cfg:

servername="Our Viking Server"
serverpassword="secret-pass"
port="2456"
gameworld="Midgard"
public="1"

Game-specific config files (for example server.cfg, serverconfig.xml) are in the server files directory. details shows their paths.

Automate with cron

crontab -e
*/5 * * * * /home/vhserver/vhserver monitor > /dev/null 2>&1
*/30 * * * * /home/vhserver/vhserver update > /dev/null 2>&1
0 5 * * *   /home/vhserver/vhserver restart > /dev/null 2>&1
30 4 * * *  /home/vhserver/vhserver backup > /dev/null 2>&1
0 0 * * 0   /home/vhserver/vhserver update-lgsm > /dev/null 2>&1
  • monitor every 5 minutes restarts crashed servers.
  • update checks for game updates, and restarts if one was applied.
  • To start on boot, add @reboot /home/vhserver/vhserver start > /dev/null 2>&1.

See crontab.

Backups

./vhserver backup writes archives to ~/lgsm/backup/. Set maxbackups and maxbackupdays in your config to limit retention, and copy the archives off the server (rsync, rclone, or a backup tool). See backup strategy.

Alerts

Enable alerts in common.cfg, for example Discord:

discordalert="on"
discordwebhook="https://discord.com/api/webhooks/…"

Test with ./vhserver test-alert. You’ll get messages when the monitor restarts a crashed server, or when an update is installed.

Multiple servers

Run a second instance of the same game by copying the script under a new name (cp vhserver vhserver-2), and setting a different port in vhserver-2.cfg. Or use separate users for full isolation.

Quick reference

Item Value
Install bash linuxgsm.sh <gameserver> → ./<gameserver> install
Console ./<gameserver> console (tmux)
Instance config lgsm/config-lgsm/<gameserver>/<gameserver>.cfg
Backups lgsm/backup/
Automation cron: monitor, update, backup

Related: game server VPS and Pterodactyl panel.

  • Game Server
  • Linux
  • SteamCMD