A headless server management toolkit for tModLoader with Steam Workshop integration, automated backups, world management, mod config editing, and diagnostics β all driven from a single interactive CLI menu.
~/servers/tmodloader/ βββ Engine/ # tModLoader server files (managed by SteamCMD) βββ Mods/ # Installed .tmod files + enabled.json βββ Worlds/ # World save files βββ ModConfigs/ # Per-mod config files (JSON, TOML, etc.) βββ Configs/ # serverconfig.txt, workshop_map.json βββ Backups/ # Automated backup storage β βββ Worlds/ β βββ Configs/ β βββ Full/ βββ Logs/ # All script and server logs βββ Scripts/ βββ core/ # tmod-core.sh, tmod-server.sh, tmod-monitor.sh βββ hub/ # tmod-control.sh β main entry point βββ backup/ # tmod-backup.sh βββ steam/ # tmod-workshop.sh, tmod-deps.sh, mod_ids.txt βββ diag/ # tmod-diagnostics.sh Debian / Ubuntu
sudo apt update -y sudo apt install -y git screen curl jq pigz rsync unzip htop ncdu net-tools dos2unixFedora / RHEL / CentOS (untested β community contributions welcome)
sudo dnf install -y git screen curl jq pigz rsync unzip htop ncdu net-tools dos2unixNote:
pigzanddos2unixmay require the EPEL repository on RHEL/CentOS.
Debian / Ubuntu
sudo dpkg --add-architecture i386 sudo apt update -y sudo apt install -y steamcmdFedora / RHEL / all others (manual install) (untested β community contributions welcome)
mkdir -p ~/servers/steam/SteamCMD curl -sqL "https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz" \ | tar -xzf - -C ~/servers/steam/SteamCMDIf using the manual install, update
steamcmd_pathinConfigs/serverconfig.txtto match your install path.
steamcmd \ +force_install_dir ~/servers/tmodloader/Engine \ +login anonymous \ +app_update 1281930 validate \ +quitNo manual installation needed. On first server start the scripts automatically:
- Read the required .NET version from
Engine/tModLoader.runtimeconfig.json - Run tModLoader's bundled
Engine/LaunchUtils/InstallDotNet.sh - Install the correct runtime into
Engine/dotnet/
Install progress is logged to Logs/dotnet-install.log. If the install fails, check that file for details.
After cloning, run once to create required directories, copy example configs, and set script permissions:
make setupThen edit Configs/serverconfig.txt β at minimum set steamcmd_path to match your SteamCMD install location.
All management goes through Scripts/hub/tmod-control.sh. Run with no arguments to open the interactive menu:
./Scripts/hub/tmod-control.sh # or from the hub directory: ./tmod-control.sh # with debug logging to terminal: ./tmod-control.sh --debugEvery page shows a live status bar with server state, uptime, player count, mod count, active world, folder sizes, and disk usage.
| # | Section | Description |
|---|---|---|
| 1 | Server | Start, stop, restart, status, world management |
| 2 | Mods | Add, enable/disable, mod configs, workshop tools |
| 3 | Monitoring | Dashboard, live log tail, console attach |
| 4 | Backup | Create, restore, verify, cleanup |
| 5 | Maintenance | Diagnostics, update engine, emergency shutdown |
| # | Option |
|---|---|
| 1 | Show Status |
| 2 | Start Server |
| 3 | Stop Server |
| 4 | Restart Server |
| 5 | Select Active World |
| 6 | Start with World Select |
| 7 | Create New World |
| 8 | Import World (from uploaded .wld file) |
Select World β lists all .wld files with size, last modified, and marks the currently active world. Updates serverconfig.txt automatically.
Create New World β generates a world headlessly via tModLoader's -autocreate. Prompts for name, size, difficulty, and seed.
Import World β paste the path to a pre-uploaded .wld file. Copies it into Worlds/, optionally renames it, sets it as active, and optionally starts the server.
| # | Option |
|---|---|
| 1 | Add Mod by URL or ID |
| 2 | Show mod_ids.txt |
| 3 | Clear mod_ids.txt |
| 4 | Mod Picker (interactive toggle) |
| 5 | Enable a Mod |
| 6 | Disable a Mod |
| 7 | List Mods (enabled/disabled) |
| 8 | List Installed Mods |
| 9 | Check for Errors |
| 10 | Workshop Status |
| 11 | List Workshop Downloads |
| 12 | Archive Old Versions |
| 13 | Cleanup Downloads |
| 14 | Mod Configs (edit per-mod settings) |
Add Mod by URL or ID β paste one or more Steam Workshop URLs (including concatenated multi-URL strings). Automatically extracts all ?id= values, adds them to mod_ids.txt, and optionally downloads + syncs immediately.
Mod Configs β scans ModConfigs/ and any mod-created subdirectories (e.g. TerrariaOverhaul/) for config files. Select one to open in nano.
| # | Option |
|---|---|
| 1 | Backup Status |
| 2 | World Backup |
| 3 | Config Backup |
| 4 | Full Server Backup |
| 5 | Auto Backup (all three) |
| 6 | List Backups |
| 7 | Restore from Backup |
| 8 | Verify a Backup |
| 9 | Cleanup Old Backups |
| 10 | View Backup Log |
Restore and Verify use an inline file picker that scans all backup subdirectories.
| # | Option |
|---|---|
| 1 | Status Dashboard |
| 2 | Health Check |
| 3 | Live Monitor (continuous) |
| 4 | Follow Server Log (tail -f) |
| 5 | View Server Log (last 50) |
| 6 | View Monitor Log |
| 7 | View Control Log |
| 8 | Attach to Server Console |
serverconfig.txt is not tracked in git (machine-specific paths). A clean template is provided:
cp Configs/serverconfig.example.txt Configs/serverconfig.txtThen edit serverconfig.txt for your machine. The world= and worldname= keys are managed automatically by the world picker β leave them commented out initially. The tmod-scripts section at the bottom holds script-specific settings:
# βββ tmod-scripts βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ steamcmd_path=~/servers/steam/SteamCMD/steamcmd.sh log_max_size=10M # Rotate logs larger than this (e.g. 5M, 10M, 50M) log_keep_days=14 # Delete compressed old logs after this many daysPaths support ~/ expansion.
Sensitive values (STEAM_API_KEY, STEAM_USERNAME) should be exported from ~/.bashrc_secrets or equivalent β not stored in any tracked file.
mod_ids.txt is not tracked in git (personal mod list). A clean template is provided:
cp Scripts/steam/mod_ids.example.txt Scripts/steam/mod_ids.txtThen add your Workshop URLs or numeric IDs β one per line. Managed via the menu (Mods β Add Mod by URL or ID) or edited directly. Lines starting with # are ignored.
Optional at Configs/workshop_map.json. Maps mod names to Workshop IDs for use by tmod-deps.sh:
{ "MyMod": "1234567890" }./Scripts/diag/tmod-diagnostics.sh full # Full system check ./Scripts/diag/tmod-diagnostics.sh quick # Fast essential checks ./Scripts/diag/tmod-diagnostics.sh binaries # Check tModLoader binary ./Scripts/diag/tmod-diagnostics.sh config # Check config files ./Scripts/diag/tmod-diagnostics.sh fix # Auto-fix common issues ./Scripts/diag/tmod-diagnostics.sh report # Generate shareable report# Server ./tmod-control.sh start ./tmod-control.sh stop ./tmod-control.sh restart ./tmod-control.sh status # Backup ./tmod-control.sh backup worlds ./tmod-control.sh backup configs ./tmod-control.sh backup full ./tmod-control.sh backup auto # Monitoring ./tmod-control.sh monitor status ./tmod-control.sh monitor start ./tmod-control.sh monitor logs # Workshop ./tmod-control.sh workshop download ./tmod-control.sh workshop sync ./tmod-control.sh workshop list ./tmod-control.sh workshop archive ./tmod-control.sh workshop cleanupMenu & UX
- Removed obsolete Download Mods and Sync Mods menu items β superseded by URLβ
enabled.jsonsystem - Restructured all 5 menu pages for better headless-server UX flow
- Monitoring page expanded from 4 to 8 items: Status Dashboard, Health Check, Live Monitor, Follow Server Log (
tail -f), View Server/Monitor/Control Logs, Attach to Server Console (screen -r) - Backup page expanded from 4 to 10 items: inline restore and verify file pickers, config/full/auto backups, cleanup, log view
- Mods page: added Mod Configs editor (item 14) β browses
ModConfigs/and mod subdirs, opens selected file innano - Server page: added Import World (item 8) β copy a pre-uploaded
.wld, rename, set active, optionally start
Logging
log_itandlog_controlnow write to file only by default β no terminal noise for INFO messages- WARN / ERROR / CRITICAL always print to terminal
--debugflag exportsTMOD_DEBUG=1to all child scripts, enabling full verbose output
Configuration
- Directories renamed to match tModLoader convention:
Engine/,Configs/,Logs/,Backups/,Scripts/ - Backup subdirectories capitalised:
Backups/Worlds/,Backups/Configs/,Backups/Full/ STEAMCMD_PATHmoved from.envtoserverconfig.txt(steamcmd_path=)- Log rotation thresholds now configurable in
serverconfig.txt(log_max_size,log_keep_days) rotate_logs()improved: timestamped rolling archives,worldgen.logexcludedserver_config_get()helper added to core for reading script settings fromserverconfig.txt
Cleanup
- Whitelist system removed β player management is better handled by in-game admin mods
- Secrets (
STEAM_API_KEY,STEAM_USERNAME) moved to~/.bashrc_secrets *.bakfiles excluded from gitScripts/steam/mod_ids.txtnow gitignored (personal mod list);mod_ids.example.txtadded as tracked templatecreate_example_mod_ids_file()copies frommod_ids.example.txtwhen bootstrapping a fresh install
Issues, feature requests, and pull requests are welcome.
Apache 2.0 β see LICENSE for details.