Gaming Servers

tModLoader (Terraria Mods)

Install and configure a tModLoader dedicated server for modded Terraria multiplayer on Linux

tModLoader is the official Terraria modding platform, maintained by the Terraria developers. It lets you run a dedicated server with mods from the Steam Workshop or manually installed .tmod files.

Requirements

  • Ubuntu 22.04 / Debian 12 (64-bit)
  • 2 GB RAM (4 GB recommended with heavy mods)
  • 5 GB disk space (more with mods)
  • Port 7777 TCP

Create a dedicated user

sudo useradd -m -s /bin/bash terraria
sudo su - terraria
mkdir -p /home/terraria/server
cd /home/terraria/server

Install tModLoader

Download the latest release from GitHub:

# Check latest version at https://github.com/tModLoader/tModLoader/releases
TML_VERSION="v2024.09"
wget "https://github.com/tModLoader/tModLoader/releases/download/${TML_VERSION}/tModLoader.zip"
unzip tModLoader.zip -d /home/terraria/server/
chmod +x /home/terraria/server/tModLoaderServer
rm tModLoader.zip

Install .NET runtime (required)

exit
sudo apt install dotnet-runtime-8.0 -y
sudo su - terraria

Create a server config file

nano /home/terraria/server/serverconfig.txt
world=/home/terraria/.local/share/Terraria/tModLoader/Worlds/MyWorld.wld
worldname=MyWorld
autocreate=3
seed=
difficulty=0
maxplayers=8
port=7777
password=
motd=Welcome to the server!
worldpath=/home/terraria/.local/share/Terraria/tModLoader/Worlds/
npcstream=60
priority=1

World size (autocreate):

  • 1 = Small
  • 2 = Medium
  • 3 = Large

Difficulty (difficulty):

  • 0 = Classic
  • 1 = Expert
  • 2 = Master
  • 3 = Journey

Start the server (first run)

/home/terraria/server/tModLoaderServer -config /home/terraria/server/serverconfig.txt

On first run it will create the world. This takes a few minutes. Once running, press Ctrl+C to stop it.


Run as systemd service

exit
sudo nano /etc/systemd/system/tmodloader.service
[Unit]
Description=tModLoader Terraria Server
After=network.target

[Service]
Type=simple
User=terraria
WorkingDirectory=/home/terraria/server
ExecStart=/home/terraria/server/tModLoaderServer -config /home/terraria/server/serverconfig.txt
Restart=on-failure
RestartSec=10s

[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl enable tmodloader
sudo systemctl start tmodloader
sudo systemctl status tmodloader

Firewall

sudo ufw allow 7777/tcp

Install mods

Method 1: Steam Workshop (via SteamCMD)

# Install SteamCMD
sudo apt install steamcmd -y

# Download a mod (get Workshop ID from the mod page URL)
steamcmd +login anonymous +workshop_download_item 1281930 MOD_ID +quit
# 1281930 is Terraria's Steam App ID

Copy the downloaded mod to the tModLoader mods folder:

mkdir -p /home/terraria/.local/share/Terraria/tModLoader/Mods/
cp ~/.steam/steam/steamapps/workshop/content/1281930/MOD_ID/*.tmod \
   /home/terraria/.local/share/Terraria/tModLoader/Mods/

Method 2: Manual .tmod files

Download .tmod files from Mod Browser or the mod's GitHub, then:

cp mymod.tmod /home/terraria/.local/share/Terraria/tModLoader/Mods/

Enable mods

Create or edit the enabled mods list:

nano /home/terraria/.local/share/Terraria/tModLoader/Mods/enabled.json
[
  "CalamityMod",
  "ThoriumMod",
  "ImprovedTorches"
]

The names must match the .tmod filenames (without extension). Restart the server to load mods.


ModDescription
Calamity ModMassive content expansion with 1800+ items
Thorium ModLarge content mod with 3 new classes
Magic StorageCentralized storage system
Boss ChecklistTracks boss progression
Fargo's Mutant ModNPC upgrades and quality of life
Improved TorchesBetter torch mechanics

Server commands (in console)

CommandDescription
helpList all commands
playersList connected players
kick <player>Kick a player
ban <player>Ban a player
say <message>Broadcast message
saveSave the world
exitShut down the server
exit-nosaveShut down without saving

Update tModLoader

sudo systemctl stop tmodloader

# Download new version
sudo -u terraria bash -c '
  TML_VERSION="v2024.09"
  cd /home/terraria/server
  wget "https://github.com/tModLoader/tModLoader/releases/download/${TML_VERSION}/tModLoader.zip"
  unzip -o tModLoader.zip
  rm tModLoader.zip
  chmod +x tModLoaderServer
'

sudo systemctl start tmodloader

When updating tModLoader, all mods must also be updated to be compatible with the new version. Check mod compatibility before updating a live server.


Logs

journalctl -u tmodloader -f

On this page