HomeStart / GuidesAnleitungen / Running a Terraria dedicated server on a Linux VPS (systemd, serverconfig.txt)/ Einen Terraria-Dedicated-Server auf einem Linux-VPS betreiben (systemd, serverconfig.txt)

Running a Terraria dedicated server on a Linux VPS (systemd, serverconfig.txt)Einen Terraria-Dedicated-Server auf einem Linux-VPS betreiben (systemd, serverconfig.txt)

The official Terraria server is free, cross-platform, and ships as one zip for Windows, Mac and Linux — but the rule the whole setup lives or dies on is that client and server versions must match exactly, and the game patches often enough that forgetting to update the server is the single most common reason a group can't connect.Der offizielle Terraria-Server ist kostenlos, plattformübergreifend und kommt als ein einziges Zip für Windows, Mac und Linux — aber die Regel, an der das ganze Setup hängt, ist, dass Client- und Server-Version exakt übereinstimmen müssen, und das Spiel wird oft genug gepatcht, dass ein vergessenes Server-Update der mit Abstand häufigste Grund ist, warum eine Gruppe nicht verbinden kann.

What you are installingWas du installierst

Terraria's dedicated server ships from terraria.org as a single zip covering Windows, Mac and Linux in one download. There is no separate app ID to hunt for and no account to log into: you download it, unzip it, and run the Linux build directly.Terrarias Dedicated Server kommt von terraria.org als ein einziges Zip, das Windows, Mac und Linux in einem Download abdeckt. Es gibt keine separate App-ID, nach der du suchen musst, und keinen Account, in den du dich einloggen musst: Du lädst es herunter, entpackst es und startest den Linux-Build direkt.

The one rule that matters more here than almost anywhere else: client and server versions must match exactly. A client on a newer patch cannot join an older server, and it fails with a version-mismatch message rather than anything that looks like a network problem. Whenever the game updates, the server has to update with it, on the same day if your group wants to keep playing together.Die eine Regel, die hier mehr zählt als fast überall sonst: Client- und Server-Version müssen exakt übereinstimmen. Ein Client auf einem neueren Patch kann keinem älteren Server beitreten, und er scheitert mit einer Versionskonflikt-Meldung statt mit etwas, das wie ein Netzwerkproblem aussieht. Sobald das Spiel aktualisiert wird, muss der Server mitziehen, am selben Tag noch, wenn deine Gruppe zusammen weiterspielen will.

Sizing it honestlyEhrlich dimensionieren

Terraria worlds come in three sizes — small, medium and large — and the memory footprint scales with world size and active NPC count far more than with player count. A small world with two to four players sits comfortably in a few hundred megabytes of RAM once the OS is accounted for, which is why it fits inside a 1 GiB Starter without drama. A large world, Expert or Master difficulty, or events with a lot of enemies on screen at once (a Blood Moon, a boss fight, an invasion) push both CPU and RAM harder and are worth sizing up for.Terraria-Welten gibt es in drei Größen — klein, mittel und groß — und der Speicherbedarf skaliert weit stärker mit Weltgröße und aktiver NPC-Zahl als mit der Spielerzahl. Eine kleine Welt mit zwei bis vier Spielern liegt bequem bei ein paar hundert Megabyte RAM, wenn das Betriebssystem mit eingerechnet ist, weshalb sie ohne Drama in einen 1-GiB-Starter passt. Eine große Welt, Expert- oder Master-Schwierigkeit oder Events mit vielen Gegnern gleichzeitig auf dem Bildschirm (ein Blutmond, ein Bosskampf, eine Invasion) fordern CPU und RAM stärker und sind es wert, dafür hochzugehen.

CPU-wise the server is not demanding at idle, but it is not well parallelised either — a couple of steady vCPUs beat many slow ones, the same lesson as most single-world game servers.CPU-seitig ist der Server im Leerlauf nicht anspruchsvoll, aber auch nicht gut parallelisiert — ein paar gleichmäßige vCPUs schlagen viele langsame, dieselbe Lektion wie bei den meisten Ein-Welt-Gameservern.

Step 1: the machineSchritt 1: die Maschine

Deploy an Ubuntu 24.04 LTS VPS and do the security basics before anything is reachable from the internet: a non-root user, your SSH key on it, password login switched off, and a firewall that defaults to deny. We cover that in connect to your VPS over SSH and secure your VPS.Setze einen Ubuntu-24.04-LTS-VPS auf und erledige die Sicherheitsgrundlagen, bevor irgendetwas aus dem Internet erreichbar ist: einen Non-Root-User, deinen SSH-Key darauf, Passwort-Login abgeschaltet und eine Firewall, die standardmäßig blockiert. Das behandeln wir unter über SSH mit deinem VPS verbinden und deinen VPS absichern.

sudo apt update
sudo apt install -y unzip curl screen
sudo useradd -m -s /bin/bash terraria

screen is not optional scaffolding here — Step 5 depends on it, because the server has no clean way to shut down without it.screen ist hier kein optionales Beiwerk — Schritt 5 hängt davon ab, weil der Server keine saubere Möglichkeit hat, sich ohne es herunterzufahren.

Step 2: the download, and updatesSchritt 2: der Download, und Updates

As the terraria user, get the server package. Open https://terraria.org/server in a browser first — the download link's file name embeds the current version (something like terraria-server-NNNN.zip) and changes with every content patch, so do not reuse a link from an old tutorial:Besorg dir als Nutzer terraria das Server-Paket. Öffne zuerst https://terraria.org/server in einem Browser — der Dateiname des Download-Links hat die aktuelle Version eingebettet (etwas wie terraria-server-NNNN.zip) und ändert sich mit jedem Content-Patch, verwende also keinen Link aus einem alten Tutorial:

sudo -u terraria -i
curl -LO 'PASTE_THE_LINK_FROM_TERRARIA.ORG_HERE'
unzip terraria-server-*.zip -d ~/terraria-install
cd ~/terraria-install/*/Linux
chmod +x TerrariaServer TerrariaServer.bin.x86_64
ln -sfn "$(pwd)" ~/terraria-install/current

That Linux folder sits alongside Windows and Mac ones inside a version-numbered top-level folder — the wildcard above saves you typing the exact number. The current symlink is what systemd will actually point at in Step 5, so it always resolves to whichever version you unzipped most recently.Dieser Ordner Linux liegt neben den Ordnern Windows und Mac innerhalb eines versionsnummerierten Top-Level-Ordners — die Wildcard oben erspart dir, die genaue Nummer zu tippen. Der Symlink current ist das, worauf systemd in Schritt 5 tatsächlich zeigen wird, er löst also immer auf die zuletzt entpackte Version auf.

Updating later is the same four commands against the new zip, including re-running the ln -sfn line — that is what moves current onto the new version. Keep your serverconfig.txt and your Worlds folder outside this install directory (Step 3 sets that up), so re-unzipping a new version never touches your saved world or settings.Ein späteres Update sind dieselben vier Befehle gegen das neue Zip, einschließlich des erneuten Ausführens der Zeile ln -sfn — das ist es, was current auf die neue Version verschiebt. Halte deine serverconfig.txt und deinen Ordner Worlds außerhalb dieses Installationsverzeichnisses (Schritt 3 richtet das ein), damit erneutes Entpacken einer neuen Version nie deine gespeicherte Welt oder Einstellungen berührt.

Step 3: serverconfig.txtSchritt 3: serverconfig.txt

Running the server with a config file skips the interactive prompts entirely — which matters, because a systemd service has no keyboard to answer them with. Create /home/terraria/serverconfig.txt:Den Server mit einer Konfigurationsdatei zu starten überspringt die interaktiven Abfragen komplett — was wichtig ist, weil ein systemd-Dienst keine Tastatur hat, um sie zu beantworten. Erstelle /home/terraria/serverconfig.txt:

worldpath=/home/terraria/Worlds
world=/home/terraria/Worlds/Overworld.wld
autocreate=1
worldname=Overworld
difficulty=0
maxplayers=8
port=7777
password=
motd=Welcome to the server
secure=1
upnp=0
priority=1
language=en-US

autocreate picks the size if world does not exist yet: 1 is small, 2 medium, 3 large — the sample above generates a small world to match the Starter-tier sizing below; bump it to 2 or 3 if you are already on a bigger tier. The server only reads autocreate on first launch and never touches it again afterwards. difficulty runs 0 (classic) through to 3 (journey). secure=1 turns on the server-side checks against a few classic cheats and costs nothing to leave on. upnp=0 stops the server wasting startup time trying automatic port mapping that never works on a VPS anyway.autocreate bestimmt die Größe, wenn world noch nicht existiert: 1 ist klein, 2 mittel, 3 groß — das Beispiel oben erzeugt eine kleine Welt passend zur Starter-Tarif-Dimensionierung weiter unten; erhöhe auf 2 oder 3, wenn du bereits auf einem größeren Tarif bist. Der Server liest autocreate nur beim ersten Start und fasst es danach nie wieder an. difficulty läuft von 0 (klassisch) bis 3 (journey). secure=1 schaltet die serverseitigen Prüfungen gegen ein paar klassische Cheats ein und kostet nichts, es aktiviert zu lassen. upnp=0 verhindert, dass der Server Startzeit damit verschwendet, automatisches Port-Mapping zu versuchen, das auf einem VPS ohnehin nie funktioniert.

Lock the file down before you put a real password in it — anyone else's login on the box can otherwise read it in plain text:Sperre die Datei ab, bevor du ein echtes Passwort hineinschreibst — sonst kann jeder andere Login auf der Maschine es im Klartext lesen:

chmod 600 /home/terraria/serverconfig.txt

Run it once by hand before wiring up systemd, so a typo in the config surfaces as an error you can actually read:Führe ihn einmal von Hand aus, bevor du systemd verdrahtest, damit ein Tippfehler in der Konfiguration als eine Fehlermeldung auftaucht, die du tatsächlich lesen kannst:

./TerrariaServer -config /home/terraria/serverconfig.txt

Step 4: the port, and the NAT catchSchritt 4: der Port, und die NAT-Falle

Terraria's default port is 7777, and — unlike a lot of other game servers — it is TCP, not UDP:Terrarias Standardport ist 7777, und — anders als bei vielen anderen Gameservern — er ist TCP, nicht UDP:

sudo ufw allow 7777/tcp

If your VPS gives you NAT IPv4 rather than an address of your own, you do not get to open any port you like — you get a fixed set the provider already forwards to you. The fix is the same shape as it is for any NAT'd game server: set port= in serverconfig.txt to one of the ports actually forwarded to your machine instead of 7777, and give players that number along with the address. Or ask for a dedicated IPv4 (on our plans that is available on request by e-mail rather than as a self-service add-on) if you specifically want the default port free. See NAT IPv4 vs a dedicated IP and NAT IPv4, ports and forwarding before you order if you are not sure which situation applies to you.Gibt dir dein VPS NAT-IPv4 statt einer eigenen Adresse, kannst du nicht einfach jeden beliebigen Port öffnen — du bekommst einen festen Satz, den der Anbieter bereits für dich weiterleitet. Die Lösung hat dieselbe Form wie bei jedem genatteten Gameserver: Setze port= in serverconfig.txt auf einen der tatsächlich zu deiner Maschine weitergeleiteten Ports statt auf 7777, und gib Spielern diese Nummer zusammen mit der Adresse. Oder frage nach einer dedizierten IPv4 (bei unseren Tarifen auf Anfrage per E-Mail verfügbar, nicht als Self-Service-Add-on), wenn du gezielt den Standardport frei haben willst. Sieh dir NAT IPv4 vs. dedizierte IP und NAT IPv4, Ports und Weiterleitung an, bevor du bestellst, wenn du nicht sicher bist, welche Situation auf dich zutrifft.

Step 5: systemd, and the shutdown that has to go through the consoleSchritt 5: systemd, und das Herunterfahren, das über die Konsole laufen muss

The vanilla server has no signal handler that saves the world on SIGTERM the way some game servers do — the only clean shutdown is typing exit into its own console. That means the service has to run inside something you can still talk to, which is what screen is for:Der Vanilla-Server hat keinen Signal-Handler, der die Welt bei SIGTERM speichert, so wie es manche Gameserver tun — das einzige saubere Herunterfahren ist, exit in seine eigene Konsole zu tippen. Das heißt, der Dienst muss innerhalb von etwas laufen, mit dem du noch reden kannst, wofür screen da ist:

[Unit]
Description=Terraria dedicated server
After=network-online.target
Wants=network-online.target

[Service]
Type=simple
User=terraria
WorkingDirectory=/home/terraria/terraria-install/current
ExecStart=/usr/bin/screen -DmS terraria /home/terraria/terraria-install/current/TerrariaServer -config /home/terraria/serverconfig.txt
ExecStop=/usr/bin/screen -S terraria -X stuff 'exit\r'
TimeoutStopSec=90
KillSignal=SIGCONT
Restart=on-failure
RestartSec=10

[Install]
WantedBy=multi-user.target

ExecStop types exit into the running console rather than killing the process, which is what makes the world save before the service actually stops. The part that is easy to miss: the moment that screen -X stuff command returns, systemd sends its own stop signal to every process in the unit anyway, and by default that signal is SIGTERM, which the vanilla server does not handle and which would kill it before the save finishes — exactly the abrupt shutdown this whole mechanism exists to avoid. KillSignal=SIGCONT is what fixes that: SIGCONT does not terminate a running process, so systemd's automatic follow-up signal becomes harmless, and TimeoutStopSec=90 becomes a real grace period for the save to finish on a larger world before systemd escalates to SIGKILL. This is the thing that bites later: a plain systemctl stop, a reboot without this unit, or a crash all skip the console entirely and can throw away whatever changed since the last manual save.ExecStop tippt exit in die laufende Konsole, statt den Prozess zu killen, und das ist es, was die Welt speichern lässt, bevor der Dienst tatsächlich stoppt. Der Teil, der leicht zu übersehen ist: In dem Moment, in dem dieser Befehl screen -X stuff zurückkehrt, schickt systemd trotzdem sein eigenes Stopp-Signal an jeden Prozess in der Unit, und standardmäßig ist dieses Signal SIGTERM, das der Vanilla-Server nicht behandelt und das ihn töten würde, bevor das Speichern fertig ist — genau das abrupte Herunterfahren, das dieser ganze Mechanismus vermeiden soll. KillSignal=SIGCONT behebt das: SIGCONT beendet keinen laufenden Prozess, also wird systemds automatisches Folgesignal harmlos, und TimeoutStopSec=90 wird zu einer echten Karenzzeit, damit das Speichern bei einer größeren Welt fertig wird, bevor systemd zu SIGKILL eskaliert. Das ist das, was einen später beißt: ein einfaches systemctl stop, ein Reboot ohne diese Unit oder ein Absturz überspringen alle die Konsole komplett und können wegwerfen, was sich seit dem letzten manuellen Speichern geändert hat.

Bring it up with sudo systemctl enable --now terraria, and watch the actual game console (not just the systemd journal) with sudo -u terraria screen -r terraria — detach again with Ctrl-A then d without touching the server.Bring ihn hoch mit sudo systemctl enable --now terraria, und beobachte die eigentliche Spielkonsole (nicht nur das systemd-Journal) mit sudo -u terraria screen -r terraria — trenne dich wieder mit Ctrl-A dann d, ohne den Server anzufassen.

World files and backupsWeltdateien und Backups

A world is two files under worldpath: the .wld itself and, once the server has saved at least once, a .wld.bak holding the previous save — Terraria keeps exactly that one generation automatically, no more. That protects you from a single bad save, not from losing the disk or the machine underneath it.Eine Welt sind zwei Dateien unter worldpath: die .wld selbst und, sobald der Server mindestens einmal gespeichert hat, eine .wld.bak, die den vorherigen Speicherstand hält — Terraria behält automatisch genau diese eine Generation, nicht mehr. Das schützt dich vor einem einzelnen fehlerhaften Speichervorgang, nicht vor dem Verlust der Festplatte oder der Maschine darunter.

Copy .wld files off the box on a schedule, not just when you remember to. back up your VPS covers what that looks like and what is not included by default anywhere. Since worldpath is set explicitly in Step 3, your backup job has one predictable directory to watch rather than needing to guess where the server decided to put things.Kopiere .wld-Dateien nach einem Zeitplan von der Maschine, nicht nur, wenn du dran denkst. Backup deines VPS beschreibt, wie das aussieht und was standardmäßig nirgends enthalten ist. Da worldpath in Schritt 3 explizit gesetzt ist, hat dein Backup-Job ein vorhersehbares Verzeichnis zu beobachten, statt raten zu müssen, wohin der Server die Dinge gelegt hat.

TShock, brieflyTShock, kurz

If you want permissions, moderation commands, server-side characters or a plugin ecosystem, TShock is the standard answer — it is a full replacement for the vanilla server binary, downloaded from its own GitHub releases rather than from terraria.org. The catch worth knowing before you commit to it: every TShock release is pinned to one specific Terraria version, so when the game patches you are stuck on the old version until TShock's maintainers catch up, which can be days. That trade-off is worth it for a public server that needs moderation tools; for a private world with friends you trust, the vanilla server above is simpler and always current on day one.Wenn du Berechtigungen, Moderationsbefehle, serverseitige Charaktere oder ein Plugin-Ökosystem willst, ist TShock die Standardantwort — es ist ein vollständiger Ersatz für das Vanilla-Server-Binary, heruntergeladen von seinen eigenen GitHub-Releases statt von terraria.org. Der Haken, den du kennen solltest, bevor du dich darauf festlegst: Jedes TShock-Release ist auf eine bestimmte Terraria-Version festgenagelt, sodass du beim Patchen des Spiels auf der alten Version feststeckst, bis TShocks Maintainer nachziehen, was Tage dauern kann. Diese Abwägung lohnt sich für einen öffentlichen Server, der Moderationswerkzeuge braucht; für eine private Welt mit Freunden, denen du vertraust, ist der Vanilla-Server oben einfacher und am ersten Tag immer aktuell.

On overnight.hostBei overnight.host

Full disclosure: this is what we sell. A small vanilla world for a handful of friends runs comfortably on the Starter tier's 1 GiB; move up to Basic or Standard once the world is large, you turn on Expert or Master mode, or you add TShock and a bigger player count.Zur vollen Transparenz: Das ist, was wir verkaufen. Eine kleine Vanilla-Welt für eine Handvoll Freunde läuft bequem auf dem 1-GiB-Starter-Tarif; steig auf Basic oder Standard um, sobald die Welt groß ist, du Expert- oder Master-Modus einschaltest oder du TShock und eine größere Spielerzahl dazunimmst.

Linux KVM VPS — EUR 4.99 to EUR 59.99 a month, on our own single-tenant bare metal in Dallas, TX and Charlotte, NC. Full hardware virtualisation (KVM), your own kernel, full root. Six tiers, vps-starter to vps-ultra. Starter is 1 vCPU, 1 GiB RAM, 25 GB disk.Linux-KVM-VPS — 4,99 bis 59,99 EUR im Monat, auf unserer eigenen Single-Tenant-Bare-Metal-Hardware in Dallas, TX und Charlotte, NC. Vollständige Hardware-Virtualisierung (KVM), eigener Kernel, volles Root. Sechs Tarife, vps-starter bis vps-ultra. Starter hat 1 vCPU, 1 GiB RAM, 25 GB Speicher.

You order in the shop, pay by card (Stripe) or SEPA bank transfer, and your login details are e-mailed to you once the service is set up. Support is e-mail, run by one person, with no guaranteed response time. All prices are final totals under the German small-business rule (§19 UStG); no VAT is added or shown.Du bestellst im Shop, zahlst per Karte (Stripe) oder SEPA-Überweisung, und deine Zugangsdaten werden dir per E-Mail zugeschickt, sobald der Dienst eingerichtet ist. Support läuft per E-Mail, von einer einzelnen Person betrieben, ohne garantierte Reaktionszeit. Alle Preise sind Endpreise. Gemäß § 19 UStG wird keine Umsatzsteuer ausgewiesen.

Order vps-starter → · Linux KVM VPS overviewvps-starter bestellen → · Übersicht Linux-KVM-VPS

Written by the person who runs overnight.host: a small, honest hosting company on dedicated bare metal — Linux VPS, game servers, web hosting. Live status at up.overnight.host.Geschrieben von der Person, die overnight.host betreibt: ein kleines, ehrliches Hosting-Unternehmen auf dedizierter Bare-Metal-Hardware — Linux-VPS, Gameserver, Webhosting. Live-Status unter up.overnight.host.

Technical guidance is informational. Plans, specifications and final prices are listed in the shop and can be ordered directly; VPS, game server, web hosting, one-click app and automation plans are provisioned automatically after payment. Custom configurations are still arranged by e-mail.Technische Hinweise dienen der Information. Pläne, Spezifikationen und Endpreise stehen im Shop und können direkt bestellt werden; VPS-, Gameserver-, Webhosting-, One-Click-App- und Automatisierungs-Pläne werden nach der Zahlung automatisch bereitgestellt. Sonderkonfigurationen werden weiterhin per E-Mail vereinbart.

FAQFAQ

How much RAM does a Terraria server need?Wie viel RAM braucht ein Terraria-Server?

A small world with a handful of players runs comfortably within a 1 GiB Starter. Budget more once the world is large, you are running Expert or Master mode, or big events are common — memory tracks world size and active enemy count more than the player count itself.Eine kleine Welt mit einer Handvoll Spieler läuft bequem innerhalb eines 1-GiB-Starters. Plane mehr ein, sobald die Welt groß ist, du im Expert- oder Master-Modus spielst oder große Events häufig sind — der Speicherverbrauch folgt der Weltgröße und der aktiven Gegnerzahl mehr als der Spielerzahl selbst.

Which port does Terraria use, and is it TCP or UDP?Welchen Port nutzt Terraria, und ist es TCP oder UDP?

7777 by default, and it is TCP, not UDP. It is configurable via port= in serverconfig.txt, which matters if you are behind NAT IPv4 and need to use one of your provider's forwarded ports instead.Standardmäßig 7777, und es ist TCP, nicht UDP. Er ist über port= in serverconfig.txt konfigurierbar, was wichtig ist, wenn du hinter NAT-IPv4 sitzt und stattdessen einen der von deinem Anbieter weitergeleiteten Ports nutzen musst.

Do I need to install Mono to run the Linux server?Muss ich Mono installieren, um den Linux-Server zu betreiben?

No. The official Linux server ships prebuilt native x86_64 binaries, so a standard KVM VPS runs it with no Mono or .NET install. Mono is only used by the bundled launcher as a fallback on non-x86 systems such as a Raspberry Pi.Nein. Der offizielle Linux-Server kommt mit vorkompilierten nativen x86_64-Binaries, sodass ein Standard-KVM-VPS ihn ohne Mono- oder .NET-Installation ausführt. Mono wird vom mitgelieferten Launcher nur als Fallback auf Nicht-x86-Systemen wie einem Raspberry Pi genutzt.

Why does my server seem to hang instead of starting?Warum scheint mein Server hängen zu bleiben, statt zu starten?

Almost always an incomplete serverconfig.txt — without a valid world or autocreate value the server falls back to an interactive prompt, which has nothing to answer it when it is launched from systemd. Run it by hand first with -config pointed at your file and confirm it reaches "Server started" before wiring it into a service.Fast immer eine unvollständige serverconfig.txt — ohne einen gültigen Wert für world oder autocreate fällt der Server auf eine interaktive Abfrage zurück, die nichts hat, das sie beantwortet, wenn er von systemd gestartet wird. Führe ihn zuerst von Hand mit -config aus, das auf deine Datei zeigt, und bestätige, dass er „Server started“ erreicht, bevor du ihn in einen Dienst verdrahtest.

Can I run TShock instead of the vanilla server?Kann ich TShock statt des Vanilla-Servers betreiben?

Yes, and it is the standard choice for a public or moderated server. The trade-off is version lag: TShock supports one pinned Terraria version at a time, so a fresh game patch means waiting for TShock's own release before you can update, rather than updating the same day as with vanilla.Ja, und es ist die Standardwahl für einen öffentlichen oder moderierten Server. Die Abwägung ist Versionsverzögerung: TShock unterstützt jeweils eine festgenagelte Terraria-Version, sodass ein frischer Spiel-Patch bedeutet, auf TShocks eigenes Release zu warten, bevor du aktualisieren kannst, statt am selben Tag wie bei Vanilla zu aktualisieren.

Ready to order?Bereit zu bestellen?

Prices are final totals; no VAT is shown (§19 UStG). Need something the shop does not list? Email us for a written offer.Alle Preise sind Endpreise ohne ausgewiesene USt. (§19 UStG). Du brauchst etwas, das nicht im Shop steht? Schreib uns für ein schriftliches Angebot.

Order now →Jetzt bestellen → Request a custom configIndividuelle Konfiguration anfragen