|
tModLoader v2023.01
A mod to make and play Terraria mods
|
This directory contains utilities for managing a dedicated Linux server.
While both the Docker container and the management script can install and update tModLoader and any mods, there are a few key differences. Docker isolates tModLoader from your host system and increases security. The management script allows for direct access to your server and increased control as a result. If you are a public server operator or just prefer Docker, then go with the Docker Container, otherwise make use of the management script.
The manage-tModLoaderServer.sh script can be used to install tModLoader either directly from the GitHub release or from SteamCMD. The script is made to run fully standalone, so just download it to your server and run it. No other files from the repo are needed.
./manage-tModLoaderServer.sh --install --username your_steam_username.~/Steam/steamapps/common/tModLoader. To specify an installation directory, use --folder /full/path/from/root./manage-tModLoaderServer.sh --install --github.~/tModLoader. To specify an installation directory, use --folder /path/to/install.Mods will be automatically installed during the tModLoader installation step, but can also be installed separately using the --mods-only argument. Simply place any .tmod files, install.txt for workshop mods, and enabled.json into the same directory as the script. Additionally, you can avoid updating or installing mods with the --no-mods argument.
Because the steam workshop does not use mod names to identify mods, you must create a modpack to install mods from the workshop. To get an install.txt file and its accompanying enabled.json:
Save Enabled as New Mod PackOpen Mod Pack Folder.You can copy enabled.json and install.txt to your script directory and they will be used next time the script is run (run ./manage-tModLoaderServer.sh --mods-only to install mods immediately).
To run tModLoader, you just need to navigate to your install directory (~/tModLoader for GitHub, ~/Steam/steamapps/common/tModLoader for SteamCMD, by default), and run ./start-tModLoaderServer.sh. There is also a --start argument that will launch the game.
If you want to run tModLoader without needing any input on startup (such as from an init system), then all you need to do is copy the example serverconfig.txt and change the settings how you like. Additional options can be found on the Terraria wiki
If an update for manage-tModLoaderServer.sh is available, a message will be printed letting you know one is available. It can be updated using ./manage-tModLoaderServer.sh --update-script. An outdated script may contain bugs or lack features, so it is usually a good idea to update.
When using manage-tModLoaderServer.sh, tModLoader updates can be performed with ./manage-tModLoaderServer.sh --update. When using a GitHub install, use --github. Use--folder if your install is in a non-standard location. Mods will be updated as well.
When using the Docker container, simply rebuild the container using docker-compose build to update tModLoader. Mods will be updated as well.
To install and run the container:
docker and docker-compose are installed. They can be installed from your package manager or Docker's DocumentationTerraria, and place enabled.json, install.txt, serverconfig.txt, your worlds, and any .tmod files inside.docker-compose.yml with your GID and UID. These can be found by running id.docker-compose builddocker-compose upThe server will be available on port 7777.
To run without any interactivity, use docker-compose up -d, and include serverconfig.txt in the Terraria directory.
When using manage-tModLoaderServer.sh, refer to your distro's documentation. You can likely use a startup script with your init system.
When using the Docker container, add restart: always within services.tml inside of docker-compose.yml, then rebuild with docker-compose build.