Easy to setup tModLoader server using docker with automatic backups.
- Clone repository
git clone https://github.com/cubebuc/tmodloader-docker.git- Change directory
cd tmodloader-docker- Launch detached using docker compose
docker-compose up -d- Attach to tModLoader container
docker attach tml- press ENTER after attaching
Now you can create/delete/start worlds and configure mods using the terminal.
To detach from the container press Ctrl + P + Q.
To shutdown the docker use:
docker-compose downYou can directly edit the serverconfig.txt file - it will be used for the server if present.
Paths start with /app/data, because that is where root repo folder is mapped in docker volumes.
Backups are setup using cron and save into backups/ folder (generates after first backup).
By default there are hourly and daily backups (keeping 3 and 2 last backups respectively).
You can edit the crontab file to customize them.
Example:
0 * * * * /app/data/backup.sh hourly 30 * * * *→ cron timing syntax/app/data/backup.sh→ backup script - do NOT changehourly→ subfolder name under backups3→ number of backups to keep in this folder
To add mods, copy the .tmod files directly into tModLoader/Mods folder (generated after first start).
- Add Better Autosave mod - by default it saves the world only once per Terraria day.
- Specifying
worldin theserverconfig.txtdisables interactive mode and starts the server directly (omitting it starts interactive mode).