Docker stuff for a dedicated tModLoader 1.4 server
I do not know how you want your server to run so you need to make sure that it is set up how you want it. This includes your serverconfig.txt, modpack, worlds, and port forwarding.
Depending on your host, find a suitable place to store your server files. Make sure it is safe and accessible. For example: C:\TerrariaServer\ or a Linux equivalent. This will be important later.
docker run -d --name tModLoader1.4 -p 7777:7777 -v (path to server files):/server passivelemon/tmodloader1.4-docker:2022.08.54.4
-d
will run the container in the background.--name tModLoader1.4
will set the name of the container to the following word. You can change this to whatever you want.-p 7777:7777
will open port 7777 which is used by the server. If you use a different port for your server in your serverconfig, change this.(path to server files):/server
is the folder that holds the servers contents. This should be the place you just chose.passivelemon/tmodloader1.4-docker:2022.08.54.4
is my repository on DockerHub. If you want a different version, change the numbers at the end.
The entrypoint.sh will be automatically run upon start. This will download the tModLoader server files and the files in this repo. It will then ask you to add your modpack. Read the next section for help with getting the modpack. You can also add any worlds that you want. Read the following section for help with that.
At this point, you should also fill the serverconfig.txt and make sure the fields are correct or else the server will not function correctly. Details on server config.
In tModLoader on your client, enable any mods that you want to play with. Idealy, you shouldn't include any client side only mods in the modpack folder for the server. Mods are included in the modpack folder.
Go to the mod pack section.
"Save Enabled as New Mod Pack"
"Open Mod Pack folder"
Copy the folder of the modpack you want to use in the server and paste that into (path to server files)/ModPacks/
If you want to transfer a world, keep reading.
Make sure that the mods used on the world are the same as the ones in your modpack.
Assuming a windows host:
Go to C:\Users(your user)\Documents\My Games\Terraria\tModLoader\Worlds\ or the Linux equivalent
Copy the files of the world of your choice to (path to server files)/Worlds/
Refer here for port forwarding
Assuming you did everything correctly, you should have a functional server that will automatically load the modpack and world upon start.
Some mods might have issues with the server when it starts up. This is rare but it happens and I can not do anything about this so you will have to remove that mod or find a work around yourself.
Have fun!