How to Set Up a Terraria Server with tModLoader
Run a modded Terraria server with tModLoader: SteamCMD install, enabling mods like Calamity, matching mod lists across players, and a persistent systemd service.
Vanilla Terraria multiplayer is great, but tModLoader is what unlocks the big content mods โ Calamity, Thorium, and hundreds more. This guide sets up a modded Terraria server with tModLoader on a Linux VPS, gets the mod list matching across players, and keeps it running as a service.
What you need
- A Linux VPS: Ubuntu 22.04/24.04. Vanilla Terraria is tiny (1โ2 GB); a modded tModLoader server wants 4โ8 GB RAM depending on the mod pack.
- Open port: TCP 7777 (Terraria's default).
Step 1: Create a user and install dependencies
sudo adduser --disabled-password --gecos "" terraria
sudo dpkg --add-architecture i386
sudo apt update
sudo apt install -y lib32gcc-s1 steamcmd
Step 2: Install tModLoader with SteamCMD
tModLoader (which includes the dedicated server) is App ID 1281930 and is cross-platform:
sudo su - terraria
steamcmd +force_install_dir /home/terraria/server +login anonymous +app_update 1281930 validate +quit
{{SCREENSHOT}}
Step 3: Open the firewall
sudo ufw allow 7777/tcp
sudo ufw reload
Open TCP 7777 on any provider firewall as well.
Step 4: Choose and enable mods
tModLoader reads an enabled.json list of mods to load. The cleanest workflow is to set up your mod list once in the tModLoader client, then export it:
- In single-player tModLoader, open Workshop โ Mod Packs, enable the mods you want (e.g. Calamity, Thorium), and save a mod pack.
- Copy the resulting
enabled.jsonand the mod files to the server's mods folder (typically~/.local/share/Terraria/tModLoader/Mods/).
Alternatively, place the .tmod files in the server's Mods folder and list them in enabled.json. The golden rule: every player must have the exact same mods and versions as the server, or they can't connect.
Step 5: Configure and start the server
tModLoader ships a serverconfig.txt where you set the world, port, password, and max players:
world=/home/terraria/.local/share/Terraria/tModLoader/Worlds/myworld.wld
autocreate=3
worldname=MyModdedWorld
difficulty=1
maxplayers=8
port=7777
password=CHANGE_ME
Create /home/terraria/start.sh:
#!/bin/bash
cd /home/terraria/server
./start-tModLoaderServer.sh -config /home/terraria/serverconfig.txt -nosteam
chmod +x /home/terraria/start.sh
Step 6: Run it as a systemd service
# /etc/systemd/system/terraria.service
[Unit]
Description=tModLoader Terraria Server
After=network-online.target
[Service]
Type=simple
User=terraria
ExecStart=/home/terraria/start.sh
Restart=on-failure
RestartSec=10
[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl enable --now terraria
sudo journalctl -u terraria -f
For a vanilla (unmodded) server, the same firewall and service pattern applies โ you just run the standard Terraria server instead. If you only want vanilla, see how to set up a Terraria dedicated server.
Back up your world (and common gotchas)
Your world file is a single .wld under the Worlds folder โ easy to lose and easy to back up. Snapshot it regularly, especially before installing or updating mods, since a bad mod load can corrupt progress:
# nightly world backup, keep a week
0 4 * * * tar -czf /home/terraria/backups/tw-$(date +\%F).tar.gz /home/terraria/.local/share/Terraria/tModLoader/Worlds && find /home/terraria/backups -name 'tw-*' -mtime +7 -delete
Two problems trip people up most: a mod version mismatch (the server rejects clients whose mods differ even slightly), and a world generated with a mod that's later removed (some content becomes inaccessible). Keep everyone's mod pack identical, and keep those backups. For a fuller routine, see how to back up your game server automatically.
FAQ
Do all players need the same mods as a tModLoader server?
Yes โ exactly the same mods and versions. tModLoader checks the mod list on connect and refuses mismatched clients. Share your mod pack so everyone loads identical mods.
What port does a Terraria server use?
TCP 7777 by default for both vanilla and tModLoader. Open it on the OS firewall and any provider firewall.
How much RAM does a modded Terraria server need?
4โ8 GB depending on the mod pack. Big content mods like Calamity plus multiple players push toward the higher end; vanilla needs only 1โ2 GB.
How do I install Calamity on my server?
Download Calamity (and its dependencies) via tModLoader's Workshop, enable them in a mod pack, and copy the .tmod files plus enabled.json to the server's Mods folder. Then restart the server.
Modded Terraria is light enough for a budget box โ compare plans on our pricing page or launch on game server hosting.