01
Before you start: which server to choose
There are three servers for Terraria on PC, and they all use the same port and the same world format:
- The official dedicated server, published by Re-Logic on
terraria.org. The simplest option, released by the publisher with each new version of the game. It is all you need to play with friends.
- TShock, an open source modified server. It adds accounts, groups and permissions, region protection, admin commands and plugins. The right choice for a public server.
- tModLoader, to play with mods. Players launch tModLoader (free on Steam for Terraria owners) instead of the base game, with the same mods as the server.
On the VPS side, plan for:
- Ubuntu 24.04 or Debian 12, 64-bit on an x86 processor, with a user that has
sudo rights. Apply the settings from the guide securing a Linux VPS first.
- Memory: about 500 MB free for a small world according to the game's official wiki, more for a large world and many players. The TShock documentation asks for at least 1 GB. With tModLoader, it all depends on the mods: large packs use a lot more, so keep some headroom.
- A fast processor per core: the world simulation runs mostly on one core.
None of these servers needs a kernel module: they run in a Linux container just as on a virtual machine. To compare VPS types, see VPS for a game server.
02
Install the official server and configure it
Install the tools you need and create a dedicated user, so the server never runs as root:
sudo apt update
sudo apt install -y curl unzip tmux
sudo useradd -m -s /bin/bash terraria
Then download the server as that user. The number 1461 stands for version 1.4.6.1, the latest at the time of writing; the current number is in the "PC Dedicated Server" link at the bottom of the terraria.org home page. The actuel link will be used for updates:
sudo -iu terraria
mkdir -p ~/serveur ~/.local/share/Terraria/Worlds
cd ~/serveur
V=1461
curl -LO https://terraria.org/api/download/pc-dedicated-server/terraria-server-$V.zip
unzip -q terraria-server-$V.zip
chmod +x $V/Linux/TerrariaServer.bin.x86_64
ln -sfn ~/serveur/$V/Linux ~/serveur/actuel
Create the file /home/terraria/serverconfig.txt (for example with nano ~/serverconfig.txt). With these settings, the server creates the world on first start and then reloads it every time, without asking any question:
world=/home/terraria/.local/share/Terraria/Worlds/monde1.wld
autocreate=2
worldname=monde1
difficulty=0
maxplayers=8
port=7777
secure=1
upnp=0
autocreate: the size of the world created if it does not exist yet (1 small, 2 medium, 3 large);
difficulty: 0 Classic, 1 Expert, 2 Master, 3 Journey;
maxplayers: from 1 to 255;
- add
password= followed by a password to keep the server to your friends, motd= for the welcome message, language=fr-FR for a French console and seed= to force a seed.
To reuse an existing world, copy its .wld files into ~/.local/share/Terraria/Worlds and put its path in world. Do a first test run by hand:
cd ~/serveur/actuel
TERM=xterm ./TerrariaServer.bin.x86_64 -config ~/serverconfig.txt
TERM=xterm avoids the Magic number is wrong: 542 error that the official wiki reports on some Linux systems. Creating the world takes a while. When the console shows the server listening on port 7777, type exit (the world is saved, then the server stops), then exit again to leave the terraria user.
03
Keep it online and open port 7777
The server waits for keyboard commands, so it runs inside a tmux session, started by a systemd service when the VPS boots. Create /etc/systemd/system/terraria.service (for example with sudo nano):
[Unit]
Description=Terraria
Wants=network-online.target
After=network-online.target
[Service]
Type=forking
User=terraria
ExecStart=/usr/bin/tmux new-session -d -s terraria -c /home/terraria/serveur/actuel /usr/bin/env TERM=xterm /home/terraria/serveur/actuel/TerrariaServer.bin.x86_64 -config /home/terraria/serverconfig.txt
ExecStop=/bin/sh -c '/usr/bin/tmux send-keys -t terraria exit Enter; while /usr/bin/tmux has-session -t terraria 2>/dev/null; do sleep 1; done'
TimeoutStopSec=90
[Install]
WantedBy=multi-user.target
When stopping, the service types exit into the console, which saves the world before quitting. Enable it:
sudo systemctl daemon-reload
sudo systemctl enable --now terraria
sudo -u terraria tmux attach -t terraria
The last line opens the server console. Commands are typed there without a slash: playing lists the players, save saves the world, say sends a message, kick and ban followed by a name remove a player, and help gives the full list. Leave the console without stopping the server with Ctrl+B then D.
The port. Terraria uses port 7777 over TCP. With UFW, allow SSH before enabling the firewall, so you do not lock yourself out:
sudo ufw allow OpenSSH
sudo ufw allow 7777/tcp
sudo ufw enable
The official wiki advises also opening 7777 over UDP on a rented server: add sudo ufw allow 7777/udp if a player cannot connect. In the game, players go through the Multiplayer menu and join the server with the VPS's IPv4 address and port 7777. If you change port, open the new one instead. Common mistakes are covered in game server ports.
04
TShock or tModLoader instead of the official server
Both start with the same service: only the ExecStart line changes. First stop the official server with sudo systemctl stop terraria.
TShock. TShock 6 needs the .NET 9 runtime. On Ubuntu 24.04, it comes from the backports repository listed by Microsoft; on Debian 12, follow Microsoft's .NET documentation to add its repository. Then download the version that matches your players from the project's releases page (GitHub Pryaxis/TShock). The example below is version 6.2.1, built for Terraria 1.4.5.8. Note that Microsoft ended support for .NET 9 on 10 November 2026: keep an eye on TShock releases, as its team has announced the move to .NET 10:
sudo apt install -y software-properties-common
sudo add-apt-repository -y ppa:dotnet/backports
sudo apt update
sudo apt install -y dotnet-runtime-9.0
sudo -iu terraria
mkdir -p ~/tshock && cd ~/tshock
curl -LO https://github.com/Pryaxis/TShock/releases/download/v6.2.1/TShock-6.2.1-for-Terraria-1.4.5.8-linux-x64-Release.zip
unzip -q TShock-6.2.1-for-Terraria-1.4.5.8-linux-x64-Release.zip
tar -xf TShock-Beta-linux-x64-Release.tar
exit
In the service, replace ExecStart with this line, then run sudo systemctl daemon-reload and sudo systemctl start terraria:
ExecStart=/usr/bin/tmux new-session -d -s terraria -c /home/terraria/tshock /home/terraria/tshock/TShock.Server -world /home/terraria/.local/share/Terraria/Worlds/monde1.wld -autocreate 2 -port 7777 -maxplayers 8
On first start, the console shows a setup code. Join the server in the game and type /setup followed by that code in the chat, create your owner account with /user add name password owner, log in with /login name password, then turn off the setup system by typing /setup on its own. Settings live in the ~/tshock/tshock folder (config.json), next to the tshock.sqlite database, which you must never lose. The TShock REST API (port 7878) is disabled by default: do not open it unless you need it.
Mind the version: TShock follows Terraria updates with a delay, and a player whose game version differs from the server's is refused. At the time of writing, the latest TShock targets Terraria 1.4.5.8 while the official server is at 1.4.6.1.
tModLoader. The project provides an official management script, which installs tModLoader from its GitHub page (the same version as on Steam) along with the .NET it needs:
sudo -iu terraria
mkdir -p ~/tml && cd ~/tml
curl -LO https://raw.githubusercontent.com/tModLoader/tModLoader/1.4.5/patches/tModLoader/Terraria/release_extras/DedicatedServerUtils/manage-tModLoaderServer.sh
chmod +x manage-tModLoaderServer.sh
./manage-tModLoaderServer.sh install-tml --github
For Workshop mods, create a mod pack in tModLoader on your computer (Workshop, Mod Packs, "Save Enabled as New Mod Pack"), copy its install.txt and enabled.json files into ~/tml/Mods, install SteamCMD as in the guide VPS for a game server, then run STEAMCMDPATH=/usr/games/steamcmd ./manage-tModLoaderServer.sh install-mods. Put a serverconfig.txt like the one in the previous section into ~/tml, with world=/home/terraria/tml/Worlds/monde1.wld, then use this line in the service:
ExecStart=/usr/bin/tmux new-session -d -s terraria -c /home/terraria/tml /home/terraria/tml/manage-tModLoaderServer.sh start
The tModLoader project also offers a Docker image, which its documentation recommends over the script; it works on our Linux VPS (see installing Docker on a VPS).
05
Backups and updates
A Terraria world fits in a .wld file, with a .wld.bak copy next to it; with tModLoader, a .twld file holds the mod data on top. Ask the server to save, then archive the worlds folder:
sudo -u terraria tmux send-keys -t terraria save Enter
sleep 10
sudo tar -czf /root/terraria-$(date +%F).tar.gz -C /home/terraria/.local/share/Terraria Worlds
With TShock, also archive /home/terraria/tshock/tshock (accounts, groups, settings); with tModLoader, the Worlds and Mods folders of /home/terraria/tml. Schedule the backup every night, then copy the archives off the VPS with scp or rsync: a copy left on the same machine protects neither from a wrong command nor from a reinstall.
Updating the official server. When Terraria ships a new version, updated players can no longer join the old server. Take a backup, run the download block again with the new number in V= (the actuel link switches to the new version), then:
sudo systemctl restart terraria
TShock: according to its release notes, you just overwrite the files in the folder with those from the new archive, after a full backup. tModLoader: STEAMCMDPATH=/usr/games/steamcmd ./manage-tModLoaderServer.sh install --github updates tModLoader and the mods together (without --github, the script would go through Steam and ask for an account); run it again every time Steam updates your players.
06
On a CloudFive VPS
CloudFive has no turnkey Terraria offer: you install it yourself on a VPS, as described above. A Terraria server needs little memory, so the choice comes down mostly to the processor:
- The Ryzen VPS (Ryzen 9 9950X, DDR5 memory, NVMe disk) is the fastest per core: the right choice for a public server, a large world or a heavy tModLoader mod pack.
- The Intel VPS (Xeon E5-2687W v4, DDR4 ECC memory) is our cheapest VPS and is enough for a world among friends with the official server or TShock.
- The Ryzen and Intel VPS are Linux containers (LXC) with root access and nesting enabled: the official server, TShock, tModLoader and Docker all run on them.
- A dedicated IPv4 address, a 1 Gb/s port and servers in France, on our own network AS218808: low latency for players in France.
- Basic anti-DDoS protection included on every VPS. Premium Protection, a paid option you turn on from the VPS's Protection page, adds the game-specific filter and advanced settings (traffic caps, countries, per-port access); ask support whether Terraria already has its own filter. Good habits are covered in protecting a game server from DDoS attacks.
- Snapshots and an emergency console in the customer area, handy before a game or mod update.
The VPS is billed monthly, with no commitment, and support answers in French 7 days a week through tickets, Discord and phone. Plans are compared on the VPS page.
07
When it is not the right choice
- You do not want to administer anything: a VPS means keeping up with system and game updates. For the games we offer turnkey (Minecraft, Garry's Mod, Rust, Palworld…), a game offer spares you all that; for Terraria, that is not the case today.
- You play with two or three friends while the host is around: hosting the game from within Terraria is enough, as long as the host stays connected.
- Your players are on Switch or mobile: since version 1.4.6, the official release notes state that Xbox and PlayStation players can join a dedicated server online, with the same game version as the server; for Switch and mobile, the announced cross-play goes through the local network. A tModLoader server only accepts PC players.
- You would rather run the server on Windows: the official server also exists for Windows (
TerrariaServer.exe), and our Windows VPS can host it, at the cost of the memory the system takes. To choose, see Linux or Windows VPS.
- Your players are far from France: all our servers are in France, and distance shows in game.
08
Frequently asked questions
Can I get a Terraria server without installing anything?
With CloudFive's Pterobox, you create your game servers from the customer area without installing anything, on a Ryzen 9 9950X with Anti-DDoS Premium included (cloudfive.fr/en/pterobox). If Terraria is not in the catalogue yet, request it from the customer area. A VPS remains the most flexible option if you want to configure everything yourself.
How do I create a Terraria server on a Linux VPS?
Download the official dedicated server from terraria.org, unzip it, make TerrariaServer.bin.x86_64 executable, write a serverconfig.txt with the world path and autocreate, open port 7777 over TCP, then start the server in tmux or with a systemd service.
Which port does a Terraria server use?
Port 7777 over TCP, the game's default. The official wiki advises also opening 7777 over UDP on a rented server. If you change the port in serverconfig.txt, open the new one instead.
How much RAM does a Terraria server need?
About 500 MB free for a small world according to the official wiki, more for a large world and many players. TShock asks for at least 1 GB, and tModLoader a lot more depending on the mods installed.
TShock or the official Terraria server: which should I choose?
The official server is enough among friends and is released with each new Terraria version. TShock adds accounts, permissions, region protection and plugins, useful for a public server, but it follows new game versions with a delay.
How do I set up a modded Terraria server with tModLoader?
Install tModLoader on the VPS with the official manage-tModLoaderServer.sh script (install-tml --github), copy install.txt and enabled.json from a mod pack into the Mods folder, run install-mods, then start. Players connect with tModLoader and the same mods.
Where are Terraria server worlds stored on Linux?
In ~/.local/share/Terraria/Worlds of the user running the server, as .wld files. With the tModLoader script, they are in the Worlds folder of its installation, with extra .twld files. Type save in the console before copying them, and keep a copy off the VPS.