---
title: "How to host a Terraria server on a Linux VPS | StreetHosting"
description: "Terraria server on a Linux VPS: official server or TShock, serverconfig.txt, TCP port 7777, systemd service, updates and automatic world backups."
url: "https://streethosting.com.br/en/guides/vps/host-terraria-server"
type: "page"
language: "en-US"
---

VPS · 10 min · Beginner

Published on Sep 28, 2026 · Updated on Sep 28, 2026

# Terraria dedicated server on Linux, with your world always online

Terraria is one of the lightest game servers around and runs fine even on the smallest VPS. Learn how to install the official server, configure the world, open the right port and decide when it is worth moving to TShock.

By [Equipe StreetHosting](https://streethosting.com.br/en/autores#equipe-streethosting) · StreetHosting infrastructure and support team

[Monitoring and alerts](https://streethosting.com.br/en/guides/topics/monitoring) [Linux administration](https://streethosting.com.br/en/guides/topics/linux) [Hardware and datacenter](https://streethosting.com.br/en/guides/topics/hardware) [Other games](https://streethosting.com.br/en/guides/topics/other-games)

Summarize with:

[](https://chat.openai.com/?q=Summarize%20the%20key%20points%20of%20this%20StreetHosting%20guide%3A%20https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fvps%2Fhost-terraria-server.%20Highlight%20the%20step-by-step%20instructions%2C%20the%20prerequisites%20and%20the%20most%20common%20mistakes. "ChatGPT") [](https://claude.ai/new?q=Summarize%20the%20key%20points%20of%20this%20StreetHosting%20guide%3A%20https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fvps%2Fhost-terraria-server.%20Highlight%20the%20step-by-step%20instructions%2C%20the%20prerequisites%20and%20the%20most%20common%20mistakes. "Claude") [](https://www.google.com/search?udm=50&aep=11&q=Summarize%20the%20key%20points%20of%20this%20StreetHosting%20guide%3A%20https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fvps%2Fhost-terraria-server.%20Highlight%20the%20step-by-step%20instructions%2C%20the%20prerequisites%20and%20the%20most%20common%20mistakes. "Google AI Mode") [](https://x.com/i/grok?text=Summarize%20the%20key%20points%20of%20this%20StreetHosting%20guide%3A%20https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fvps%2Fhost-terraria-server.%20Highlight%20the%20step-by-step%20instructions%2C%20the%20prerequisites%20and%20the%20most%20common%20mistakes. "Grok") [](https://www.perplexity.ai/search/new?q=Summarize%20the%20key%20points%20of%20this%20StreetHosting%20guide%3A%20https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fvps%2Fhost-terraria-server.%20Highlight%20the%20step-by-step%20instructions%2C%20the%20prerequisites%20and%20the%20most%20common%20mistakes. "Perplexity")

Share:

[](https://x.com/intent/tweet?text=How%20to%20host%20a%20Terraria%20server%20on%20a%20Linux%20VPS&url=https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fvps%2Fhost-terraria-server "Share on X") [](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fvps%2Fhost-terraria-server "Share on Facebook") [](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fvps%2Fhost-terraria-server "Share on LinkedIn") [](https://wa.me/?text=How%20to%20host%20a%20Terraria%20server%20on%20a%20Linux%20VPS%20https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fvps%2Fhost-terraria-server "Share on WhatsApp")

For agents: Copy as Markdown [.md](https://streethosting.com.br/en/guides/vps/host-terraria-server.md)

In this guide 8 sections

* [How much VPS Terraria needs](https://streethosting.com.br/en/guides/vps/host-terraria-server#requisitos)
* [Official server, TShock or tModLoader](https://streethosting.com.br/en/guides/vps/host-terraria-server#oficial-tshock)
* [Install the official server](https://streethosting.com.br/en/guides/vps/host-terraria-server#instalar)
* [Configure the world](https://streethosting.com.br/en/guides/vps/host-terraria-server#configurar)
* [Port 7777 and firewall](https://streethosting.com.br/en/guides/vps/host-terraria-server#portas)
* [systemd service and updates](https://streethosting.com.br/en/guides/vps/host-terraria-server#systemd)
* [Administration and world backups](https://streethosting.com.br/en/guides/vps/host-terraria-server#administrar)
* [Which VPS to choose](https://streethosting.com.br/en/guides/vps/host-terraria-server#qual-vps)

Quick answer

To **host a Terraria server** on a VPS, download the dedicated server package from terraria.org, extract the Linux folder, describe the world in a serverconfig.txt and run the TerrariaServer.bin.x86\_64 binary as a systemd service. Open TCP port 7777 in the firewall. For a group of up to 8 friends, a VPS with 2 GB of RAM and 2 vCPU is enough.

## How much VPS Terraria needs[](https://streethosting.com.br/en/guides/vps/host-terraria-server#requisitos)

The Terraria server is light. The simulation runs on essentially one core, and memory usage depends more on world size and on how many players are spread across it than on anything else. A large world with people exploring opposite sides of the map keeps more sections loaded at once than a group playing together at the same base.

| Scenario                                                | RAM          | vCPU      | Disk  | Suggested plan                  |
| ------------------------------------------------------- | ------------ | --------- | ----- | ------------------------------- |
| Up to 8 players, official server, small or medium world | 2 GB         | 2         | 10 GB | Xeon VPS R$ 26.00               |
| 8 to 16 players, large world                            | 4 GB         | 2 to 3    | 20 GB | Xeon VPS R$ 43.00               |
| 16 to 32 players with TShock and plugins                | 4 GB         | 2         | 20 GB | Ryzen VPS R$ 66.00              |
| tModLoader with a large modpack                         | 6 to 8 GB    | 3 to 4    | 40 GB | Ryzen VPS R$ 92.00 to R$ 118.00 |
| Several worlds on the same VPS                          | 6 GB or more | 3 or more | 40 GB | Ryzen VPS R$ 92.00              |

The rule of thumb: for vanilla and a group of friends, any small plan has machine to spare, and what matters is keeping the VPS in Brazil so ping does not get in the way of boss fights. Once you add many players, plugins that process every movement or heavy mods, per-core speed starts to matter, and that is when it pays to move up to a higher-clocked CPU.

## Official server, TShock or tModLoader[](https://streethosting.com.br/en/guides/vps/host-terraria-server#oficial-tshock)

There are three ways to run Terraria on a VPS, and the choice shapes the rest of the setup.

| Option          | Who it is for                  | What it offers                                              | Watch out for                                       |
| --------------- | ------------------------------ | ----------------------------------------------------------- | --------------------------------------------------- |
| Official server | Group of friends, vanilla game | World, password and basic console commands                  | No accounts or permissions                          |
| TShock          | Public server or community     | Accounts, groups, region protection, anti-cheat and plugins | May take a while to support the newest game version |
| tModLoader      | Players who use content mods   | Its own server that syncs mods with players                 | Uses far more RAM and CPU                           |

This guide installs the official server, which is the foundation for understanding the other two. TShock uses the same worlds and the same port, so you can start vanilla and migrate later without losing anything. tModLoader has its own installer and scripts, documented in the project's official repository, and modded worlds do not come back clean to vanilla.

## Install the official server[](https://streethosting.com.br/en/guides/vps/host-terraria-server#instalar)

Use a user with sudo to manage the VPS, never root directly. If you do not have one yet, see how to [create a user with sudo](https://streethosting.com.br/en/guides/vps/create-sudo-user-linux-vps). Then create a user just for the game, with no administrator privileges, and install the tools you are going to use. The commands apply to Ubuntu 24.04 and 22.04.

`sudo apt update sudo apt install unzip tmux wget sudo useradd -m -s /bin/bash terraria`

The official server does not go through Steam. The footer of the terraria.org site has the link to the dedicated server for PC, a zip with the Windows, Mac and Linux builds. Copy the address of that link and download it straight on the VPS, already as the terraria user:

`sudo -iu terraria wget -O servidor.zip "COLE_AQUI_O_LINK_DO_SITE" unzip servidor.zip ls`

The zip creates a folder named after the version number. Inside it, the Linux folder is the only one that matters. Move it to a fixed location and make the binary executable, replacing NUMERO with the folder name that `ls` showed:

`mv NUMERO/Linux ~/server chmod +x ~/server/TerrariaServer.bin.x86_64 mkdir -p ~/worlds`

The package already ships everything the binary needs. The worlds and the configuration will live outside the server folder, in `~/worlds` and in `~/serverconfig.txt`, so that updating is just swapping one folder for another.

## Configure the world[](https://streethosting.com.br/en/guides/vps/host-terraria-server#configurar)

Without a configuration file, the server asks questions in the console on every start, which does not work as a service. Create the file with `nano ~/serverconfig.txt`:

`world=/home/terraria/worlds/MeuMundo.wld autocreate=2 worldname=MeuMundo difficulty=1 maxplayers=16 port=7777 password=SenhaDoServidor motd=Servidor Terraria BR worldpath=/home/terraria/worlds banlist=/home/terraria/banlist.txt secure=1`

* **world and autocreate:** if the world file does not exist, the server creates a new one with the given size (1 small, 2 medium, 3 large) and the name from worldname. On later starts, it just loads it.
* **difficulty:** only applies at creation. 0 is classic, 1 is expert, 2 is master and 3 is journey.
* **password:** set a password on a server for friends. Without one, anyone with the IP can join.
* **secure:** set to 1, it turns on the basic anti-cheat protection built into the server.

Do a manual test before creating the service. The first world generation takes a few minutes, especially on the large size:

`cd ~/server ./TerrariaServer.bin.x86_64 -config /home/terraria/serverconfig.txt`

When the message appears saying the server is listening on port 7777, type `exit`, which saves and closes. To use a world that already exists on your PC, send the .wld file to `~/worlds` following the guide on [transferring files to the VPS with SCP and rsync](https://streethosting.com.br/en/guides/vps/transfer-files-to-vps-scp-rsync) and adjust the world line with the file name.

## Port 7777 and firewall[](https://streethosting.com.br/en/guides/vps/host-terraria-server#portas)

Terraria is simple on the network: one TCP port and nothing else. Unlike most games, which use UDP, here the firewall rule has to be TCP. The difference between the two protocols is covered in [TCP vs UDP for servers](https://streethosting.com.br/en/guides/infrastructure/tcp-vs-udp).

| Port        | Protocol | Purpose                         | Open it?                      |
| ----------- | -------- | ------------------------------- | ----------------------------- |
| 7777        | TCP      | Player connections to the world | Yes                           |
| 7778 and up | TCP      | Extra worlds, one per instance  | Only if you run more than one |
| 22          | TCP      | SSH to manage the VPS           | Yes, before enabling UFW      |

`sudo ufw allow OpenSSH sudo ufw allow 7777/tcp sudo ufw enable`

Allow SSH before enabling the firewall, otherwise your session drops and you lose access. The details are in the guide on [the UFW firewall on an Ubuntu VPS](https://streethosting.com.br/en/guides/vps/ufw-firewall-ubuntu-vps). Players join through the multiplayer menu, the join via IP option, entering the VPS IP, the port and the password.

When someone cannot get in, the cause is almost always on this list, in the order worth checking:

* **Version mismatch:** the game updated on Steam and the server stayed on the previous version. The message usually mentions an incompatible version.
* **Rule on UDP:** the port was opened on the wrong protocol. Check with `sudo ufw status` whether 7777/tcp shows up.
* **Server stuck at the console:** without serverconfig.txt, it waits for someone to pick the world. Open tmux and see if there is a pending question.
* **World on a different difficulty:** journey mode characters only join journey worlds, and the reverse also holds.

## systemd service and updates[](https://streethosting.com.br/en/guides/vps/host-terraria-server#systemd)

The Terraria server takes commands through the console, so it will run inside a tmux session controlled by systemd. That way it starts on its own with the VPS and you can still type commands. Leave the game user with exit and create `/etc/systemd/system/terraria.service`:

`[Unit] Description=Servidor Terraria After=network-online.target Wants=network-online.target [Service] Type=forking User=terraria WorkingDirectory=/home/terraria/server ExecStart=/usr/bin/tmux new-session -d -s terraria /home/terraria/server/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=60 Restart=always RestartSec=10 [Install] WantedBy=multi-user.target`

`sudo systemctl daemon-reload sudo systemctl enable --now terraria sudo -iu terraria tmux attach -t terraria`

The last command opens the console. To leave without shutting down the server, press Ctrl+B and then D. To actually stop it, use `sudo systemctl stop terraria`, which sends exit, waits for the world to be saved and only then shuts down.

Server and players need to be on the same version. When the game updates on Steam, everyone's client updates with it and the old server starts refusing connections until you swap the binary.

Since the worlds and the configuration live outside the server folder, updating is downloading the new zip and swapping the folder:

`sudo systemctl stop terraria sudo -iu terraria wget -O servidor.zip "LINK_DA_VERSAO_NOVA" unzip -o servidor.zip rm -rf ~/server mv NUMERO/Linux ~/server chmod +x ~/server/TerrariaServer.bin.x86_64 exit sudo systemctl start terraria`

## Administration and world backups[](https://streethosting.com.br/en/guides/vps/host-terraria-server#administrar)

On the official server, administration happens through the console. The most used commands:

* **playing:** lists who is connected.
* **kick and ban followed by the name:** kick or ban the player. The ban goes to the file set in banlist.
* **password:** shows or changes the password without restarting.
* **save and exit:** save the world; the second one also shuts down the server.

If the community has grown and the console has become limiting, it is time for TShock. Download the Linux build from the project's releases page, extract it into its own folder and check in the release description which Terraria version it supports. On first start, the console shows a setup code: join the game, use `/setup` with that code and create your permanent account in the highest admin group, following the TShock documentation. Plugins go in the ServerPlugins folder.

Terraria keeps a .bak file next to each world, but it only holds the previous version. To have history, as the terraria user create the script `/home/terraria/backup.sh`:

`#!/bin/bash DESTINO=/home/terraria/backups mkdir -p "$DESTINO" /usr/bin/tmux send-keys -t terraria "save" Enter sleep 15 tar -czf "$DESTINO/mundos-$(date +%F-%H%M).tar.gz" -C /home/terraria worlds serverconfig.txt find "$DESTINO" -name 'mundos-*.tar.gz' -mtime +14 -delete`

1. Make it executable: `chmod +x ~/backup.sh`
2. Open the scheduler: `crontab -e`
3. Schedule it every three hours: `0 */3 * * * /home/terraria/backup.sh`

Terraria worlds are small, so you can keep two weeks of copies without weighing on the disk. To avoid depending only on the VPS itself, send those copies somewhere else with the guide on [automatic backups with restic and cron](https://streethosting.com.br/en/guides/vps/vps-backup-restic-cron).

## Which VPS to choose for Terraria[](https://streethosting.com.br/en/guides/vps/host-terraria-server#qual-vps)

Terraria is one of the few games where the cheapest plan genuinely does the job. For a group of friends on the official server, the [Xeon VPS](https://streethosting.com.br/en/vps/xeon) at R$ 26.00 per month, with 2 vCPU, 2 GB of RAM and 20 GB NVMe, handles it with room to spare. The R$ 43.00 tier, with 3 vCPU and 4 GB, fits a large world plus space to run a Discord bot alongside.

When the server is public, with TShock, dozens of players and plugins, or when the group moves to tModLoader, per-core clock starts to count. Then the [Ryzen 9 9950X VPS](https://streethosting.com.br/en/vps/ryzen), with up to 5.7 GHz and DDR5 memory, is the pick: R$ 66.00 with 2 vCPU and 4 GB for TShock, R$ 92.00 with 3 vCPU and 6 GB or R$ 118.00 with 4 vCPU and 8 GB for heavy modpacks. The difference between the two lines is in the guide [Ryzen VPS vs Xeon VPS](https://streethosting.com.br/en/guides/vps/ryzen-vs-xeon-vps).

Every VPS is in São Paulo, with Anti-DDoS included, activation within 60 seconds and upgrades through the control panel paying only the prorated difference. If your community also plays factory games, the same small plan usually works for a [Factorio server](https://streethosting.com.br/en/guides/vps/host-factorio-server).

See the plans for both lines in the [StreetHosting VPS hub](https://streethosting.com.br/en/vps) and start with the smallest tier that covers your group. Scaling up later is quick; paying for an idle machine every month is not worth it.

In this guide

* [How much VPS Terraria needs](https://streethosting.com.br/en/guides/vps/host-terraria-server#requisitos)
* [Official server, TShock or tModLoader](https://streethosting.com.br/en/guides/vps/host-terraria-server#oficial-tshock)
* [Install the official server](https://streethosting.com.br/en/guides/vps/host-terraria-server#instalar)
* [Configure the world](https://streethosting.com.br/en/guides/vps/host-terraria-server#configurar)
* [Port 7777 and firewall](https://streethosting.com.br/en/guides/vps/host-terraria-server#portas)
* [systemd service and updates](https://streethosting.com.br/en/guides/vps/host-terraria-server#systemd)
* [Administration and world backups](https://streethosting.com.br/en/guides/vps/host-terraria-server#administrar)
* [Which VPS to choose](https://streethosting.com.br/en/guides/vps/host-terraria-server#qual-vps)

## Frequently asked questions

Which port does the Terraria server use?

The Terraria server uses port 7777 over TCP by default. It is the only port you need to open in the firewall, and you can change it through the port line in serverconfig.txt. If you do, open the new port and hand the number to players along with the IP.

How much RAM does a Terraria server need?

The official server is light: 2 GB of RAM handles a group of up to 8 players on a small or medium world, and 4 GB gives headroom for a large world and 16 players. Servers running tModLoader with big modpacks are a different story and need 6 to 8 GB.

What is the difference between the official server and TShock?

The official server comes from the game's own developer and only allows basic console commands such as kick, ban and save. TShock is a community-maintained server that adds accounts, permission groups, region protection, anti-cheat and plugins, at the cost of sometimes lagging behind the newest version of the game.

How do I move my world from my PC to the server?

On Windows, the world lives in Documents, My Games, Terraria, Worlds, in a file with the wld extension. Upload that file to the worlds folder on the VPS over SCP or SFTP, point the world line in serverconfig.txt at it and restart the server.

Can I run more than one Terraria world on the same VPS?

Yes. Each world becomes a separate instance, with its own serverconfig.txt, a different port such as 7778 or 7779 and its own systemd service. Open each port in the firewall and add up the RAM usage of every world when choosing the plan.

Next step

See VPS plans

Root VPS in Brazil with NVMe and Anti-DDoS.

[See VPS plans](https://streethosting.com.br/en/vps)

[See Ryzen VPS Ryzen 9 9950X VPS in São Paulo with root access, NVMe and gamer Anti-DDoS.](https://streethosting.com.br/en/vps/ryzen) [See Xeon VPS Xeon VPS for steady workloads, automation and long-running projects.](https://streethosting.com.br/en/vps/xeon)

## Related guides

[VPS Intermediate How to host a Factorio server on a Linux VPS The Factorio headless server is free, runs natively on Linux and fits on a small VPS while the base is modest. Here is how to install it, configure it, handle mods and Space Age and keep the factory saved. 9 min Read guide](https://streethosting.com.br/en/guides/vps/host-factorio-server) [VPS Beginner UFW on Ubuntu VPS: firewall rules without losing SSH UFW makes the Ubuntu firewall simpler, but one rule in the wrong order locks you out of your VPS. Learn how to enable it without losing SSH, open only what you need, deal with Docker, and get back in through the console if something goes wrong. 10 min Read guide](https://streethosting.com.br/en/guides/vps/ufw-firewall-ubuntu-vps) [VPS Advanced How to automate VPS backups with restic and cron A backup that depends on you remembering does not work. With restic and cron you create encrypted snapshots, send them off the VPS, control retention and test restores without daily effort. 9 min Read guide](https://streethosting.com.br/en/guides/vps/vps-backup-restic-cron)

[← Back to the Guide Center](https://streethosting.com.br/en/guides)
