Skip to content
Terraria

Install a Terraria server

This guide explains how to install a Terraria dedicated server: first locally on Windows to test, then on a VPS or dedicated server. System: Linux or Windows. Allow 30 to 60 minutes for a first installation, excluding download time.

Last updated: 10/9/2026

This guide explains how to install a Terraria dedicated server: first locally on Windows to test, then on a VPS or dedicated server. System: Linux or Windows. Allow 30 to 60 minutes for a first installation, excluding download time.

Step-by-step installation

  1. Check the requirements (CPU, RAM, disk) and choose the host: Windows PC, VPS or dedicated server.

  2. Download the dedicated server from terraria.org ("Dedicated Server" link at the bottom of the page) and unzip it.

  3. On Linux create a non-root user and a dedicated folder; on Windows use a simple folder (e.g. C:\server).

  4. Start the server once to generate its configuration files, then stop it cleanly.

  5. Configure name, password and slot count (see our Terraria tools to generate the files).

  6. Open ports 7777/TCP in the system and provider firewalls; forward them on your router if you host at home.

  7. Test locally (127.0.0.1), then from a connection outside your network.

  8. Create a systemd service (Linux) or a scheduled task (Windows) for automatic startup.

  9. Schedule server backups and updates.

  10. Add your server on game-rank.com/jeux/terraria to get it known.

Requirements

  • System: Linux or Windows.
  • Hardware: not officially documented in the sources consulted; starting point to adjust to your load: RAM 1 / 2 GB, disk 1 GB.
  • Account: no Steam account is needed for the server downloaded from terraria.org; players must own the game and run the same version.
  • Network: a public IP (or port forwarding) with ports 7777/TCP open.
  • Access: SSH (Linux) or Remote Desktop (Windows Server); an SSD is recommended.

Local installation (Windows)

Download and unzip the server from terraria.org, then run TerrariaServer.exe from the Windows folder. You can also use our serverconfig.txt generator. Then join from the game on 127.0.0.1.

cd C:\terraria-server\<version>\Windows
TerrariaServer.exe -config serverconfig.txt

Installation on a Linux VPS or dedicated server (Ubuntu/Debian)

Create a dedicated user without root rights, install unzip and tmux, download the server from terraria.org (copy the address of the "Dedicated Server" link), unzip it and make the files executable.

sudo apt update && sudo apt install -y unzip tmux wget
sudo adduser --disabled-password --gecos "" terraria
# then, as the terraria user (sudo -iu terraria):
mkdir -p ~/server && cd ~/server
wget -O terraria-server.zip "<address of the Dedicated Server link on terraria.org>"
unzip terraria-server.zip
ln -s ~/server/*/Linux ~/server/Linux
cd ~/server/Linux && chmod u+x TerrariaServer*
./TerrariaServer -config serverconfig.txt

Ports to open

Default values; traffic direction is inbound (towards the server).

To change a port, edit it in the server configuration or launch line (serverconfig.txt: port), then adapt the firewall.

  • 7777/TCP — game traffic

Linux firewall (ufw), provider and router

Allow SSH first so you do not lock yourself out, then the game ports. Ports are only reachable if they are also open in the provider firewall (OVH, Hetzner, Scaleway…: "security group" or the panel's network rules).

Hosting at home: create a port forward (NAT) on your router to the server's fixed local IP, for the same ports and protocols. If your ISP uses CGNAT (no public IPv4), forwarding is impossible: ask for a public IP or rent a VPS.

Testing: UDP cannot be tested with a simple web port checker; verify by joining from the game on an outside network (a mobile hotspot, for example) and check the server logs.

sudo ufw allow 22/tcp
sudo ufw allow 7777/tcp
sudo ufw enable
sudo ufw status verbose

Windows firewall (netsh)

Run these commands in a command prompt started as administrator. When hosting at home, also add the port forward on your router.

netsh advfirewall firewall add rule name="Terraria 7777 TCP" dir=in action=allow protocol=TCP localport=7777

Automatic start on Linux (systemd)

The service restarts the server after a crash and when the machine boots. Enable it with the commands shown in the block.

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

[Service]
Type=forking
RemainAfterExit=yes
User=terraria
WorkingDirectory=/home/terraria/server/Linux
ExecStart=/usr/bin/tmux new-session -d -s terraria '/home/terraria/server/Linux/TerrariaServer -config serverconfig.txt'
ExecStop=/usr/bin/tmux send-keys -t terraria 'exit' Enter
TimeoutStopSec=60

[Install]
WantedBy=multi-user.target

# sudo nano /etc/systemd/system/terraria.service
# sudo systemctl daemon-reload && sudo systemctl enable --now terraria
# console: sudo -u terraria tmux attach -t terraria

Automatic start on Windows (scheduled task)

Create a task that runs the start script when Windows boots, under a dedicated account if possible. Adapt the script path.

schtasks /Create /TN "Terraria Server" /TR "C:\terraria-server\<version>\Windows\start-terraria.bat" /SC ONSTART /RU SYSTEM /RL HIGHEST
schtasks /Run /TN "Terraria Server"
schtasks /End /TN "Terraria Server"

Updates, backups and restarts

Terraria has no automatic update: download the new server archive from terraria.org for each game version (players and server must run the same version), then keep serverconfig.txt and the worlds.

sudo systemctl stop terraria
# download the new archive from terraria.org, unzip it, keep serverconfig.txt
mkdir -p ~/backups
tar czf ~/backups/terraria-$(date +%F).tar.gz -C ~/.local/share/Terraria Worlds
find ~/backups -name 'terraria-*.tar.gz' -mtime +14 -delete
sudo systemctl start terraria
# Windows worlds: %USERPROFILE%\Documents\My Games\Terraria\Worlds

Listing and finding your server

Once the server is stable, add it on game-rank.com/jeux/terraria (the website of the owner of these tools) with its connection address, slots, language and version. Direct connection address to share: <IP>:7777 (depending on the game version). Never publish an admin password.

Troubleshooting

  • The server does not appear in the list — cause: query ports closed or server not listed. Fix: open 7777/TCP, check name/password and wait a few minutes; join directly by IP to test.
  • Cannot connect from the Internet but fine locally — cause: system/provider firewall, missing port forward or CGNAT. Fix: check all three levels (ufw/Windows, provider, router) and the protocol (UDP/TCP).
  • The server exits at startup or runs out of memory — cause: not enough RAM, missing libraries or wrong working directory. Fix: run it in the foreground, read the logs, add RAM or swap.
  • Players see an incompatible version after a game update — cause: server not updated. Fix: stop it, update it (see the Updates section), then restart.
  • Configuration changes are ignored or overwritten — cause: file edited while the server runs, wrong folder or syntax error. Fix: stop the server, edit the right file, validate the syntax (JSON/XML) and restart.

Frequently asked questions

What machine do I need for a Terraria server?
Hardware: not officially documented in the sources consulted; starting point to adjust to your load: RAM 1 / 2 GB, disk 1 GB.
Which ports should I open?
Open 7777/TCP inbound, in the system firewall, at the provider and on your router if needed. These are the default values and can be changed in the server configuration.
Do I need to own the game to host?
The server is a free download on terraria.org; players must own the game.
How do I update the server?
Terraria has no automatic update: download the new server archive from terraria.org for each game version (players and server must run the same version), then keep serverconfig.txt and the worlds.
Can I host at home?
Yes, if your connection has a public IP and you can forward ports on your router. With CGNAT or a weak upload, prefer a VPS or dedicated server.

Tools for your Terraria server

Terraria
TerrariaOpen access
Generate serverconfig.txt for your Terraria server: world, autocreate, difficulty, maxplayers, port, password, secure, language. Free, 100% in your browser.
ConfigurationOpen
Documentation
Terraria
TerrariaOpen access
Generate the launch script (start-terraria.sh / start-terraria.bat) for your Terraria server: -config, -world, -port, -players, -pass, -secure, -noupnp, -steam. Free, in your browser.
LaunchConfigurationOpen
Documentation