Skip to content

Latest commit

 

History

History
96 lines (77 loc) · 2.46 KB

File metadata and controls

96 lines (77 loc) · 2.46 KB

tmodloader-docker

Easy to setup tModLoader server using docker with automatic backups.

Setup

  1. Clone repository
git clone https://github.com/cubebuc/tmodloader-docker.git
  1. Change directory
cd tmodloader-docker
  1. Launch detached using docker compose
docker compose up -d
  1. 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 down

Configure

serverconfig.txt

You 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

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 3
  • 0 * * * * → cron timing syntax
  • /app/data/backup.sh → backup script - do NOT change
  • hourly → subfolder name under backups
  • 3 → number of backups to keep in this folder

Updating

To avoid mod incompatibilities updating is done manually, following these simple steps:

  1. Shutdown the Docker
docker compose down
  1. Update the TML_VERSION
export TML_VERSION=v2xxx.y.z

where v.2xxx.y.z is the target version

  1. Re-Build the Docker
docker compose build --no-cache
  1. Re-Launch your Docker
docker compose up -d

Mods

To add mods, copy the .tmod files directly into tModLoader/Mods folder (generated after first start).

Recommendations

  • By default the tModLoader and backup folders are going to be owned by root. You can make them user owned by uncommenting the user line in docker-compose.yml and chown line in backup.sh. Don't forget to change the ids to match your user and reset docker.
  • Add Better Autosave mod - by default it saves the world only once per Terraria day.
  • Specifying world in the serverconfig.txt disables interactive mode and starts the server directly (omitting it starts interactive mode).