LinuxCommandLibrary

terraria

Run the Terraria server

TLDR

Start an interactive server setup

$ [path/to/TerrariaServer]
copy

Start a Terraria server
$ [path/to/TerrariaServer] -world [path/to/world.wld]
copy

SYNOPSIS

TerrariaServer [options]
or
mono TerrariaServer.exe [options]

PARAMETERS

-port
    Specifies the network port for the server to listen on (default: 7777).

-world
    Sets the path to the .wld file of the world to load. If the path does not exist, a new world will be created based on other parameters.

-maxplayers
    Defines the maximum number of players that can connect to the server (1-255).

-autocreate
    Automatically creates a new world if the specified world does not exist.
: 1 (Small), 2 (Medium), 3 (Large).

-worldname
    Sets the name for a newly autocreated world.

-difficulty
    Sets the difficulty for a newly autocreated world.
: 0 (Journey), 1 (Classic), 2 (Expert), 3 (Master).

-seed
    Sets the world seed for a newly autocreated world.

-password
    Sets a password required for players to join the server.

-config
    Loads server settings from a specified configuration file (e.g., serverconfig.txt).

-secure
    Enables anti-cheat protection for the server.

-banlist
    Specifies the path to the ban list file.

-ip
    Binds the server to a specific IP address on the host machine.

-nologo
    Suppresses the display of the Terraria server logo on startup.

-logpath
    Specifies a directory to store server log files.

-players
    Alias for -maxplayers.

-autoshutdown
    Enables automatic server shutdown when no players are connected for a period.

-help
    Displays a list of available command-line arguments and their descriptions.

DESCRIPTION

The Terraria Dedicated Server is a command-line application used to host multiplayer games of the popular 2D sandbox adventure game, Terraria. Unlike the game client which provides a graphical interface, the dedicated server runs in a console environment, providing stable and persistent game worlds for multiple players to connect to. On Linux, it often runs using the Mono runtime or as a native .NET application. It allows administrators to manage world settings, player connections, and server behavior without needing to run the game client itself. This is the primary "command-line" interaction point for Terraria on Linux, enabling server administrators to automate game world management and provide a reliable multiplayer experience.

CAVEATS

The `terraria` command is not a standard Linux system utility. It refers specifically to the game's dedicated server application. The exact executable name can vary (e.g., TerrariaServer.exe, TerrariaServer.x86_64) depending on the distribution method (Steam, direct download) and whether it's run via Mono or a native .NET runtime. The game client itself, when launched graphically, typically does not accept these command-line parameters for gameplay settings.

CONFIGURATION FILES

Server settings can be permanently stored and loaded from a text file, typically named serverconfig.txt. This file allows for more complex and persistent configurations than command-line arguments alone, including lists of banned players, server messages, and advanced world generation options.

IN-GAME SERVER COMMANDS

Once the server is running, administrators can interact with it directly through its console by typing commands such as save (to save the world), exit (to shut down the server), kick (to remove a player), and ban (to permanently block a player from joining).

HISTORY

Terraria was first released in 2011, with its dedicated server software becoming a crucial component for multiplayer gameplay. Over the years, the server application has evolved alongside the game, receiving updates for new content, bug fixes, and performance improvements. Its cross-platform nature, including support for Linux, has made it a popular choice for hosting persistent game worlds globally, leveraging the stability and efficiency of Linux servers.

SEE ALSO

mono(1), screen(1), tmux(1), netstat(8)

Copied to clipboard