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
- 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].
- 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.
- 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.
- Vanilla on Linux. The wiki describes the Linux server like this [1]: install
wget,tmuxandunzip, downloadterraria-server-1458.zipfrom terraria.org, unzip it, change into theLinuxfolder, make the binary executable withchmod +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. 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 includeworld(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 examplede-DE) andupnp[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 saylanguageandautocreatedo not work. Terraria 1.4.5.0 fixed both, includingautocreatewhen 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.- 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 issudo ufw allow 22/tcp, thensudo ufw allow 7777/tcp, thensudo ufw enable. Check the provider's own firewall too. - No UPnP. UPnP is automatic port forwarding. The config key
upnp=1and the switch-noupnpboth 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-noupnpand leaveupnpout of the file. - Keep it running and stop it cleanly. A terminal multiplexer such as
tmuxkeeps the server alive after you log out [1]. If the server fails with "Magic number is wrong: 542", setexport TERM=xtermfirst [2]. In the console,exitsaves and shuts down,exit-nosavedoes not save, andsavewrites 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 areplaying,kick,ban,say,passwordandmotd[1]. - 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(orTShock.Server.exeon Windows). It creates atshockfolder 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/setupwithout a code to switch the setup system off [8]. The owner account holds the highest rights, so choose a password you use nowhere else. Thetshockfolder holdsconfig.json,sscconfig.jsonandtshock.sqlite, and the wiki warns that you have to set TShock up again if you lose the database [8]. Plugins go intoServerPlugins[8]. The first stable TShock 6 release for 1.4.5.5 added .NET 9 [7]. - TShock settings worth knowing.
ServerPasswordis the join password andMaxSlotsthe 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,BackupIntervalandBackupKeepForcontrol saves and the backup copies intshock/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 generatedconfig.jsoninstead of trusting either.RequireLoginis 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. - 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.
- .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.
- 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 server | TShock | |
|---|---|---|
| Source | Re-Logic, terraria.org download [1] | Pryaxis project on GitHub [7] |
| Needs | Server zip, nothing else on Linux [1] | .NET runtime 9.x [8] |
| Setup | serverconfig.txt, one password | Setup code, owner account, groups [8] |
| Rights and cheating | Password, secure=1, console kick and ban [1] | Accounts, groups, permissions, anti-cheat [10] |
| Version timing | Matches the game [1] | Can trail the game (35 days for 1.4.5.8) [7][4] |
| Extra files to back up | World files | World 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=1Start it inside tmux and without UPnP:
tmux new -s terraria
cd ~/server/1458/Linux
./TerrariaServer.bin.x86_64 -config ~/server/serverconfig.txt -noupnpOpen 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 -deleteThe 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
exitto 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.jsonforBackupIntervalandBackupKeepForinstead 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
tshockfolder 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.
Related pages
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