Skip to content
Bytearium

No ads or affiliate links active

Homelab & storage

Terraria server for friends: vanilla or TShock

Terraria server for friends: choose vanilla or TShock, open port 7777 on TCP only, write serverconfig.txt and copy the world file off the machine.

Host & Play is cooking in your own kitchen: lovely, until you want to go to bed and everyone is still hungry. A small dedicated server keeps the world alive when you log off. This guide picks the software, the port and the backup routine.

The short answer

Which Terraria server should you run for friends? Start with the official vanilla dedicated server if you want a world, a password and nothing else. Choose TShock if you want accounts, groups, permissions and anti-cheat, and you accept one more dependency (.NET 9) and a release that can trail the game. Either way, open port 7777 on TCP only, skip UPnP, and copy the world file off the machine on a schedule. State on 25 Oct 2026: Terraria is at 1.4.5.8 from 23 Aug 2026 [4], and TShock 6.2.1 from 27 Sep 2026 is built for exactly that game version [7].

How it works

  1. Three ways to host. With Host & Play, the first player starts the world from the regular game. The world is saved on and runs from that player's PC and shuts down when the host leaves [3]. A dedicated server runs the world on a separate machine, with no graphics and without a player who has to stay connected [3]. TShock is a third-party server package. The wiki lists in-game commands, whitelists, player passwords and a plugin interface [1], and the project describes anti-cheat tools, server-side characters (characters stored on the server instead of on the player's PC), groups, permissions and item bans [10].
  2. Home or a small VPS. A VPS is a rented virtual server. The Terraria wiki says a small world needs about 500 MB of free RAM, but the same section still lists .NET Framework 4.0 and XNA as requirements, so treat the figure as a rough floor and not as a 1.4.5 measurement [1]. TShock's wiki asks for at least 1 GB of memory and a reasonably powerful machine. A Raspberry Pi 4 has run very small servers, but the team suggests something stronger [8]. Prices and the right plan for eight players are unverified; we measured nothing. Our reading: for a few friends, a home PC that runs only during play time is enough, because an empty server hibernates and time only passes while players are connected [1]. A VPS pays off when the world should be reachable at any hour.
  3. One version for everyone. Re-Logic released 1.4.5.8 on 23 Aug 2026 [4], and the wiki's server download is the 1.4.5.8 zip [1]. Our assessment: client and server need the same game version, so announce updates in your group before you touch the server. Console and mobile are a separate question. Re-Logic's September 2026 State of the Game says Crossplay Phase One "should be in your hands in the near future" [6]. We found no source that says console or mobile players can join a PC server today, so we assume your group plays on PC.
  4. Vanilla on Linux. The wiki describes the Linux server like this [1]: install wget, tmux and unzip, download terraria-server-1458.zip from terraria.org, unzip it, change into the Linux folder, make the binary executable with chmod +x TerrariaServer.bin.x86*, and start ./TerrariaServer.bin.x86_64. Worlds live in ~/.local/share/Terraria/Worlds/ [1]. The version number is part of the file name, so look up the current link in the wiki's Downloads section instead of copying an old one.
  5. serverconfig.txt. Start the server with -config <file> and it reads its answers from a text file; lines that begin with # are ignored [1]. The keys the wiki lists include world (load this world file), autocreate (1 small, 2 medium, 3 large), worldname, seed, difficulty (0 normal, 1 expert, 2 master, 3 journey), maxplayers (1 to 255), port, password, motd, worldpath, banlist, secure, language (for example de-DE) and upnp [1]. The default player limit is 16 [1]. A relative path to the config file resolves against the server folder [1]; we use absolute paths. Older forum posts say language and autocreate do not work. Terraria 1.4.5.0 fixed both, including autocreate when it appears out of order in the file [5]. The wiki's older setup guide marks itself as possibly heavily outdated [2], so we take the Server page as the reference and use the guide only for network and troubleshooting hints.
  6. Port, firewall, UPnP. The server listens on TCP port 7777 by default [1]. For cloud providers the wiki says to open 7777 on TCP and UDP [1]. Our assessment: open 7777/TCP first and add UDP only if friends cannot join, because the wiki describes the game port as TCP. At home, give the server a fixed address (a DHCP reservation in the router works) and forward 7777/TCP to it [2]. If you cannot forward a port, the wiki names a VPN such as Hamachi or Radmin VPN, where every player installs the software [1]. A forward does nothing behind CGNAT (carrier-grade NAT, where your provider shares one public address among many customers). Compare the address your router shows on its internet side with the address a "what is my IP" page shows. If they differ, or the router shows an address in 100.64.0.0/10, a range reserved for exactly this shared address space [13], you are behind CGNAT. Then read the CGNAT guide under "Related pages". On a VPS, allow SSH first, then the game port. With ufw, Ubuntu's firewall front end [14], that is sudo ufw allow 22/tcp, then sudo ufw allow 7777/tcp, then sudo ufw enable. Check the provider's own firewall too.
  7. No UPnP. UPnP is automatic port forwarding. The config key upnp=1 and the switch -noupnp both exist [1], and the wiki itself says the auto port forward prompt "does not always work" [1]. Our assessment: a hand-written forward of one port to one machine is easy to review, while automatic forwarding lets software on your network open ports without you noticing. Start the server with -noupnp and leave upnp out of the file.
  8. Keep it running and stop it cleanly. A terminal multiplexer such as tmux keeps the server alive after you log out [1]. If the server fails with "Magic number is wrong: 542", set export TERM=xterm first [2]. In the console, exit saves and shuts down, exit-nosave does not save, and save writes the world now [1]. Closing the console window instead can lose the last minutes of changes, and items moved between chests may vanish [2]. Since 1.4.5.0 the server also saves when the last player leaves [1]. Other useful console commands are playing, kick, ban, say, password and motd [1].
  9. TShock: install and claim ownership. The TShock wiki lists the steps [8]. Install the .NET runtime 9.x, download the latest stable release for your system, and unzip all files into one folder. Start ./TShock.Server (or TShock.Server.exe on Windows). It creates a tshock folder and asks for the world and the port. The console prints a setup code. Join the server with the normal game, enter /setup <code> in chat, then /user add <name> <password> owner, then /login <name> <password>, and finally /setup without a code to switch the setup system off [8]. The owner account holds the highest rights, so choose a password you use nowhere else. The tshock folder holds config.json, sscconfig.json and tshock.sqlite, and the wiki warns that you have to set TShock up again if you lose the database [8]. Plugins go into ServerPlugins [8]. The first stable TShock 6 release for 1.4.5.5 added .NET 9 [7].
  10. TShock settings worth knowing. ServerPassword is the join password and MaxSlots the player limit. The description says to set Terraria's own player maximum two higher if you want the "Server is full" message [9]. AutoSave, AnnounceSave, BackupInterval and BackupKeepFor control saves and the backup copies in tshock/backups [9]. The documentation disagrees on the defaults for the two backup values: the current wiki lists 10 and 240, the older documentation site 0 and 60 [9][11]. Read your own generated config.json instead of trusting either. RequireLogin is off by default, and the REST API (RestApiEnabled, port 7878) is off by default as well [9]. Leave both settings as they are unless you know why you need them.
  11. TShock can trail the game. The releases page shows 6.1.0 on 11 Mar 2026 for Terraria 1.4.5.6 and the next release, 6.2.1, on 27 Sep 2026 for 1.4.5.8 [7]. Terraria 1.4.5.8 appeared on 23 Aug 2026 [4]. So for 35 days we see no TShock build for the current game on the releases page; our reading is that a TShock server may be unable to host the newest game version for weeks. A vanilla server zip comes from Re-Logic and matches the game [1]. If your friends update Steam automatically, vanilla is the calmer choice.
  12. .NET 9 has an end date. Microsoft ends support for .NET 9 on 10 Nov 2026 [12]. TShock's wiki still asks for .NET 9 [8], and the release notes say TShock 6 moved to it [7]. The team wrote in March 2026 that work on .NET 10 would come next [7]. We found no TShock release for a newer .NET on 25 Oct 2026. Check the releases page before you install, and plan one update of the runtime when TShock moves.
  13. Docker. The TShock release notes name an image: docker pull ghcr.io/pryaxis/tshock:stable [7]. We did not pull it or check its ports. Docker can publish ports around your host firewall rules, so read the Docker firewall guide under "Related pages" first.

Vanilla or TShock

Vanilla dedicated serverTShock
SourceRe-Logic, terraria.org download [1]Pryaxis project on GitHub [7]
NeedsServer zip, nothing else on Linux [1].NET runtime 9.x [8]
Setupserverconfig.txt, one passwordSetup code, owner account, groups [8]
Rights and cheatingPassword, secure=1, console kick and ban [1]Accounts, groups, permissions, anti-cheat [10]
Version timingMatches the game [1]Can trail the game (35 days for 1.4.5.8) [7][4]
Extra files to back upWorld filesWorld files, plus the tshock folder with tshock.sqlite [8]

Backups for the world

The world is one .wld file in the worlds folder [1]. Copy the whole folder. For a copy that cannot be half-written, stop the server with exit first, or send save and wait for the save message before you copy. The Terraria wiki pages we read do not describe a .bak file. Hosting providers describe it as a copy of the previous save, which means one step deep, not a history. Do not rely on it. Keep dated copies instead, for example 14 nightly archives, and keep at least one copy on another machine; the 3-2-1 guide and the restic and Borg guide under "Related pages" cover that part. On TShock, add the tshock folder to every copy, because accounts and groups live in tshock.sqlite [8]. TShock can also write its own backups into tshock/backups [9], but they sit on the same disk as the world. Before every server or TShock update, make a full copy; the TShock release notes ask for exactly that [7]. Test the restore once: copy a world file to your own PC's worlds folder and open it in single player [1][2].

A homelab example

This is a generic setup on a small Ubuntu VPS, not a report on our systems. We make no statement about a Terraria server at Bytearium, and we did not run these commands.

Create a user and the folders, then fetch the server as the wiki describes [1]:

sudo adduser --disabled-password terraria
sudo -iu terraria
mkdir -p ~/server && cd ~/server
wget https://terraria.org/api/download/pc-dedicated-server/terraria-server-1458.zip
unzip terraria-server-1458.zip
chmod +x 1458/Linux/TerrariaServer.bin.x86*

Write ~/server/serverconfig.txt with keys from the wiki list [1]:

# four friends, medium world, normal difficulty
world=/home/terraria/.local/share/Terraria/Worlds/friends.wld
autocreate=2
worldname=friends
difficulty=0
maxplayers=6
port=7777
password=use-a-long-phrase-you-do-not-reuse
motd=Please do not cut the purple trees.
language=de-DE
secure=1

Start it inside tmux and without UPnP:

tmux new -s terraria
cd ~/server/1458/Linux
./TerrariaServer.bin.x86_64 -config ~/server/serverconfig.txt -noupnp

Open the firewall as shown in step 6, join with the VPS address and port 7777, and type playing in the console. For the nightly copy, a small script run by cron as the terraria user could look like this:

#!/bin/sh
set -eu
W="$HOME/.local/share/Terraria/Worlds"
D="$HOME/backups"
mkdir -p "$D"
tmux send-keys -t terraria 'save' Enter
sleep 20
tar -czf "$D/worlds-$(date +%F_%H%M).tar.gz" -C "$W" .
find "$D" -name 'worlds-*.tar.gz' -mtime +14 -delete

The 20 seconds are a guess; check in the console that the save message appears before you rely on it. Then sync ~/backups to another machine. For TShock, replace the start line with ./TShock.Server in a folder where you unzipped the release, name the archive of that folder too, and finish the owner setup from step 9.

Checklist

  • Decide first: pick vanilla for a password and a world, pick TShock only if you need accounts, groups or permissions.
  • Check the game version your friends run and download the server or TShock build that names the same version.
  • Write the config file with absolute paths, and start the server with -noupnp.
  • Open 7777/TCP on the VPS firewall or forward 7777/TCP at home, and check for CGNAT before you blame the router.
  • Use exit to stop the server, never the close button of the console window.
  • Claim the TShock owner account right after the first start, switch the setup system off with /setup, and choose a password you use nowhere else.
  • Read your own config.json for BackupInterval and BackupKeepFor instead of trusting a default from a web page.
  • Check the .NET 9 end date of 10 Nov 2026 and the TShock releases page before you install.
  • Copy the worlds folder, plus the tshock folder on TShock, on a schedule, and keep one copy on another machine.
  • Restore one world file on your own PC once, and write down the date.

Palworld, Valheim and co. on a VPS · Game server behind CGNAT or DS-Lite: 5 ways · Docker on a VPS: firewall and hardening · 3-2-1 backup and restore testing · Homelab backups with restic or Borg

Primary sources

These sources are the basis of this page. That does not mean every claim was checked individually; whether a review record exists is shown above under “Status”. The interpretation and checklist are our own work.

There is no documented review record for this version yet. The text relies on the sources listed.

How this page was made: Bytearium creates these pages with the help of AI and is responsible for publishing them. AI can be wrong, so we show our sources and review status openly.

  1. Terraria WikiServer
  2. Terraria WikiGuide:Setting up a Terraria server
  3. Terraria WikiMultiplayer
  4. Terraria WikiDesktop version history
  5. Terraria Wiki1.4.5.0
  6. Re-LogicTerraria 1.4.5.8 - Out Now!
  7. Pryaxis/TShockReleases
  8. Pryaxis/TShockWiki, Home
  9. Pryaxis/TShockconfig file descriptions
  10. Pryaxis/TShockREADME
  11. TShock projectConfig Settings
  12. Microsoft.NET and .NET Core official support policy
  13. IETFRFC 6598, IANA-Reserved IPv4 Prefix for Shared Address Space
  14. UbuntuFirewall

This page has no ads and no affiliate links.