Manage gets a Backup section (between World and Logs) listing the server's automatic and manual backups. Rolling back is only allowed while the server is stopped and nothing else, such as an automatic backup, is running on it; the server claims the busy flag atomically so the two can't race. A run players were on is backed up first. The new world is extracted to a staging folder and checked before the old one is deleted. The backup that holds the world as it is now is marked Current (its button is disabled, and the Backups page tags it). It's tracked in backups/<game>/<container>.current: set by automatic backups and rollbacks, none while players have been on, newest automatic backup when there's no record. Rolling back to an automatic backup can keep the Current backup as a manual one (or make one if nothing is current), warning when that pushes out the oldest of 5 manual backups. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|---|---|---|
| app | ||
| caddy | ||
| .gitignore | ||
| CLAUDE.md | ||
| deploy.sh | ||
| install.sh | ||
| README.md | ||
Game server manager
A small web app for running dedicated game servers on your own Linux server or VPS. You can create, start, stop and configure servers from a browser, see who's playing, stop idle servers automatically and keep world backups.
Supported games: Valheim and Project Zomboid (Build 42, with a Workshop mod picker).
Install
On your server, as root (or with sudo), run:
curl -fsSL https://git.neilbantoc.dev/pub/game-servers/raw/branch/main/install.sh | sudo bash
When it finishes, it prints the web address (https://<your server's IP>) and the login password.
The installer:
- checks the machine first (Linux, root, free ports 443 and 8080, RAM, disk space) and stops with a clear message if something is wrong;
- installs
curl,tar,iproute2and Docker if they're missing (Docker via get.docker.com); - runs the manager in a Docker container named
gsm, with Caddy in front of it (containercaddy) for HTTPS. Caddy gets a free Let's Encrypt certificate for your server's IP address, so you don't need a domain name; - keeps its files in
/opt/gsmand game data in/srv/gameservers.
Options
Set these before bash, after sudo:
curl -fsSL https://git.neilbantoc.dev/pub/game-servers/raw/branch/main/install.sh | sudo SITE=games.example.com ADMIN_PASSWORD=hunter22 bash
| Variable | Meaning |
|---|---|
SITE |
Address for the web UI: a domain pointing at the server, or its public IP. Default: the server's public IPv4 |
ADMIN_PASSWORD |
Web UI password, set on first install. Default: random, printed at the end |
GSM_REF |
Branch or tag to install. Default: main |
SKIP_DOCKER_INSTALL=1 |
Stop with an error if Docker is missing instead of installing it |
Requirements
- A Linux server with a public IPv4 address. It must be x86_64, because the game images are built for it.
- Enough RAM for the games you want: about 1.5 GB per Valheim server, 3 GB or more per Project Zomboid server.
- Inbound ports open in your provider's firewall:
- TCP 443 for the web UI, and 80 if it's free (redirects to https);
- UDP for each game server: two ports each, from 2456 for Valheim and from 16261 for Project Zomboid.
The installer opens the web ports in
ufwif it's active. Docker opens the game ports itself.
Update
Run the install command again. It downloads the latest version and restarts the manager. Your password, settings, game servers and worlds are kept. Running game servers keep running.
Change the password
Edit ADMIN_PASSWORD in /opt/gsm/.env, then run the install command again.
Uninstall
docker rm -f gsm caddy
docker rm -f $(docker ps -aq --filter label=gsm.managed=true) # the game servers
rm -rf /opt/gsm
rm -rf /srv/gameservers # worlds and backups: only if you're sure
Security notes
The manager controls Docker on the host (it mounts /var/run/docker.sock), which amounts to root access.
Anyone with the web password can create and delete game servers and their worlds, so use a strong
password.
Development
app/ is the FastAPI backend and a plain JavaScript frontend (app/static/). To deploy a local checkout,
including uncommitted changes, to a server you can SSH into as root:
HOST=root@<server> ./deploy.sh
This copies the code to /opt/gsm/src on the server and runs install.sh from there.