A dedicated Terraria server keeps your shared world online even when the original host is not playing. You control the world, password, player limit, and server rules. If you want to use gameplay mods, you need a separate tModLoader server instead of the standard vanilla dedicated server.

You can host Terraria on a Windows PC or Linux server, but the machine and internet connection must remain available. A hosted Terraria server avoids home-router forwarding, public-IP limitations, and operating-system maintenance.

Terraria server – pixel-art diorama with a multi-storey wooden base, a player with a pickaxe, floating islands and a cave full of ores

What you will learn

  • how to choose between vanilla Terraria and tModLoader
  • how to install a Terraria dedicated server on Windows or Linux
  • how to configure serverconfig.txt and create or import a world
  • how to open port 7777 in the firewall and router
  • how to manage mods, commands, backups, and updates
  • how to fix common connection and version errors

Create a Terraria server in eight steps

  1. Choose vanilla for an unmodified game or tModLoader for mods.
  2. Get the vanilla dedicated server from the Terraria installation folder or the official standalone server package.
  3. Create serverconfig.txt with the world path, port, player limit, and optional password.
  4. Start vanilla with TerrariaServer.exe -config serverconfig.txt on Windows or ./TerrariaServer.bin.x86_64 -config serverconfig.txt on Linux.
  5. Allow at least port 7777/TCP through the firewall and forward it in your router when hosting from home.
  6. Join through Multiplayer → Join via IP and enter the address and port.
  7. For mods, install tModLoader instead and copy install.txt and enabled.json to the server.
  8. Stop the server before backups and regularly protect the world, configuration, and tModLoader data.
Important
The standard vanilla Terraria server does not have its own SteamCMD app. SteamCMD app ID 1281930 belongs to tModLoader only.

Table of contents

Requirements and hardware

Terraria is relatively lightweight compared with many modern survival games. A small vanilla world can run on a modest system, while large groups and modded servers need more memory and CPU time.

Use caseSuggested RAMNotes
1–4 players, vanilla1 GBsmall or medium world
5–8 players, vanilla1–2 GBSSD and a modern CPU core recommended
9–16 players, vanilla2–3 GBgood single-core performance helps
tModLoader with a few mods2–4 GBactual use depends on the mods
large modpack or many players4–6 GB or moremonitor memory use under load

The server configuration accepts up to 255 players, but this is not a realistic performance target for most home systems or small virtual servers. Eight to sixteen players is a practical range for private worlds. Active enemies, projectiles, wiring, farms, and mods all affect performance.

You will also need:

RequirementWhy it matters
Windows or x86-64 LinuxThe official server files target conventional desktop and server systems.
stable internet connectionThe server must remain reachable.
at least port 7777/TCPThis is the default game connection port.
public IPv4 or working public IPv6Incoming players must be able to reach the host.
router access for home hostingRequired to forward the port to the server.
write access to the world directoryTerraria must be able to create and save the world.
Info
Connections behind CGNAT or DS-Lite often do not have a dedicated public IPv4 address. Standard IPv4 port forwarding will not work in that situation. Ask the ISP for a public IPv4 address, use a suitable IPv6 setup, or host the server in a data center.

Self-hosting compared with a hosted server

Self-hostingHosted server
full operating-system controlno home PC running around the clock
no monthly hosting feepublic network reachability is already available
you configure the firewall and routermanagement through a server panel
depends on your local power and internetindependent of your home connection
you maintain updates, security, and backupsless system administration

For a ready-to-use setup without home-network configuration, you can rent a Terraria server from DeinServerHost.

Vanilla server or tModLoader

Vanilla and tModLoader are separate server installations. Select the correct one before downloading files.

Server typeBest forInstallation sourceRequired client
Vanilla dedicated serverunmodified TerrariaTerraria game folder or official standalone packagestandard Terraria client
tModLoader serverWorkshop mods and modpacksSteamCMD app 1281930 or official tModLoader toolstModLoader with matching mods

Choose vanilla when the group wants the standard game without server-side mods. Client-side resource packs do not by themselves require tModLoader.

Choose tModLoader for gameplay mods and modpacks. The server and every player need compatible tModLoader builds, mod lists, dependencies, and mod versions.

Caution
Do not open an important vanilla world from a newer Terraria release in an older tModLoader base without checking compatibility. Always make a backup first.

Install the vanilla Terraria server

On Windows, the normal dedicated server is included with Terraria. Re-Logic also provides an official standalone package for Linux and separate server installations.

Important
Do not use SteamCMD with an invented vanilla Terraria dedicated-server app ID. Update vanilla server files through the Terraria installation or the current official server package.

Create a Terraria server on Windows

  1. Open the Steam library.
  2. Right-click Terraria.
  3. Select Manage → Browse local files.
  4. Find TerrariaServer.exe in the Terraria folder.
  5. Create serverconfig.txt in the same directory.
  6. Open PowerShell in that folder and launch the server with the configuration file.
.\TerrariaServer.exe -config .\serverconfig.txt

The -config parameter selects the configuration file. Use a full path when the file is stored elsewhere:

.\TerrariaServer.exe -config "C:\Terraria-Server\serverconfig.txt"

You can alternatively download the official dedicated-server package from the Terraria website and extract it to a separate folder. This keeps the game client and server installation independent.

Tip
Create a shortcut or a start-server.bat file so the command is easy to run again.
@echo off
TerrariaServer.exe -config serverconfig.txt
pause

Create a Terraria server on Linux

Download the current official Terraria dedicated-server package and copy its Linux files to a directory such as /opt/terraria. Run the service through a dedicated account rather than root whenever possible.

Example layout:

/opt/terraria/
├── TerrariaServer.bin.x86_64
├── serverconfig.txt
└── worlds/

Assign ownership and make the binary executable:

sudo chown -R terraria:terraria /opt/terraria
sudo -u terraria chmod +x /opt/terraria/TerrariaServer.bin.x86_64

Start the server with the configuration file:

cd /opt/terraria
sudo -u terraria ./TerrariaServer.bin.x86_64 -config /opt/terraria/serverconfig.txt

If the file does not launch, check the architecture and permissions first:

file /opt/terraria/TerrariaServer.bin.x86_64
ls -l /opt/terraria/TerrariaServer.bin.x86_64

Start Terraria automatically with systemd

Create /etc/systemd/system/terraria.service:

[Unit]
Description=Terraria Dedicated Server
After=network-online.target
Wants=network-online.target

[Service]
Type=simple
User=terraria
Group=terraria
WorkingDirectory=/opt/terraria
ExecStart=/opt/terraria/TerrariaServer.bin.x86_64 -config /opt/terraria/serverconfig.txt
Restart=on-failure
RestartSec=5
KillSignal=SIGINT
TimeoutStopSec=60

[Install]
WantedBy=multi-user.target

Reload systemd and enable the service:

sudo systemctl daemon-reload
sudo systemctl enable --now terraria.service

Check its state and live log:

sudo systemctl status terraria.service
sudo journalctl -u terraria.service -f
Important
After the first launch, verify that the world is being written to the expected directory. Relative paths and missing write permissions are common Linux setup problems.

For similar self-hosted survival-game setups, see How to create a Valheim server and How to create a Project Zomboid server.

Configure the Terraria server

serverconfig.txt stores the main server options and is loaded with -config serverconfig.txt. Lines beginning with # are comments and are ignored.

Important serverconfig.txt options

SettingPurposeExample
world=full path to an existing or new .wld fileworld=/opt/terraria/worlds/my-world.wld
autocreate=1/2/3creates a missing world: 1 small, 2 medium, 3 largeautocreate=2
worldname=name used for an automatically created worldworldname=FriendsWorld
worldpath=directory used to store world filesworldpath=/opt/terraria/worlds
port=listening portport=7777
maxplayers=maximum player count from 1 to 255maxplayers=8
password=join password; leave empty for nonepassword=ChangeThisPassword
motd=message shown to joining playersmotd=Welcome to our world!
difficulty=world difficulty used during automatic creationdifficulty=1
secure=1enables additional cheat protectionsecure=1
language=language code for server messageslanguage=en-US
banlist=path to the ban listbanlist=banlist.txt
upnp=automatic UPnP port forwardingupnp=0

Difficulty values used when creating a world:

ValueDifficulty
0Classic
1Expert
2Master
3Journey
Important
difficulty is applied when the world is created. Changing the value does not convert an existing world to another difficulty.

Linux serverconfig.txt example

# World file and directory
world=/opt/terraria/worlds/friends-world.wld
worldpath=/opt/terraria/worlds
autocreate=2
worldname=FriendsWorld
difficulty=0

# Network and players
port=7777
maxplayers=8
password=ChangeThisPassword

# Messages and protection
motd=Welcome to our Terraria server!
secure=1
language=en-US
banlist=/opt/terraria/banlist.txt
upnp=0

Use Windows paths when hosting on Windows:

world=C:\Terraria-Server\Worlds\FriendsWorld.wld
worldpath=C:\Terraria-Server\Worlds
Caution
Do not publish a real server password in screenshots, source repositories, or support posts. Anyone who can read serverconfig.txt can see the password.
Important
Changes to serverconfig.txt take effect only after a server restart. Run save, then close the server cleanly with exit before restarting it.

Create or load a Terraria world

The server can generate a new world during its first launch or load an existing .wld file.

Automatically create a new world

Set a target path, world size, and name:

world=/opt/terraria/worlds/new-world.wld
autocreate=2
worldname=NewWorld
difficulty=0

World size values:

ValueSize
1small
2medium
3large

At startup, Terraria checks the file set under world=. If no file exists and autocreate is enabled, it generates a new world.

Import an existing world

  1. Fully stop the game or old server.
  2. Locate the required .wld file.
  3. Copy it to the new server's world directory.
  4. Set world= to the file's full path.
  5. Give the server account read and write permission.
  6. Start the server and confirm the world name in the console.

Common local world locations:

SystemDefault path
Windows%USERPROFILE%\Documents\My Games\Terraria\Worlds\
Linux~/.local/share/Terraria/Worlds/
dedicated serverthe path configured under world= or worldpath=

A world may also have .wld.bak or other .bak backup files. tModLoader commonly stores mod-specific world data in a matching .twld file. Always transfer the .wld and .twld pair together for a modded world.

Caution
Never open an important world with a different server version for the first time without a backup. A world saved in a newer format might not be safely downgraded.

Configure the Terraria port and firewall

The default Terraria server port is 7777. Standard direct connections use TCP.

PurposePortProtocolRequired
Terraria game connection7777TCPyes
extra rule used by some hosting templates7777UDPusually not required for a normal direct connection

Allow the port in Windows Firewall

Open PowerShell as Administrator:

New-NetFirewallRule -DisplayName "Terraria Server TCP 7777" -Direction Inbound -Protocol TCP -LocalPort 7777 -Action Allow

Optional UDP rule:

New-NetFirewallRule -DisplayName "Terraria Server UDP 7777" -Direction Inbound -Protocol UDP -LocalPort 7777 -Action Allow

Allow the port with UFW on Linux

sudo ufw allow 7777/tcp
sudo ufw status

Optional UDP rule:

sudo ufw allow 7777/udp

Forward the port in a home router

Create a forwarding rule to the local IP address of the Terraria host:

Router fieldExample
external port7777
internal port7777
protocolTCP
destinationlocal server address, for example 192.168.1.50

Reserve the server's local address through DHCP so it does not change later.

Tip
Test the port only while the Terraria server is running. A closed application produces a failed port test even when the router and firewall rules are correct.

If the public address fails only from inside the same network, try the local address. Some routers do not support NAT loopback.

Connect to the Terraria server

  1. Launch the same Terraria version used by the server.
  2. Open Multiplayer.
  3. Select a character.
  4. Choose Join via IP.
  5. Enter the server address.
  6. Confirm port 7777 unless it was changed.
  7. Enter the server password when required.
Player locationAddress to use
same computer127.0.0.1 or localhost
same home networklocal server address, for example 192.168.1.50
over the internetpublic IP address or a domain pointing to it
Important
A standard Terraria client cannot join a modded tModLoader server. Launch tModLoader and make sure client and server use matching tModLoader and mod versions.

Create a tModLoader server for mods

Terraria gameplay mods require tModLoader, which is installed separately from vanilla Terraria. You can install the server through SteamCMD app ID 1281930 or use the official tModLoader management script.

Install tModLoader with SteamCMD

Install SteamCMD using Valve's official instructions. Create an installation directory and download tModLoader with a Steam account:

mkdir -p /opt/tmodloader/server
steamcmd +force_install_dir /opt/tmodloader/server +login YOUR_STEAM_USERNAME +app_update 1281930 validate +quit

Steam may request Steam Guard or two-factor verification during the first sign-in. Make the launch script executable and start the server:

cd /opt/tmodloader/server
chmod +x start-tModLoaderServer.sh
./start-tModLoaderServer.sh -config /opt/tmodloader/serverconfig.txt

On Windows, use the batch file:

start-tModLoaderServer.bat -config C:\tModLoader-Server\serverconfig.txt

Install with manage-tModLoaderServer.sh

The official management script can install tModLoader, Workshop mods, and updates. Place manage-tModLoaderServer.sh in the main server directory and prepare the expected folder structure.

chmod +x manage-tModLoaderServer.sh
./manage-tModLoaderServer.sh install-tml --username YOUR_STEAM_USERNAME

After adding the mod lists, install the mods:

./manage-tModLoaderServer.sh install-mods

Start the server with:

./manage-tModLoaderServer.sh start

When using a custom location, repeat the same --folder argument in later commands.

Install mods on the tModLoader server

The easiest method is to export a mod pack from a tModLoader client:

  1. Open Workshop → Mod Packs in tModLoader.
  2. Enable the required mods.
  3. Select Save Enabled as New Mod Pack.
  4. Select Open Mod Pack Folder.
  5. Copy install.txt and enabled.json to the server's Mods directory.
  6. Run ./manage-tModLoaderServer.sh install-mods or use the equivalent installation function in your server manager.
  7. Restart the server and check the log for missing dependencies.
FilePurpose
install.txtSteam Workshop IDs to download
enabled.jsoninternal mod names enabled at startup
.tmodlocally stored mod file
.twldmodded world data paired with the .wld file

Example layout:

/opt/tmodloader/
├── manage-tModLoaderServer.sh
├── serverconfig.txt
├── Mods/
│   ├── install.txt
│   └── enabled.json
├── Worlds/
│   ├── modded-world.wld
│   └── modded-world.twld
└── server/
    └── start-tModLoaderServer.sh
Important
tModLoader can be based on an older Terraria release than the current vanilla game. The server, client, tModLoader branch, mods, and dependencies must be compatible. Back up the full setup before updating any one component.
Tip
For a mod mismatch, compare enabled.json, Workshop IDs in install.txt, the tModLoader build, and every missing dependency reported in the server log.

Terraria server commands and administration

Enter commands directly in the running server console. No leading slash is required there.

CommandFunction
helpdisplays available console commands
playinglists connected players
savesaves the world
exitsaves and shuts down the server
exit-nosaveshuts down without saving
kick PlayerNameremoves a player
ban PlayerNameadds a player to the ban list
passworddisplays the current password
password NewPasswordchanges the password for the running session
say Messagebroadcasts a server message
motddisplays the current message of the day
motd New messagechanges the message of the day
versionprints the server version
timedisplays the world time
portdisplays the listening port
maxplayersdisplays the player limit
dawn, noon, dusk, midnightchanges the time of day
Caution
exit-nosave discards progress since the last save. Use it only when you intentionally want to return to an earlier state.

Setting secure=1 adds protection against certain cheats, but it does not replace current software, secure file permissions, or proper network administration.

Back up the Terraria server

The world is the most important server data. Stop the server before copying files, or run save followed by exit, so the backup does not capture a file while it is being written.

Files to include

File or directoryReason
*.wldmain Terraria world
*.wld.bak and other .bak filesautomatic backup copies
*.twld for tModLoadermod-specific world data
serverconfig.txtserver settings
banlist.txtbanned players
Mods/install.txtWorkshop IDs in the mod pack
Mods/enabled.jsonenabled mods
local .tmod files and mod configurationcontent that might not be recoverable from Workshop alone

Linux backup example

sudo systemctl stop terraria.service
sudo tar -czf /srv/backups/terraria-$(date +%F-%H%M).tar.gz \
  /opt/terraria/worlds \
  /opt/terraria/serverconfig.txt \
  /opt/terraria/banlist.txt
sudo systemctl start terraria.service

Adjust paths and the service name to match your installation.

Windows backup example

$Date = Get-Date -Format "yyyy-MM-dd-HHmm"
New-Item -ItemType Directory -Force "D:\Terraria-Backups\$Date" | Out-Null
Copy-Item "C:\Terraria-Server\Worlds" "D:\Terraria-Backups\$Date\Worlds" -Recurse
Copy-Item "C:\Terraria-Server\serverconfig.txt" "D:\Terraria-Backups\$Date\serverconfig.txt"
Tip
Keep at least one copy outside the server's own storage. A backup on the same SSD does not protect against disk failure, a destructive configuration mistake, or accidental deletion of the whole server.

Update the Terraria server

Update vanilla Terraria

  1. Create a complete backup.
  2. Shut down the server cleanly.
  3. Update Terraria through Steam or download the current official dedicated-server package.
  4. Replace program files without overwriting the world, serverconfig.txt, or ban list.
  5. Start the server and confirm the version printed in the console.
  6. Join with a client running the same Terraria version.
Important
The standalone package must match the current game release. Clients may be unable to join an outdated server after a Terraria update.

Update tModLoader and mods

With the management script, update tModLoader and the mods listed in install.txt:

./manage-tModLoaderServer.sh install

Update mods only:

./manage-tModLoaderServer.sh install-mods

Update tModLoader only:

./manage-tModLoaderServer.sh install-tml

For a direct SteamCMD installation, run the app update again:

steamcmd +force_install_dir /opt/tmodloader/server +login YOUR_STEAM_USERNAME +app_update 1281930 validate +quit

Before the first post-update launch, verify that all mods support the installed tModLoader build. For a major migration, archive the entire old server directory as well as the normal world backup.

Troubleshooting

ProblemLikely causeFix
Server cannot be reached from the internetfirewall or forwarding rule is missingallow 7777/TCP in the host firewall and router; verify the destination IP
Port test says closedserver is stopped or listening on another portstart the server, check port in the console, and test again
Connection works only inside the home networkno public IPv4, CGNAT, or DS-Literequest public IPv4, use public IPv6, or host externally
Public IP fails only from the same LANrouter lacks NAT loopbackuse the local server address from inside the LAN
Wrong world loadsworld= points to another file or relative pathuse a full path and read the startup log
World cannot be savedserver account lacks write accesscorrect ownership and permissions on the world directory
Configuration changes do not applyserver was not restarted or another file is loadedstop with save and exit; check the -config path
Password is rejectedold configuration is still active or the entry is wrongrestart the server and check the exact password line
Vanilla client cannot joinserver is running tModLoaderlaunch tModLoader or run a vanilla server
tModLoader reports a mod mismatchmissing or different mods and versionscompare enabled.json, install.txt, dependencies, and tModLoader build
Modded world has missing content.twld is missing or required mods are disabledrestore .wld and .twld together and enable the mods
Server fails after an updateincompatible mod or incomplete filesrestore the backup, read the log, test mods individually, validate files
Players receive “Lost connection”version mismatch, unstable connection, or mod failurecompare client/server versions and inspect the log and network
Linux server exits immediatelywrong architecture, permissions, or pathscheck file, ls -l, working directory, and the systemd journal
Tip
Start troubleshooting with the server console or log. It normally reveals the loaded world path, port, version, and missing mod dependencies.

Frequently asked questions

How much RAM does a Terraria server need?

A small vanilla Terraria server usually needs about 1 to 2 GB of RAM. Plan for 2 to 4 GB or more for larger groups, big worlds, and tModLoader, then monitor actual use.

Which port does a Terraria server use?

A Terraria server uses port 7777/TCP by default. Allow the port in the firewall and forward it to the local server address when hosting from home.

What is the difference between the normal server and tModLoader?

The normal dedicated server runs unmodified Terraria, while tModLoader provides server-side mods and modpacks. tModLoader servers and players need compatible builds and matching mods.

How do I install mods on a Terraria server?

Install mods on a tModLoader server through Steam Workshop and the mod-pack files install.txt and enabled.json. Copy them into the server's Mods directory, install the Workshop items, and restart the server.

How many players can a Terraria server support?

The server configuration supports a maximum of 255 players. Eight to sixteen players is much more practical for a typical private server because world activity, networking, and mods affect performance.

Where are Terraria world files stored?

Terraria worlds are .wld files stored in the configured world or worldpath location. Local defaults are commonly %USERPROFILE%\Documents\My Games\Terraria\Worlds\ on Windows and ~/.local/share/Terraria/Worlds/ on Linux.

How do I create a new world on the server?

Set autocreate=1, 2, or 3, add worldname=, and define the target file under world=. Terraria creates the world during startup when no file exists at that path.

More dedicated-server setup guides:

Planned Terraria topics include a complete serverconfig.txt reference, tModLoader administration, mod installation, world transfers, backups, console commands, and performance tuning.

Summary

For a normal Terraria server, run TerrariaServer.exe on Windows or TerrariaServer.bin.x86_64 on Linux. Store settings in serverconfig.txt, use port 7777/TCP, and select a world with world= or generate one through autocreate. Mods require a separate tModLoader installation with compatible versions on the server and every client.

Back up the world and configuration before every update, and stop the server before manually copying world files. To avoid router setup, public-IP restrictions, and operating-system maintenance, you can use a hosted Terraria server.