Terraria 1.4 tModLoader Server Notes

My use case is simply hosting a very simple private modded server on Ubuntu. The tutorials and included instructions are mostly good, but I wanted to share the solutions to the issues I had…

To Play: tModLoader is pretty slick and user friendly from this side. Just find it in the games section of the steam store. You have to own Terraria already of course. Mods are in tModLoader’s workshop or through the in-game mod browser. I did find that the mod browser failed to connect often, so I had to reopen it a few times. Small gripe.

Firstly, I followed the instructions here for getting and setting up a dedicated server. I’ll just be making my corrections to that below. Here’s the tutorial for SteamCMD for support and updating the loader and mods. I’ll leave it to someone else to post info on Docker and fancier server control options.

The first steps say to extract to “/home/<user>/.local/share/Steam/tmod”. This threw me off in later steps. Doing this is technically fine, but your world saves will be in “/home/<user>/.local/share/Steam/tModLoader” unless you specify differently in the serverconfig or commandline arg. Personally, I’m fine keeping the server and it’s saves all together in tModLoader.

Prepare the Server: It says to change the modpath config in serverconfig.txt. This setting isn’t in the file and doesn’t need to be added. Ignore this. Some text editors on linux might complain about the file not being UTF-8 valid. In that case, select a different encoding like ISO-8859-14 or WINDOWS-1253, or whatever. If you use autocreate or want to auto-load the same world every time, than enable and configure all defaults. Sadly, if you want to pick the world on load, settings for port, players, password, etc won’t apply. The only setting I’m bothering with is “npcstream=6”. This helps with obnoxious teleporting mobs. The instructions suggest 2-6, but the default is 60? Seems extreme but whatever.

Getting Mods on the Server: Making a mod pack is easy enough in game. Optionally, you can preconfigure the mods and copy over the config files (assuming the mod is properly configurable). In Windows, making a mod pack puts a pack folder in BOTH “Documents\My Games\Terraria\tModLoader\Mods\ModPacks” and “Program Files (x86)\Steam\steamapps\common\tModLoader”. Annoyingly, mod config files are only saved in the 2nd location. Copy over that folder to the server if you like. From the Mods folder you only need enabled.json and install.txt. Ignore the tmod files.

The Mod Problem: Back on the dedicated server side copy “enabled.json” to “/home/<user>/.local/share/Terraria/tModLoader/Mods/”. This folder is next to your default save location and will probably not exist if the server hasn’t been run yet. Make it. Next, go to “/home/<user>/.local/share/Terraria/tModLoader/DedicatedServerUtils” or wherever you put your tmod folder from the first step. Put your mod pack’s install.txt here. The instructions.txt file is helpful, but misleading. Setup_tModLoaderServer.sh has a file path typo (might get fixed). No matter your folder setup it will NOT work properly. Open it in a text editor and delete tmod from line 1 AND line 5. Save and exit. Make the script executable. This will make the script place downloaded mods from Steam in “steamapps” (one folder up) which is where the server looks for them by default. I renamed the “DedicatedServerUtils” folder to “Update” so the edited script doesn’t get overwritten if I manually update tModLoader. Finally run “./Setup_tModLoaderServer.sh”.

Convenient Server Launching: Since I control the server through PuTTY, I made simple “shortcut” scripts in my user folder. Don’t forget to get your file permissions right, make all involved scripts executable, and type ./ before the file name when launching. The usual Linux things. The starting script could be “screen -S tModLoader /home//.local/share/Steam/tModLoader/start-tModLoaderServer.sh -config serverconfig.txt”. HOWEVER, I noticed all tModLoaderServer.sh does ask you if you want steam server support (steam friends list etc), then launch another script with extra arguments. I skip this script and pass the args myself, leaving steam server off. My “tmodstart” script is “screen -S tModLoader /home/<user>/.local/share/Steam/tModLoader/LaunchUtils/ScriptCaller.sh -server -config serverconfig.txt”. Simple.

You’ll want to keep your mods up to date as well. My “tmodupdate” script is
cd /home/<user>/.local/share/Steam/tModLoader/Update
./Setup_tModLoaderServer.sh”.
Make sure to turn the server off before you run the update script. :stuck_out_tongue:

1 Like