tModLoader is essentially a mod that provides a way to load your own mods without having to work directly with Terraria's source code itself. This means you can easily make mods that are compatible with other people's mods, save yourself the trouble of having to decompile and recompile Terraria.exe, and escape from having to understand all of the obscure "intricacies" of Terraria's source code. It is made to work for Terraria 1.3+.
tModLoader is essentially a mod that provides a way to load your own mods without having to work directly with Terraria's source code itself. This means you can easily make mods that are compatible with other people's mods, save yourself the trouble of having to decompile and recompile Terraria.exe, and escape from having to understand all of the obscure "intricacies" of Terraria's source code. It is made to work for Terraria 1.3+.
Due to rate limiting the console on the panel cannot keep up with the game console and the build will complete before the panel console may show it. Reloading the console will load it to the latest part of the log.
You may want to assign a minimum of 768 mb of RAM to a server as it will use around 650 mb to generate the world on the first start.
tModloader, like Terraria, only requires a single port to run. The default is 7777
Port | default |
---|---|
Game | 7777 |
If you want to download mods in the console, the startup command has to be changed.
New startup:
./tModLoaderServer -ip 0.0.0.0 -port ${SERVER_PORT} -maxplayers ${MAX_PLAYERS} -savedirectory ~/ -tmlsavedirectory ~/saves -modpath ~/mods
This will remove the autocreate function, and will thus allow you to download mods and generate world. Afterwards, you can change it back with the correct world name to start automatic. Word name is set in the configuration panel.
Name | Tag |
---|---|
Dotnet 8 | ghcr.io/ptero-eggs/yolks:dotnet_8 |
Dotnet 6 | ghcr.io/ptero-eggs/yolks:dotnet_6 |
Name | Description | Environment Variable | Default Value | User Viewable | User Editable |
---|---|---|---|---|---|
World Name | The name for the world file. | WORLD_NAME | world | Yes | Yes |
Max Players | The maximum number of players a server will hold. | MAX_PLAYERS | 8 | Yes | No |
World Size | Defines the worlds size. 3 sizes 1 (small), 2 (medium), 3 (large). | WORLD_SIZE | 1 | Yes | Yes |
tModloader Version | The version of tModloader that is to be used. | VERSION | latest | Yes | Yes |
GitHub User | GitHub user to use for api calls. This only needs to be set if you hit the GitHub API too often across multiple servers. | GITHUB_USER | No | No | |
GitHub OAuth Token | This can be either an OAuth or a Personal Access Token. This is required for the install is you set a user. | GITHUB_OAUTH_TOKEN | No | No | |
Difficulty | Sets the difficulty of the world when using auto-create. Options: 0(normal), 1(expert), 2(master), 3(journey) | DIFFICULTY | 0 | Yes | Yes |
Server Password | Server password for users to connect to your server. Can be empty for no password. | SERVER_PASSWORD | Yes | Yes | |
MOTD | Message of the Day for the server | MOTD | Please don’t cut the purple trees! | Yes | Yes |
Language | Sets the server language 1:English, 2:German, 3:Italian, 4:French, 5:Spanish | LANGUAGE | 1 | Yes | Yes |
#!/bin/bash
# Vanilla tModloader Installation Script
#
# Server Files: /mnt/server
## install packages to get version and download links
apt update
apt install -y file
if [ -z "$GITHUB_USER" ] && [ -z "$GITHUB_OAUTH_TOKEN" ] ; then
echo -e "using anon api call"
else
echo -e "user and oauth token set"
alias curl='curl -u $GITHUB_USER:$GITHUB_OAUTH_TOKEN '
fi
## get release info and download links
LATEST_JSON=$(curl --silent "https://api.github.com/repos/tmodloader/tmodloader/releases" | jq -c '.[]' | head -1)
RELEASES=$(curl --silent "https://api.github.com/repos/tmodloader/tmodloader/releases" | jq '.[]')
if [ -z "$VERSION" ] || [ "$VERSION" == "latest" ]; then
echo -e "defaulting to latest release"
DOWNLOAD_LINK=$(echo $LATEST_JSON | jq .assets | jq -r .[].browser_download_url | grep -i tmodloader.zip)
else
VERSION_CHECK=$(echo $RELEASES | jq -r --arg VERSION "$VERSION" '. | select(.tag_name==$VERSION) | .tag_name')
if [ "$VERSION" == "$VERSION_CHECK" ]; then
if [[ "$VERSION" == v0* ]]; then
DOWNLOAD_LINK=$(echo $RELEASES | jq -r --arg VERSION "$VERSION" '. | select(.tag_name==$VERSION) | .assets[].browser_download_url' | grep -i linux | grep -i zip)
else
DOWNLOAD_LINK=$(echo $RELEASES | jq -r --arg VERSION "$VERSION" '. | select(.tag_name==$VERSION) | .assets[].browser_download_url' | grep -i tmodloader.zip)
fi
else
echo -e "defaulting to latest release"
DOWNLOAD_LINK=$(echo $LATEST_JSON | jq .assets | jq -r .[].browser_download_url | grep -i tmodloader.zip)
fi
fi
## mkdir and cd to /mnt/server/
mkdir -p /mnt/server
cd /mnt/server || exit 5
## download release
echo -e "running: curl -sSL ${DOWNLOAD_LINK} -o ${DOWNLOAD_LINK##*/}"
curl -sSL ${DOWNLOAD_LINK} -o ${DOWNLOAD_LINK##*/}
FILETYPE=$(file -F ',' ${DOWNLOAD_LINK##*/} | cut -d',' -f2 | cut -d' ' -f2)
if [ "$FILETYPE" == "gzip" ]; then
tar xzvf ${DOWNLOAD_LINK##*/}
elif [ "$FILETYPE" == "Zip" ]; then
unzip -o ${DOWNLOAD_LINK##*/}
else
echo -e "unknown filetype. Exiting"
exit 2
fi
if [[ "$VERSION" == v0* ]]; then
chmod +x tModLoaderServer.bin.x86_64
chmod +x tModLoaderServer
else
#tiny startup script for backward compatibility
echo 'dotnet tModLoader.dll -server "$@"' > tModLoaderServer
chmod +x tModLoaderServer
fi
echo -e "Cleaning up extra files."
rm -rf terraria-server-*.zip rm ${DOWNLOAD_LINK##*/}
if [[ "$VERSION" != v0* ]]; then
rm -rf DedicatedServerUtils LaunchUtils PlatformVariantLibs tModPorter RecentGitHubCommits.txt *.bat *.sh
fi
## using config for difficulty as the startup parameter does not work -> config parser
mv /mnt/server/serverconfig.txt /mnt/server/config.txt
sed 's/#difficulty/difficulty/' /mnt/server/config.txt > /mnt/server/serverconfig.txt
rm /mnt/server/config.txt
## install end
echo "-----------------------------------------"
echo "Installation completed..."
echo "-----------------------------------------"